3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

Update queue triggers (#20)

* [add,del] new queue triggers

* [add] new template description

* [del] remove trigger PHP-FPM queue is not available

Backlog only works for TCP, not sockets. So, this trigger is not required.

* [add] info about new triggers

* [add] info about backlog in the triggers description
This commit is contained in:
Ramil Valitov 2020-01-21 15:46:08 +03:00 committed by GitHub
parent 2e2983dbde
commit 0618d6d2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 6 deletions

View File

@ -49,8 +49,10 @@ Data is captured every minute. These timings can be adjusted in template or per
|-----|--------|-----------|
|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](https://www.php.net/manual/en/install.fpm.configuration.php#listen-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](https://www.php.net/manual/en/install.fpm.configuration.php#request-slowlog-timeout) and [slowlog](https://www.php.net/manual/en/install.fpm.configuration.php#slowlog) options in your pool's configuration if you want to use this trigger. Otherwise the trigger will never be fired.|
|The queue utilization for pool reached 25%|Warning|The queue for this pool reached 25% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. The queue length is defined by the [backlog option](https://www.php.net/manual/en/install.fpm.configuration.php#listen-backlog) in your pool's configuration.|
|The queue utilization for pool reached 50%|Average|The queue for this pool reached 50% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. This pool already has performance issues. Please, check that your server has enough resources and adjust the configuration of this pool to handle more concurrent requests, otherwise you can suffer serious degraded performance. The queue length is defined by the [backlog option](https://www.php.net/manual/en/install.fpm.configuration.php#listen-backlog) in your pool's configuration.|
|The queue utilization for pool reached 85%|High|The queue for this pool reached 85% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. This pool already has serious performance issues. Please, check that your server has enough resources and adjust the configuration of this pool to handle more concurrent requests, otherwise you can face severe errors when new requests can't be processed and will be rejected generating errors such as HTTP 500. The queue length is defined by the [backlog option](https://www.php.net/manual/en/install.fpm.configuration.php#listen-backlog) in your pool's configuration.|
|PHP-FPM manager changed|Information|The [process manager](https://www.php.net/manual/en/install.fpm.configuration.php#pm) of PHP-FPM for this pool has changed.|
## Provided Graphs

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>4.0</version>
<date>2019-12-28T13:36:29Z</date>
<date>2020-01-18T19:22:43Z</date>
<groups>
<group>
<name>Templates/Applications</name>
@ -11,7 +11,13 @@
<template>
<template>Template App PHP-FPM</template>
<name>Template App PHP-FPM</name>
<description>PHP-FPM Zabbix Template with Auto Discovery and Multiple Pools</description>
<description>PHP-FPM Zabbix Template with Auto Discovery and Multiple Pools.&#13;
- Provides auto discovery of PHP-FPM pools (LLD)&#13;
- Detects pools that via socket and via TCP&#13;
- Supported types of PHP process manager: dynamic, static, ondemand.&#13;
- 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.&#13;
&#13;
Homepage: https://github.com/rvalitov/zabbix-php-fpm</description>
<groups>
<group>
<name>Templates/Applications</name>
@ -1411,16 +1417,48 @@
<tags/>
</trigger_prototype>
<trigger_prototype>
<expression>{Template App PHP-FPM:php-fpm.listen_queue[{#POOLSOCKET}].last(#3)}&gt;0</expression>
<expression>{Template App PHP-FPM:php-fpm.queue[{#POOLSOCKET}].last()}&gt;=25</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>PHP-FPM uses queue on {HOST.NAME} pool {#POOLNAME}</name>
<name>PHP-FPM queue utilization for pool {#POOLNAME} reached 25% on {HOST.NAME}</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>2</priority>
<description>The current number of connections that have been initiated on pool {#POOLNAME}, 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.</description>
<description>The queue for this pool reached 25% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. The queue length is defined by the backlog option in your pool's configuration.</description>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
<trigger_prototype>
<expression>{Template App PHP-FPM:php-fpm.queue[{#POOLSOCKET}].last()}&gt;=50</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>PHP-FPM queue utilization for pool {#POOLNAME} reached 50% on {HOST.NAME}</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>3</priority>
<description>The queue for this pool reached 50% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. This pool already has performance issues. Please, check that your server has enough resources and adjust the configuration of this pool to handle more concurrent requests, otherwise you can suffer serious degraded performance. The queue length is defined by the backlog option in your pool's configuration.</description>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>
<tags/>
</trigger_prototype>
<trigger_prototype>
<expression>{Template App PHP-FPM:php-fpm.queue[{#POOLSOCKET}].last()}&gt;=85</expression>
<recovery_mode>0</recovery_mode>
<recovery_expression/>
<name>PHP-FPM queue utilization for pool {#POOLNAME} reached 85% on {HOST.NAME}</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>
<status>0</status>
<priority>4</priority>
<description>The queue for this pool reached 85% of its maximum capacity. Items in queue represent the current number of connections that have been initiated on this pool, but not yet accepted. 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. This pool already has serious performance issues. Please, check that your server has enough resources and adjust the configuration of this pool to handle more concurrent requests, otherwise you can face severe errors when new requests can't be processed and will be rejected generating errors such as HTTP 500. The queue length is defined by the backlog option in your pool's configuration.</description>
<type>0</type>
<manual_close>0</manual_close>
<dependencies/>