The truth about sadcnt/nautopush/pt_cnt and npty.

2007-12-25 11:30:00

(SUMMARY added for archival purposes)

Please help me stamp out the myth that is being perpetuated about

increasing the number of ptys.

Here's is how it's really done for system V ptys, in 99.9% of the cases,

this is all you need:

        set pt_cnt = <num>

followed by a "reconfigure reboot".

Now, if you really, really need more BSD ptys, here's how:

        set npty = <num> (doesn't need to be the same as SV ptys)

but you *must* also edit /etc/iu.ap (see in the appended FAQ entry) and do

a reconfigure boot.

This is what the myth says:

        set pt_cnt=<number desired> RIGHT

        set npty=<same number as pt_cnt> WRONG

        set nautopush=<same number as pt_cnt> WRONG

        set sadcnt=<2 * pt_cnt number> WRONG

And here's why the WRONG are wrong:

        - there is no relation between npty and pt_cnt.

          pt_cnt sets the number of System V ptys; these are the standard

          pseudo terminals used by rlogind/telnetd/xterm/dtterm and

          public domain programs.

          There is no system imposed maximum for pt_cnt; > 3000 can

          certainly be used

          npty is used for BSD style ptys; code that uses them cannot use

          more than 256 ptys; the system imposes a limit of 176.

          You can set npty > 176, but you won't be able to use the

          extra ptys, you'll just pin down and waste some physical memory.

        - there is no need to set nautopush

          nautopush is a variable that sizes a table of "autopushable"

          major device numbers. Basically, it's the maximum size of

          /etc/iu.ap.

          It need not be increased when minor numbers of a device are

          increased.

          System V ptys are not autopush devices

        - there's no need to set sadcnt

          (Sun documentation to the contrary not withstanding)

          Sadcnt limits the number of simultaneous opens to

          /dev/sad/{user,admin}

          No part of the system ever keeps a /dev/sad device open for

          an extended period of time: typically, an open is done, a ioctl

          is done and the device is closed.

          Ergo, there is *never* a need to increase sadcnt

        - final argument:

          The default system parameters disagree with the proposed

          settings:

                nautopush = 32; pt_cnt = 48; sadcnt = 16

I'm at a loss to explain how these myths came into existance; at no

point in time that I can trace was setting nautopush or sadcnt necessary.

I am trying to correct the official Sun documentation; if you still find

some, please let me know.

(Yes, I know about the 2.7 and earlier answerbooks; they even mention

"sad_cnt"; there is no such parameter)

Please leave sadcnt and nautopush alone.




Comments

Got something to say?

You must be logged in to post a comment.