4.1.1 Architecture of Cosminexus HTTP Server process (UNIX Version)

Organization of this subsection
(1) Process architecture
(2) Transition of number of processes

(1) Process architecture

The following figure shows the architecture of Cosminexus HTTP Server process.

Figure 4-1 Architecture of Cosminexus HTTP Server process (UNIX Version)

[Figure]

When you start Cosminexus HTTP Server, the control process starts. The control process starts the server process to process the request, and monitors the server process operations. Initially, the control process generates the number of server processes specified in the StartServers directive. Later, the control process increases or decreases the number of server processes based on values specified in the MinSpareServers and MaxSpareServers directives. The MaxClients directive specifies the maximum value for number of server processes. The control process manages the increase or decrease in the number of server processes. This process is called maintenance.

The OS receives the TCP connection of client, from the IP address and port specified in the Listen directive, and reserves the connection in the Listen queue of OS. You can specify the size of the Listen queue in the ListenBacklog directive. The TCP connection that cannot be stored in the Listen queue is not established. One of the server processes picks up a TCP connection stored in the Listen queue and performs the processing.

One server process accepts a single TCP connection and performs the processing. One server process ends after processing the number of HTTP requests specified in the MaxRequestsPerChild directive. In such a case, the control process generates a new server process and continues processing.

The control process is operated by user and group permissions with which Cosminexus HTTP Server is started. The server process is operated with user and group permissions specified in the User and Group directives. For both, control processes and server processes, the process name (execution program name) is httpsd. The process ID of the control process is output to the file specified in the PidFile directive.

(2) Transition of number of processes

To avoid the load concentration on the server, the maintenance generates 2n-1 server processes (n is the number of continuous maintenance executions, where n = 6 if number of processes is more than or equal to 6) in one second. The server processes are generated until the number of waiting processes specified in the MinSpareServers directive can be processed, or the number of all processes equals the number specified in the MaxClients directive. When 8 or more server processes are generated in a single maintenance, an error is logged (info level).

If the request processing ends, the state of the server process changes to the waiting state. If processes in the waiting state increase, only the number of processes specified in the MaxSpareServers directive remains during maintenance and other server processes are terminated.

(a) Notes
(b) Example of transition of number of processes

The following figure shows an example for the transition of number of processes when the specification of HWSKeepStartServers is Off.

The following figure shows an example of transition of number of processes when HWSKeepStartServers is set to On.