View the number of Apache requests in Linux

Source: Internet
Author: User

In Linux, the simplest and most effective way to view Apache Server load is to view Apache Server Status (how to enable Apache Server Status here ), if the Apache Server Status is not enabled, or other Web servers are installed, such as Nginx, the following commands are used.

Ps-ef | grep httpd | wc-lCommand
# Ps-ef | grep httpd | wc-l
1388
Count the number of httpd processes. A single request starts a process and is used on the Apache server.
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.

Netstat-nat | grep-I "80" | wc-lCommand
# Netstat-nat | grep-I "80" | wc-l
4341
Netstat-an prints the current network connection status of the system, while grep-I "80" is used to extract connections related to port 80. wc-l is used to calculate the number of connections.
The final number returned is the total number of requests on all port 80.

Netstat-na | grep ESTABLISHED | wc-lCommand
# Netstat-na | grep ESTABLISHED | wc-l
376
Netstat-an prints the current network connection status of the system, and grep ESTABLISHED extracts information about the ESTABLISHED connection. Then wc-l statistics.
The number returned is the total number of established connections on all port 80.

Netstat-n | awk '/^ tcp/{++ S [$ NF]} END {for (a in S) print a, S [a]}'Command
# Netstat-n | awk '/^ tcp/{++ S [$ NF]} END {for (a in S) print a, S [a]}'
FIN_WAIT_1 286
FIN_WAIT_2 960
SYN_SENT 3
LAST_ACK 32
CLOSING 1
CLOSED 36
SYN_RCVD 144
TIME_WAIT 2520
ESTABLISHED 352
This statement is seen at Zhang banquet. It is said that it was obtained from Wang daoda, Technical Director of Sina interactive community business department. It is very good. The return parameters are described as follows:
SYN_RECV indicates the number of requests waiting for processing;
ESTABLISHED indicates the normal data transmission status;
TIME_WAIT indicates the number of requests that have been processed and wait for the timeout to end.

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.