Some experimental evidence suggests a buffer of 200 entries is optimal when a large number of active processes are present.

nproc

This is the name of the kernel tunable parameter that specifies the maximum number of simultaneous active processes that can be created on the system. Programs that reference this symbol (for example, via nlist(), tuneinfo() or the kmtune command) might have some dependency on the old limits. Because nproc is also dynamically tunable, programs should be prepared for this value changing during operation.

Algorithm Scaling

In rare cases, a large number of processes in the system can affect the performance and scaling of an application program. A program algorithm designed to work with no more than 30,000 (or fewer) processes might not perform well when that number is exceeded.

For instance, consider a program that tracks processes in the system. Assume it internally maintains a hash table for quick look-up of processes. If that hash table is sized optimally for 500 processes, it might not work well for 60,000. Indeed, it might already not work well for 30,000 processes. To address this, it might be sufficient to simply increase the size of the hash table.

Detecting Program Sources That Make Incorrect Assumptions

Programmers can detect some source code issues using lint or similar tools. These tools will report loss of precision or accuracy when PID values returned by functions such as fork() are stored in short data types. Some versions of the C compiler also note such issues when the +w1 option is used to increase warnings.

Programmers can also scan code with tools such as grep to find sequences that need further investigation for dependencies on PIDs. Following is a list of regular expressions that can be useful in scanning program sources:

“short”, “u*int16_t”, “u*int_least16_t”, “[us]bit16”, “cnt_t”, “nlink_t”, “use_t” , “pstat_getproc“, “pstat_getfile“, “MAXPID”, “PID_MAX”, “shm_c*nattch”, “30000”, “_CLASSIC_TYPES”, “nproc”, “fork”

From the output of the scan , you can determine whether any of the references are declarations for variables that are be used to hold PID values or process counts.

Searching for short (or the other types) might produce many false “hits.” If so, consider changing the expressions to look for the substring id or cnt or count on the same line (for example. short[[:space:]].*id). The check for id assumes that most programmers will include that two character sequence in the name of any variable used to hold PID, PGID, or SID values. The check for cnt or count makes the assumption that most programmers will include those sequences in the name of any variable used to count instances of objects such as processes.

9