Releases: rvalitov/zabbix-php-fpm
Stable work with PHP sockets
More stable release
Fixed
This release solves issues that may happen in some special cases:
- general code rerwite to fix all ShellCheck errors and warnings
- now pools that listen via named TCP port are discovered #26. Previously only unnamed ports were discovered.
Support for all pools
What's new
- added full support for
ondemand
pools - added new triggers that monitor pool's queue
Note: these modifications are not compatible with the previous version of the template. Please, check the new installation and configuration instructions.
Almost stable release without ondemand pm support
This release contains all backward compatible modifications and updates since the initial release of the project. Supports Zabbix 4.0, 4.2, 4.4.
Issues
Ondemand
process manager is not supported well by this template- Trigger Listen Queue Length is not informative.
Main features
- Provides auto discovery of PHP-FPM pools (LLD)
- Detects pools that listen via socket and via TCP
- Supported types of PHP process manager:
- dynamic
- static
- ondemand - has some problems, because of its working logic, see issue #11
- Supports multiple PHP versions, i.e. you can use PHP 7.2 and PHP 7.3 on the same server and we will detect them all
- Supports ISPConfig
- Script is in pure
bash
: no need to installPerl
,Go
or other languages.
Provided Items
We capture only useful data from host and PHP-FPM status page:
-
Number of CPUs
-
For each pool:
- Accepted Connections Per Second - the number of requests accepted by the pool
- Active Processes - the number of active processes
- Idle Processes - the number of idle processes
- Max Children Reached – the number of times, the process limit has been reached, when pm tries to start more children (works only for pm
dynamic
andondemand
) - CPU Utilization - CPU load for all processes of the pool in %
- CPU Average Utilization - CPU load for all processes of the pool in % normalized by number of CPUs
- Listen Queue - the number of requests in the queue of pending connections
- Max Listen Queue - the maximum number of requests in the queue of pending connections since FPM has started
- Listen Queue Length - the size of the socket queue of pending connections
- Queue Utilization - queue usage in %
- Memory Used - how much RAM used by the pool in bytes
- Memory Utilization - how much RAM used by the pool in %
- Process Manager -
dynamic
,ondemand
orstatic
, see PHP manual. - Slow Requests - the number of requests that exceeded your
request_slowlog_timeout
value. - Start Since - number of seconds since FPM has started
- Start Time - the date and time FPM has started
History storage period is from 1 hour to 1 day (depends on specific item), trend storage period is 365 days that's optimal for environments with multiple websites.
Data is captured every minute. These timings can be adjusted in template or per host if needed.
Provided Triggers
Title | Severity | Description |
---|---|---|
Too many connections on pool | High | It means this pool is under high load. Please, make sure that your website is reachable and works as expected. For high load websites with huge amount of traffic please manually adjust this trigger to higher values (default is 500 concurrent connections). For websites with low or standard amount of visitors you may be under DDoS attack. Anyway, please, check the status of your server (CPU, memory utilization) to make sure that your server can handle this traffic and does not have performance issues. |
PHP-FPM uses too much memory | Average | Please, make sure that your server has sufficient resources to handle this pool, and check that the traffic of your website is not abnormal (check that your website is not under DDoS attack). |
PHP-FPM uses queue | Warning | The current number of connections that have been initiated on pool, but not yet accepted are greater than zero. It typically means that all the available server processes are currently busy, and there are no processes available to serve the next request. Raising pm.max_children (provided the server can handle it) should help keep this number low. This trigger follows from the fact that PHP-FPM listens via a socket (TCP or file based), and thus inherits some of the characteristics of sockets. Low values of the listen queue generally result in performance issues of this pool. High values may lead to severe errors when requests can't be processed and will be rejected generating errors such as HTTP 500. You need to set the backlog option in your pool's configuration if you want to use this trigger. Otherwise the trigger will never be fired. Don't trust the default value of the backlog option - it may differ from what you expect and set your max queue length to zero. |
PHP-FPM detected slow request | Warning | PHP-FPM detected slow request on pool. A slow request means that it took more time to execute than expected (defined in the configuration of your pool). It means that your pool has performance issues: either it is under high load, your pool has non-optimal configuration, your server has insufficient resources, or your PHP scripts have slow code (have bugs or bad programming style). You need to set request_slowlog_timeout and slowlog options in your pool's configuration if you want to use this trigger. Otherwise the trigger will never be fired. |
PHP-FPM manager changed | Information | The process manager of PHP-FPM for this pool has changed. |
Provided Graphs
Connections
Displays the following data:
- Accepted connections per second
- CPU average utilization in %
- Memory utilization in %
- Queue utilization in %
CPU
Displays the following data:
- CPU average utilization in %
- Accepted connections per second
Memory
Displays the following data:
- Memory used in bytes
- CPU average utilization in %
- Memory utilization in %
- Queue utilization in %
Process
Displays the following data:
- Active processes
- Idle processes
- Accepted connections per second
Queue
Displays the following data:
- Listen Queue
Max Children Reached
Displays the following data:
- Max Children Reached
- Accepted connections per second
Provided Screens
Screens are based on the graphs above:
- Connections
- Processes
- CPU utilization
- Memory utilization
- Queue
- Max children riched