Nginx self-monitoring module Ngx_http_stub_status_module provides basic information of Nginx
Add parameter--with-http_stub_status_module when compiling and installing Nginx
After installation, you can check whether the status module is installed by Nginx-v|grep Http_stub_status_module.
PHP-FPM is also self-monitoring, by setting the php-fpm.conf in the
Pm.status_path =/php-fpm_status
Gets the status of the php-fpm in the way that it can get the URL
Add nginx_status.conf
server { listen 80 ; location / nginx_status { stub_status on; access_log off; allow 127.0.0.1;# allow 10.4.1.125; deny all; } location /php-fpm_status { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document _root$fastcgi_script_name ; include fastcgi_params; } }
$ Curl 127.0.0.1/nginx_statusactive connections:1 server accepts handled requests 788163 788163 788163 reading:0 Writin G:1 waiting:0
Active connections
The current number of active client connections including Waiting
connections.
Number of active client connections, including the number of connections in the waiting state
accepts
The total number of accepted client connections.
Total number of client connections received
handled
The total number of handled connections. Generally, the parameter value is the same as accepts
unless some resource limits has been reached
The total number of processing requests. Typically, this value is the same as the value of accepts. Unless some resource constraints are met. For example, set worker_connections 1024; Set the maximum number of concurrent connections that a worker process can open.
requests
The total number of the client requests.
Total Client Requests
Reading
The current number of connections where Nginx is reading the request header.
The current nginx is reading the number of connections to the request header
Writing
The current number of connections where Nginx was writing the response back to the client.
The number of connections the current nginx is writing the response back to the client
Waiting
The current number of the idle client connections waiting for a request.
Number of idle client connections currently waiting to be requested
$ curl 127.0.0.1/php-fpm_statuspool: wwwprocess manager: Dynamicstart time: 16/nov/2014:13:29:11 +0800start since: 77844accepted conn: 202788listen queue: 0max listen queue: 1listen queue len: 128idle processes: 6active processes: 1total processes: 7max active processes: 4max children reached: 0slow requests: 0
Pool Pool Name
Process Manager static or dynamic
Start time
How long the start since started, in seconds
Accepted conn Pool number of requests received
Idle processes free Process number
Listen Queue The number of the request in the queue of pending connections. If This number is Non-zero and then you better increase number of process FPM can spawn.
This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1577269
Zabbix Monitor Nginx and PHP-FPM status