Apache Server Status Host Status View

Source: Internet
Author: User
Tags cpu usage

If you are not loading this module, if you are a Linux server, then you will need to recompile Apache

, compile with parameter--enable-module=so, if you are a Windows system.

, no need for any compilation, just put the time just said LoadModule Status_module

modules/mod_status.so This sentence plus, if the front with a #, open, you need to remove the #

Http:// will indicate that the Access Status page can be per n

Second automatic refresh once;

Increase in httpd.conf
#-apache Server Status--------------
Extendedstatus on

SetHandler Server-status
Order Deny,allow
Deny from all
Allow from
##--apache Server status--end---------

Deny from represents a prohibited access address and can be commented on if the access error occurs, but the security is reduced

Allow from represents the allowed address access. Here should write the allowed client IP that doesn't seem to be the domain

Extendedstatus on indicates that detailed request information can be seen while the visit is in the

Can only be used for global settings and cannot be turned on or off in a particular virtual host. Enable Extended state information

Will cause the server to run less efficiently.


The default is to view information for the first virtual host ...

Apache Server Status for aa.bb.com
Server Version:apache
Server BUILT:APR 4 2010 17:19:54



Current Time:friday, 30-jul-2010 14:58:01 CST
Restart Time:friday, 30-jul-2010 14:57:38 CST
Parent Server generation:0
Server uptime:23 seconds
Total Accesses:1-Total traffic:1 KB
CPU usage:u0 s0 cu0 cs0
.0435 requests/sec-44 b/second-1024 b/request
1 requests currently being processed, 9 idle workers

Scoreboard Key:
"_" Waiting for Connection, "S" starting Up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (Read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

SRV PID Acc M CPU SS Req Conn child Slot Client vhost Request
0-0 9297 0/1/1 _ 0.00 One 134 0.0 0.00 0.00 114.92.*.222 Aa.bb.com Get

/sec http/1.1
1-0 9306 0/0/0 W 0.00 0 0 0.0 0.00 0.00 114.92.*.222 Aa.bb.com Get

/server-status http/1.1


SRV Child Server Number-generation
PID OS Process ID
ACC number of accesses this connection/this child/this slot
M Mode of operation
CPU CPU usage, number of seconds
SS Seconds Since beginning of most recent request
Req milliseconds required to process most recent request
Conn Kilobytes transferred this connection
Child Megabytes Transferred
Slot Total Megabytes transferred this Slot



Apache Server at aa.bb.com Port 80
Each field in the output of the server-status represents the following meanings:
Field description
Version of server version Apache servers.
Server Built when the Apache server compiles the installation.
Current time of the system.
Restart Time Apache reboot.
Parent Server Generation Generation of Apache Parent program (parent process)

Number is the number of times the httpd received the Sighup and restarted.
Server uptime The time it has elapsed since Apache was started.
Total accesses to the current number of online quantities and the amount of data transmitted to Apache for this purpose.
CPU Usage The current CPU usage situation.
_swss ..... The current state of all Apache process. Each character represents a program

, you can display a maximum of 256 program states.
Scoreboard Key the above state description. The following are the meanings expressed by each character symbol

* _: Wait for the link.
* S: in boot.
* R: The request is being read.
* W: The response is being sent.
* K: Is in the status of staying online.
* D: Looking for DNS.
* C: Closing the link.
* L: Writing a record file.
* G: Enter the normal closing procedure.
* I: Handle idle.
*.: There is no such program.

The SRV number for the generation of this program and its parent program.
PID Process ID for this program.
ACC represents the number of accesses that are online and processed by this program respectively.
M the current state of the program.
CPU resources consumed by this program.
SS distance from the last time the request was processed.
Req the time spent in 1 per thousand seconds for the last processing of the request.
Conn The amount of data delivered this time online.
The amount of data that the child is sent by the subroutine.
Slot The amount of data transmitted by the Slot.
Addresses of client clients.
Vhost belongs to which virtual host or IP of this host.
Request information presented by the request online.

View Apache requests and turn on Apache Server Status
Look at the load of Apache under Linux, as I said before, the simplest and most effective way is to view

Apache Server status (how to open the Apache server status point here), without opening

In the case of Apache Server status, or the installation of other Web servers, such as Nginx's

, the following commands have a role to play.
Ps-ef|grep httpd|wc-l Command
#ps-ef|grep Httpd|wc-l
Count the number of httpd processes, and even a request initiates a process for use with the Apache server.
Indicates that Apache can handle 1388 concurrent requests, which can be automatically adjusted according to the load.

The peak of each of my servers has reached 2002 per unit.

Netstat-nat|grep-i "80″|wc-l command
#netstat-nat|grep-i "80″|wc-l
Netstat-an will print the current network link state of the system, while Grep-i "80″ is used to extract with 80

Port-related connections, the wc-l is counted by the number of connections.
The final number returned is the total number of requests currently on all 80 ports.

Netstat-na|grep established|wc-l Command
#netstat-na|grep established|wc-l---------Personal test this command than

More accurate
Netstat-an will print the current network link state of the system, while the grep established extracts the established

The information for the connection. Then wc-l statistics.
The final number returned is the total number of established connections for all 80 ports currently.

netstat-nat| | grep ESTABLISHED|WC-To 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]} '

(This statement is very good)
Return sample results:
Last_ack 5
Established 1597
Fin_wait1 51
Fin_wait2 504
Time_wait 1057
The SYN_RECV represents the number of requests waiting to be processed; Established represents the normal data transfer

State; Time_wait representation processing
Completed, the number of requests waiting 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.