I. Have some doubts about the number of connections. What are the differences between the two statistics below? Can I understand the number of connections as the number of concurrent requests? 1 count port 80 connections netstat-nat | grep-I & quot; 80 & quot; | wc-l2) count the number of httpd protocol connections ps-ef | grephttpd | wc-l 2. You count n... i. Have some doubts about the number of connections. What are the differences between the two statistics below?
Can I understand the number of connections as the number of concurrent requests??
1. Count port 80 connections
Netstat-nat | grep-I "80" | wc-l
2) count the number of httpd connections
Ps-ef | grep httpd | wc-l
2. How did you collect nginx statistics?
1. Count port 80 connections
Netstat-nat | grep-I "80" | wc-l
2) count the number of nginx protocol connections
Ps-ef | grep nginx | wc-l
3. can I understand the number of connections to the database concurrently? How do you calculate this? Are there any differences between the two types? (Can I count the number of connections of memcache, redis, and mongodb processes to determine their connections?)
First
Show processlist
Second
Ps-ef | grep mysqld | wc-l
Thank you !!
Reply content:
I. Have some doubts about the number of connections. What are the differences between the two statistics below?Can I understand the number of connections as the number of concurrent requests??
1. Count port 80 connections
Netstat-nat | grep-I "80" | wc-l
2) count the number of httpd connections
Ps-ef | grep httpd | wc-l
2. How did you collect nginx statistics?
1. Count port 80 connections
Netstat-nat | grep-I "80" | wc-l
2) count the number of nginx protocol connections
Ps-ef | grep nginx | wc-l
3. can I understand the number of connections to the database concurrently? How do you calculate this? Are there any differences between the two types? (Can I count the number of connections of memcache, redis, and mongodb processes to determine their connections?)
First
Show processlist
Second
Ps-ef | grep mysqld | wc-l
Thank you !!
1. The former is the number of connections using port 80, which is generally the number of concurrency; the latter is the number of httpd processes. httpd can create a thread or process for each request, there will also be idle processes, so the latter has nothing to do with the number of concurrency.
2. Same as above.
3. show processlist is a command provided by MySQL to view the number of processes. The latter is the same as the previous command.
If the multi-processing module (MPM) of Apache uses the prefork mode, then:ps -ef|grep httpd|wc -l
Is the number of concurrency. There are also exceptions, because in the htttp-mpm.conf if the number of httpd process configuration in idle state is relatively high, such as your configuration is 100, in fact, your website at this time even if only five concurrency, however, the number of httpd processes is still 100.
The number of connections is not the same as the number of concurrent requests. The number of concurrent requests is the number of requests that are executed at the same time. If the connection is lost, the requests are sent.