4.1.3 Architecture of HTTP Server process (Windows Version)
The following figure shows the architecture of HTTP Server process.
|
When you start HTTP Server, the control process starts. The control process starts the server process and monitors the server process operations. When the server process starts, the main thread also starts simultaneously. The main thread starts an accept thread to receive requests and starts the request processing server threads equal to the number specified in the ThreadsPerChild directive.
The OS accepts TCP connection of a client, through 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 Listen queue in the ListenBacklog directive. The TCP connection that cannot be stored in the Listen queue is not established. The accept thread accepts the TCP connection from the Listen queue and registers the connection in the request queue with the size specified in the HWSMaxQueueSize directive. One of the server threads picks up this connection, and then receives and processes the HTTP request. If the TCP connection cannot be stored in the request queue as the TCP connection exceeds the HWSMaxQueueSize directive value, the accept thread closes the TCP connection.
The number of server processes and number of server threads do not change.
Both the control process and server process have the same process name, httpsd.exe (the name of the executed program). The process ID of the control process is output to the file that is specified by the PidFile directive.