Skip to content

Commit

Permalink
Add additional php-fpm pool status kpis for Metricbeat module (#5287)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgilad authored and ruflin committed Oct 3, 2017
1 parent ffca490 commit 8d79c8f
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Add system uptime metricset. {issue}[4848[4848]
- Add `filesystem.ignore_types` to system module for ignoring filesystem types. {issue}4685[4685]
- Add experimental `queue` metricset to RabbitMQ module. {pull}4788[4788]
- Add additional php-fpm pool status kpis for Metricbeat module {pull}5287[5287]

*Packetbeat*

Expand Down
66 changes: 66 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7042,6 +7042,14 @@ type: keyword
The name of the pool.
[float]
=== `php_fpm.pool.process_manager`
type: keyword
Static, dynamic or ondemand.
[float]
== connections fields
Expand All @@ -7065,6 +7073,22 @@ type: long
The current number of connections that have been initiated, but not yet accepted. If this value is non-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 property follows from the fact that PHP-FPM listens via a socket (TCP or file based), and thus inherits some of the characteristics of sockets.
[float]
=== `php_fpm.pool.connections.max_listen_queue`
type: long
The maximum number of requests in the queue of pending connections since FPM has started.
[float]
=== `php_fpm.pool.connections.listen_queue_len`
type: long
The size of the socket queue of pending connections.
[float]
== processes fields
Expand All @@ -7088,6 +7112,30 @@ type: long
The number of servers current processing a page - the minimum is `1` (so even on a fully idle server, the result will be not read `0`).
[float]
=== `php_fpm.pool.processes.total`
type: long
The number of idle + active processes.
[float]
=== `php_fpm.pool.processes.max_active`
type: long
The maximum number of active processes since FPM has started.
[float]
=== `php_fpm.pool.processes.max_children_reached`
type: long
Number of times, the process limit has been reached, when pm tries to start more children (works only for pm 'dynamic' and 'ondemand').
[float]
=== `php_fpm.pool.slow_requests`
Expand All @@ -7096,6 +7144,24 @@ type: long
The number of times a request execution time has exceeded `request_slowlog_timeout`.
[float]
=== `php_fpm.pool.start_since`
type: long
Number of seconds since FPM has started.
[float]
=== `php_fpm.pool.start_time`
type: date
format: epoch_second
The date and time FPM has started.
[[exported-fields-postgresql]]
== PostgreSQL fields
Expand Down
22 changes: 15 additions & 7 deletions metricbeat/module/php_fpm/pool/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@timestamp": "2016-05-23T08:05:34.853Z",
"@timestamp": "2017-09-30T12:03:14.242Z",
"beat": {
"hostname": "host.example.com",
"name": "host.example.com"
Expand All @@ -13,16 +13,24 @@
"php_fpm": {
"pool": {
"connections": {
"accepted": 13,
"accepted": 28729,
"listen_queue_len": 128,
"max_listen_queue": 1,
"queued": 0
},
"pool": "www",
"name": "www",
"process_manager": "dynamic",
"processes": {
"active": 1,
"idle": 2
"active": 2,
"idle": 3,
"max_active": 8,
"max_children_reached": 2,
"total": 5
},
"slow_requests": 0
"slow_requests": 0,
"start_since": 171707,
"start_time": 1506604034
}
},
"type": "metricsets"
}
}
36 changes: 36 additions & 0 deletions metricbeat/module/php_fpm/pool/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
type: keyword
description: >
The name of the pool.
- name: process_manager
type: keyword
description: >
Static, dynamic or ondemand.
- name: connections
type: group
description: >
Expand All @@ -29,6 +33,15 @@
keep this number low. This property follows from the fact that
PHP-FPM listens via a socket (TCP or file based), and thus inherits
some of the characteristics of sockets.
- name: max_listen_queue
type: long
description: >
The maximum number of requests in the queue of pending
connections since FPM has started.
- name: listen_queue_len
type: long
description: >
The size of the socket queue of pending connections.
- name: processes
type: group
description: >
Expand All @@ -46,8 +59,31 @@
description: >
The number of servers current processing a page - the minimum is `1`
(so even on a fully idle server, the result will be not read `0`).
- name: total
type: long
description: >
The number of idle + active processes.
- name: max_active
type: long
description: >
The maximum number of active processes since FPM has started.
- name: max_children_reached
type: long
description: >
Number of times, the process limit has been reached,
when pm tries to start more children (works only for
pm 'dynamic' and 'ondemand').
- name: slow_requests
type: long
description: >
The number of times a request execution time has exceeded
`request_slowlog_timeout`.
- name: start_since
type: long
description: >
Number of seconds since FPM has started.
- name: start_time
type: date
format: epoch_second
description: >
The date and time FPM has started.
20 changes: 14 additions & 6 deletions metricbeat/module/php_fpm/pool/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ import (

var (
schema = s.Schema{
"name": c.Str("pool"),
"name": c.Str("pool"),
"process_manager": c.Str("process manager"),
"slow_requests": c.Int("slow requests"),
"start_time": c.Int("start time"),
"start_since": c.Int("start since"),
"connections": s.Object{
"accepted": c.Int("accepted conn"),
"queued": c.Int("listen queue"),
"accepted": c.Int("accepted conn"),
"listen_queue_len": c.Int("listen queue len"),
"max_listen_queue": c.Int("max listen queue"),
"queued": c.Int("listen queue"),
},
"processes": s.Object{
"idle": c.Int("idle processes"),
"active": c.Int("active processes"),
"active": c.Int("active processes"),
"idle": c.Int("idle processes"),
"max_active": c.Int("max active processes"),
"max_children_reached": c.Int("max children reached"),
"total": c.Int("total processes"),
},
"slow_requests": c.Int("slow requests"),
}
)

0 comments on commit 8d79c8f

Please sign in to comment.