Summary : Problem with running out of ptys

McLaughlin, Steve (smclaughlin@nxt.com)
Tue, 15 Apr 1997 10:02:04 -0400

Thanks to:cda@cosmoslink.net
casper@holland.sun.com
williams@felix.tci.com
dmaccara@bank-banque-canada.ca

Original Question : We are experiencing a problem with our Sun servers
running Solaris 2.5.1. When users connect to them via a PC and start
multiple windows they use up quite a few ptys. The problem is that when
they end their session, occasionally the ptys are still allocated to
them.
After a couple of weeks they accumulate and I have to reboot the servers
to clear them just so people can use the machine.

Can I (a) prevent this or (b) clear ptys that should be free?

Answer from Casper :

The solaris FAQ says:

3.39) 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.

In the unlikely event that you run out of BSD-style ptys,
you can increase them as well. The maximum there is probably
256 as all programs using BSD ptys need to hardcode all the
possible device names and 256 was the maximum previously
found in SunOS 4. 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.

set npty = <num>

Halt the system and boot -r.

--- end of excerpt from the FAQ