查看tcp连接数(Check the TCP connection number).doc
文本预览下载声明
查看tcp连接数(Check the TCP connection number)
Check the number of TCP connections in Linux
See which IP connections are connected to the machine
Netstat -an
Check the number of TCP connections
1) statistics 80 port connections
Netstat - NAT | grep - I 80 | wc - l
2) statistics HTTPD protocol connection number
Ps - ef | grep HTTPD | wc -l
3) the state is established
Netstat na | grep ESTABLISHED | wc -l
4) find out which IP address is the most connected, and seal it.
Netstat - na | grep ESTABLISHED | awk {print $5} | awk - F: {print $1} | sort | sort - c | sort - r + 0n
Netstat - na | grep SYN | awk {print $5} | awk - F: {print $1} | sort | sort - c | sort - r + 0n
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1. Check the current concurrent access number of apache:
Netstat - an | grep ESTABLISHED | wc - l
Compare the number of MaxClients in httpd.conf.
2. Check the number of processes:
Ps aux | grep HTTPD | wc -l
3. You can view the data using the following parameters
Server - the status? auto
# ps - ef | grep HTTPD | wc -l
1388
Count the number of HTTPD processes, and even a request will start a process, using the Apache server.
It says that Apache can handle 1388 concurrent requests, which Apache can adjust automatically depending on 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 the connection to port 80, and wc - l makes the connection count.
The final number returned is the total number of requests for all 80 ports.
# netstat - na | grep ESTABLISHED | wc -l
376
Netstat -an will print the current network link state, while grep ESTABLISHED extracts the information that has been ESTABLISHED. Then wc - l statistics.
The final num
显示全部