Questions about connections

Source: Internet
Author: User
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 -lIs 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.