A group of Apache servers have been built over the past two days. each server has 4 GB of memory and adopts the prefork mode. the number of connections set at the beginning is too small, it took a long time to respond to the user's request. later, I modified the configuration file httpd of Apache2.0.59. conf: a group of Apache servers have been built over the past two days. each server has 4 GB memory and adopts the prefork mode. the number of connections set at the beginning is too small, it took a long time to respond to the user's request. later, I modified the configuration file httpd of Apache 2.0.59. conf:
# prefork MPM# StartServers: number of server processes to start# MinSpareServers: minimum number of server processes which are kept spare# MaxSpareServers: maximum number of server processes which are kept spare# MaxClients: maximum number of server processes allowed to start# MaxRequestsPerChild: maximum number of requests a server process servesStartServers 10MinSpareServers 10MaxSpareServers 15ServerLimit 2000MaxClients 2000MaxRequestsPerChild 10000
View the number of httpd processes (that is, the number of concurrent requests that Apache can process in prefork mode ):
Linux command:
ps -ef | grep httpd | wc -l
Sample returned results:
1388
It indicates that Apache can process 1388 concurrent requests. Apache can automatically adjust this value based on the load. the peak value of each server in my group has reached 2002.
View the number of concurrent Apache requests and their TCP connection status:
Linux command:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
Sample returned results:
LAST_ACK 5
SYN_RECV 30
ESTABLISHED 1597
FIN_WAIT1 51
FIN_WAIT2 504
TIME_WAIT 1057
SYN_RECV indicates the number of requests waiting for processing, ESTABLISHED indicates the normal data transmission status, and TIME_WAIT indicates the number of requests waiting for timeout.
Status: Description
CLOSED: No connection is active or in progress
LISTEN: The server is waiting for incoming call
SYN_RECV: a connection request has arrived, waiting for confirmation
SYN_SENT: The application has started. open a connection.
ESTABLISHED: normal data transmission status
FIN_WAIT1: The application says it has been completed
FIN_WAIT2: the other side has agreed to release
ITMED_WAIT: wait until all groups die
CLOSING: both sides attempt to close at the same time
TIME_WAIT: the other side has initialized a release.
LAST_ACK: waiting for all groups to die