Home >Operation and Maintenance >Apache >Apache checks the current number of concurrencies
1. Check the current number of concurrent accesses to apache:
netstat -an | grep ESTABLISHED | wc -l
Compare the numerical difference between MaxClients in httpd.conf.
2, Check how many processes there are :
ps aux|grep httpd|wc -l
3, You can use the following parameters to view the data:
server-status?auto #ps -ef|grep httpd|wc -l 1388
Count the number of httpd processes. Each request will start a process for use on the Apache server.
indicates that Apache can handle 1388 concurrent requests. This value can be automatically adjusted by Apache according to the load.
#netstat -nat|grep -i "80"|wc -l 4341
netstat -an will print the current network link status of the system, while grep -i "80" is used to extract connections related to port 80, and wc -l performs connection number statistics.
The final number returned is the total number of current requests for all 80 ports.
#netstat -na|grep ESTABLISHED|wc -l 376
netstat -an will print the current network link status of the system, and grep ESTABLISHED will extract the information of the established connection. Then wc -l statistics.
The final number returned is the total number of established connections for all current 80 ports.
netstat -nat||grep ESTABLISHED|wc
- You can view detailed records of all established connections
View the number of concurrent requests for Apache and its TCP connection status:
Linux command:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' LAST_ACK 5 SYN_RECV 30 ESTABLISHED 1597 FIN_WAIT1 51 FIN_WAIT2 504 TIME_WAIT 1057
Among them:
SYN_RECV indicates the number of requests waiting to be processed;
ESTABLISHED indicates normal data transmission status;
TIME_WAIT indicates processing Completed, the number of requests waiting for the timeout to expire.
For more technical articles related to Apache, please visit the Apache Tutorial column to learn!
The above is the detailed content of Apache checks the current number of concurrencies. For more information, please follow other related articles on the PHP Chinese website!