Pseudo terminals (ptys) are used for two purposes in Oracle Solaris software:
Supporting remote logins
Providing the interface through which the X Window system creates command interpreter windows
The default number of pseudo terminals is sufficient for a desktop workstation. So, tuning focuses on the number of ptys available for remote logins.
The default number of ptys is now based on the amount of memory on the system. This default should be changed only to restrict or increase the number of users who can log in to the system.
Three related variables are used in the configuration process:
pt_cnt – Default maximum number of ptys.
pt_pctofmem – Percentage of kernel memory that can be dedicated to pseudo terminal support structures. A value of zero means that no remote users can log in to the system.
pt_max_pty – Hard maximum for number of ptys.
pt_cnt has a default value of zero, which tells the system to limit logins based on the amount of memory specified in pct_pctofmem, unless pt_max_pty is set. If pt_cnt is non-zero, ptys are allocated until this limit is reached. When that threshold is crossed, the system looks at pt_max_pty. If pt_max_pty has a non-zero value, it is compared to pt_cnt. The pseudo terminal allocation is allowed if pt_cnt is less than pt_max_pty. If pt_max_pty is zero, pt_cnt is compared to the number of ptys supported based on pt_pctofmem. If pt_cnt is less than this value, the pseudo terminal allocation is allowed. Note that the limit based on pt_pctofmem only comes into play if both pt_cnt and ptms_ptymax have default values of zero.
To put a hard limit on ptys that is different than the maximum derived from pt_pctofmem, set pt_cnt and ptms_ptymax in /etc/system.dfile to the preferred number of ptys. The setting of ptms_pctofmem is not relevant in this case.
To dedicate a different percentage of system memory to pseudo terminal support and let the operating system manage the explicit limits, do the following:
Do not set pt_cnt or ptms_ptymax in /etc/system.d/file.
Set pt_pctofmem in /etc/system.d/file to the preferred percentage. For example, set pt_pctofmem=10 for a 10 percent setting.
Note that the memory is not actually allocated until it is used in support of a pseudo terminal. Once memory is allocated, it remains allocated.
The number of available /dev/pts entries is dynamic up to a limit determined by the amount of physical memory available on the system. pt_cnt is one of three variables that determines the minimum number of logins that the system can accommodate. The default maximum number of /dev/pts devices the system can support is determined at boot time by computing the number of pseudo terminal structures that can fit in a percentage of system memory (see pt_pctofmem). If pt_cnt is zero, the system allocates up to that maximum. If pt_cnt is non-zero, the system allocates to the greater of pt_cnt and the default maximum.
0 to maxpid
When you want to explicitly control the number of users who can remotely log in to the system.
0 (Uses system-defined maximum)
0 to MAXUINT
Should be greater than or equal to pt_cnt. Value is not checked until the number of ptys allocated exceeds the value of pt_cnt.
When you want to place an absolute ceiling on the number of logins supported, even if the system could handle more based on its current configuration values.
0 to 100
When you want to either restrict or increase the number of users who can log in to the system. A value of zero means that no remote users can log in to the system.