Compile and install Nginx Http_stub_status_module to monitor its operational status

Source: Internet
Author: User

Starting with Nginx upgrade (Smooth upgrade):

1) # RM-RF nginx-1.8.0//Delete the original nginx-1.8.0 directory, just delete this one

2) # TAR-XF nginx-1.8.0.tar.gz//Unpacking

3) #cd nginx-1.8.0/

4) #./configure \

>--user=nginx \//Add user Nginx
>--group=nginx \//Add Group Nginx
>--with-http_stub_status_module//Add Http_stub_status_module monitor its running status

5) # Make

6) #cd/usr/local/nginx/sbin/

7) # MV Nginx Nginx.bak//Backup

8) # Cp/root/lnmp_soft/nginx-1.8.0/objs/nginx /usr/local/nginx/sbin/

9) #ln-S/usr/local/nginx/sbin/nginx/usr/sbin///add links so you can use them as commands

# vim/usr/local/nginx/conf/nginx.conf

Add the following code to the server

server {
......

Location/nginx_status {
Stub_status on;
Access_log off;

#加入访问限制
#allow 192.168.4.254;
#allow 192.168.4.9;
#deny all;
}

......

}

One) #nginx-s Reload
#
Curl 127.0.0.1/nginx_status

Active connections:1
Server accepts handled requests
9 9 18
reading:0 writing:1 waiting:0

----------------------------------------------------------------

Data Description:

Active connections: The number of active connections initiated on the backend.

The Server accepts handled Requests:nginx processed a total of 9 connections, successfully created 9 handshakes (proving that there was no failure in the middle), and processed a total of 18 requests.

Reading:nginx the number of header messages read to the client.
Writing:nginx the number of header information returned to the client.
Waiting: When Keep-alive is turned on, this value equals active– (reading + writing), meaning that Nginx has finished processing and is waiting for the next request instruction to reside in the connection.
Therefore, in the case of high access efficiency, the request is processed quickly, the number of waiting is more normal. If the reading +writing number is large, the concurrent traffic is very high and is being processed.

Compile and install Nginx Http_stub_status_module to monitor its operational status

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.