SUMMARY: The truth about sadcnt/nautopush/pt_cnt and npty.

From: Casper Dik (casper@holland.Sun.COM)
Date: Mon Oct 19 1998 - 07:39:06 CDT


(SUMMARY added for archival purposes, resend because many people got blanks)

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.

------------------------------------------------------------------------
The solaris FAQ says:

3.41) How can I have more than 48 pseudo-ttys?

    Edit /etc/system and add the following line:

        * System V pseudo terminals

        set pt_cnt = <num>

    Halt the system and boot -r.

    You can essentially have as many as you like, but you'll probably
    run into some other limit somewhere. More than 3000 are supported.
    Solaris 2.6 and earlier have telnet/rlogin daemons that do not
    support more than 3844 sessions each.

    Some die-hard system administrator myths as well as some Sun
    documentation claim that you have to increased "sad_cnt", "sadcnt"
    or "nautopush" when adding ptys. There is no truth in this.

    In the unlikely event that you run out of BSD-style ptys,
    you can increase them as well. The maximum here is currently
    176 for pty[p-z][0-9a-f]. This is somewhat less that the BSD
    maximum of 256 limited by 8 bit device minor numbers.

    BSD ttys are awkward to use and all programs I found support SYSV
    ptys without trouble.

        * You don't need this. Increasing this value too much usually
        * just wastes memory.
        * BSD applications never support more than 256 ptys.
        * Solaris 2.x supports no more than 176 BSD ptys.

        set npty = <num>

    But you're not there yet, you also need to edit /etc/iu.ap and
    substitute the new value of "npty-1" for the "47" on the following
    line, in case you do increase the number of BSD style ptys.

                ptsl 0 47 ldterm ttcompat

    Halt the system and boot -r.

    --- end of excerpt from the FAQ

Questions marked with a * or + have been changed or added since
the FAQ was last posted

The most recently posted version of the FAQ is available from
<http://www.wins.uva.nl/pub/solaris/solaris2/>



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:50 CDT