Enable nginx status monitoring

Source: Internet
Author: User
Enable nginx status monitoring 1. nginx's ngx_http_stub_status_module provides the function to get the working status of Nginx since it was last started. Http://service.ap-southeast-1.maxcompute.aliyun-inc.com. this module is based on... enable nginx status monitoring 1. nginx's ngx_http_stub_status_module provides the function to obtain the working status of Nginx since it was last started. Www.2cto.com if it is compiled and installed, you need to-with-http_stub_status_module activation 2. this module is based on a server, so it must be in server 3. nginx. conf configuration 01server02 {03 listen 80; 04 server_name blog.xfz.com; 05 index index.html index.htm index. php; 06 root/data0/htdocs/blog; 07 08 # limit_conn crawler 20; 09 10 location ~. * \. (Php | php5 )? $11 {12 # fastcgi_pass unix:/tmp/php-cgi.sock; 13 fastcgi_pass 127.0.0.1: 9000; 14 fastcgi_index index. php; 15 include fcgi. conf; 16} 17 18 location ~. * \. (Gif | jpg | jpeg | png | bmp | swf) $19 {20 expires 30d; 21} 22 23 location ~. * \. (Js | css )? $24 {25 expires 1 h; 26} 27 location/nginx_status {28 stub_status on; 29 access_log off; 30 allow 192.168.1.1; # set ip31 deny all to access this status information; 32} 33 log_format access' $ remote_addr-$ remote_user [$ time_local] "$ request" '34' $ status $ response "$ http_referer" '35' "$ http_user_agent" $ http_x_forwarded_for'; 36 access_log/data1/logs/access. log access; 37} 38 where the status configuration 1 location/nginx_status {2 stub_status on; 3 access_log off; 4 allow 192.168.1.1; # set ip5 deny all to access this status information; 6} 1 then, reload the nginx configuration 2 through http://blog.xfz.com/nginx_status Value of the available Access Status: Active connections: 1 server accepts handled requests 14 14 21 Reading: 0 Writing: 1 Waiting: 0 explanation: active connections: nginx processes 20 Active connections. Server accepts handled requests: since nginx was started, a total of 200 connections have been processed. the successful creation of 200 handshakes is generally the same as that of the first one. The difference is the number of lost requests, and a total of 286 requests have been processed. Reading: The number of headers that nginx reads to the client. Writing: The number of headers that nginx returns to the client. Waiting: When keep-alive is enabled, this value is equal to active-(reading + writing), meaning Nginx has processed the resident connection waiting for the next request command. This status information is counted from nginx startup, including reloading the configuration file, you can also run the command to View 01 # netstat-n | awk '/^ tcp/{++ S [$ NF]} END {for (a in S) print, S [a]} '02 03 04 TIME_WAIT 1705 ESTABLISHED 325406LAST_ACK 23607FIN_WAIT_1 64808FIN_WAIT_2 58109 CLOSING 710CLOSE_WAIT 491611 12 resolution: 13 CLOSED // no connection is active or 14 LISTEN is in progress // The server is waiting to enter the call 15SYN_RECV // a connection request has arrived, waiting for confirmation that the 16SYN_SENT // application has started, open a connection 17 ESTABLISHED // normal data transmission status/current number of concurrent connections 18FIN_WAIT1 // The application says it has completed 19FIN_WAIT2 // the other side has agreed to release 20ITMED_WAIT // wait until all groups die 21 CLOSING // both sides attempt to disable 22TIME_WAIT at the same time // the other side has initialized a release 23LAST_ACK // wait until all groups die
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.