2.3.2 How to define system parameters

This section describes how to define system parameters required for Cosminexus HTTP Server. For details on the settings, see the manual of the OS that is used.

Organization of this subsection
(1) Maximum size of the shared memory segment
(2) Maximum number of processes
(3) Maximum number of files (Number of file descriptors)
(4) Example of system parameter definitions

(1) Maximum size of the shared memory segment

In Cosminexus HTTP Server, the status information of the server process and the internal trace information are collected in the shared memory. The OS contains a system parameter that controls the maximum size of each segment of the shared memory.

The size (in bytes) of the shared memory that is used in the status information of the server process is 400 KB, and the trace information is 'the MaxClients directive value [Figure]7 KB'. In the system parameter of maximum size of the shared memory segment, set a value that is equal to or more than the above-mentioned value.

The following is an example of the system parameter. The type and contents of system parameter in the OS differ based on versions of the used OS or kernel. For details on the contents of system parameter and the setup method, see the manual of the OS that is used.

In Linux(R)
Maximum size of the shared memory segment: kernel.shmmax (/etc/sysctl.conf)
In AIX and HP-UX (IPF)
Maximum size of the shared memory segment: shmmax

(2) Maximum number of processes

The number of processes on the system and the number of processes for each user are controlled by an OS system parameter. Out of the following processes, consider the total number of start processes that exist in the operating environment, and then set the system parameter:

Control process
Number of start processes: 1
System parameters to be changed: Maximum number of processes for the user who starts the Web server.
Server process
Number of start processes: Value specified in the MaxClients directive
System parameters to be changed: Maximum number of processes for the user specified in the User directive.
CGI process
When the execution of the CGI program is allowed, the CGI process is invoked from each server process when the request is processed.
Number of start processes: The value specified in the MaxClients directive
Number of system parameters to be changed: The maximum number of processes for the user specified in the User directive.
gcache server
The gcache server starts when the SSL session management functionality is enabled.
Number of start processes: 1
System parameters to be changed: The maximum number of processes for the user specified in the User Directive.
rotatelogs process
Start rotatelogs process to divide log entries up by specific time periods.
Number of start processes: The number of rotatelogs programs specified in the CustomLog, ErrorLog, HWSRequestLog, and TransferLog directives.
System parameters to be changed: Maximum number of processes for the user who starts the Web server.
rotatelogs2 process
Start rotatelogs2 process to split the log entries up based on the log file size and output them to multiple log files that wrap around when they all get full.
Number of start processes: The number of rotatelogs2 programs specified in the CustomLog, ErrorLog, HWSRequestLog, and TransferLog directives.
System parameters to be changed: Maximum number of processes for the user
who starts the Web server.

For the process structure of Cosminexus HTTP Server, see the 4.1.1 Architecture of Cosminexus HTTP Server process (UNIX Version).

The following is an example of a system parameter. The type and contents of system parameter of the OS differ depending on the version of the OS or the kernel being used. For details on contents of system parameters and setup method, see the manual of the OS being used.

In Linux
Maximum number of processes for the entire system: kernel.threads-max (/etc/sysctl.conf)
Maximum number of processes per user: nproc (/etc/security/limits.conf)
In AIX
Maximum number of processes per user: maxuproc
In HP-UX (IPF)
Maximum number of processes for the entire system: nproc
Maximum number of processes per user: maxuprc

(3) Maximum number of files (Number of file descriptors)

The number of files that can be opened on the system, and the number of files that can be opened by users are restricted depending upon the system parameters of the OS. Consider the following file descriptors to be used in Cosminexus HTTP Server, and then set the system parameters:

In Linux
Number of file descriptors =
(50 + A [Figure] B + C + 11 [Figure] C [Figure] D + 8 [Figure] E + (F + I) [Figure] G) [Figure] 1.2
In AIX
Number of file descriptors =
(50 + A [Figure] B + C + 3 [Figure] C [Figure] D + 5 + (F + H) ) [Figure] 1.2
In HP-UX (IPF)
Number of file descriptors =
(50 + A [Figure] B + C + 3 [Figure] C [Figure] D + 5 [Figure] E + (F + H) [Figure] G) [Figure] 1.2
(Legend)
A: Number of specified Listen directives (When the Listen directive is not specified: 1)
B: Number of IP addresses allocated to the host
C: Total number of specified CustomLog, ErrorLog, HWSRequestLog, and TransferLog directives
D: When the rotatelogs or rotatelogs2 program is used: 1; When neither program is used: 0
E: Number of concurrently executing CGI scripts (value specified for MaxClients)
F: When SSL is used: 3; when SSL is not used: 2
G: Number of concurrently executing requests (value specified for MaxClients)
H: When reverse proxy is used: 1; when reverse proxy is not used: 0
Also note that the number of file descriptors used in CGI programs or used in external modules that are not a part of Cosminexus HTTP Server, are not included.

(4) Example of system parameter definitions

The following is an example of a system parameter. The type and contents of the system parameter in the OS differ according to the version of the OS or kernel being used. For details on the contents of system parameters and the setup method, see the manual of the OS being used.

In Linux
  • Maximum number of files for the entire system: fs.file-max (/etc/sysctl.conf)
In AIX
In AIX, set the number of file descriptors that a process can open.
  • Soft limit for the number of file descriptors that a user process can open at once: nofiles
    For nofiles, specify a value equal to or greater than the calculated estimate.
  • Hard limit for the number of file descriptors that a user process can open at once: nofiles_hard

For nofiles_hard, specify a value equal to or greater than the value specified for nofiles.

In HP-UX (IPF)
  • Maximum number of files for the entire system: nfile
  • sInitial value for the logical maximum number of file descriptors per process: maxfiles
    For maxfiles, specify a value equal to or greater than the calculated estimate.
  • Physical maximum number of file descriptors per process: maxfiles_lim

For maxfiles_lim, specify a value equal to or greater than the value specified for maxfiles.