php-src icon indicating copy to clipboard operation
php-src copied to clipboard

PHP-FPM : Option to suppress "/ping" from logs -- patch file given

Open Julien75013 opened this issue 4 years ago • 3 comments

Description

SysAdmin and DevOps don't need to have logs when healthcheck are set up for checking the availability.

To understand why this is relevant, see how today's softwares performs in many high-load environments.

Apache permit full conditionnal logs :

https://httpd.apache.org/docs/trunk/en/logs.html#conditional

Haproxy permit some conditionnal logs :

Haproxy - Options dontlog-normal / dontlognull : https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-option%20dontlog-normal https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4.2-option%20dontlognull Haproxy - Disabling logging of successful connections : https://cbonte.github.io/haproxy-dconv/2.4/configuration.html#chapter-8.3.3

The actual saving of data space could be several megas, for each host. For thousands of servers, it can be a significant saving.

$> tail -n 5 /var/log/php8/pings/access.log
- -  27/Nov/2021:02:12:57 +0100 "GET /ping" 200 - 0.238 2048 0.00%
- -  27/Nov/2021:02:12:58 +0100 "GET /ping" 200 - 0.309 2048 0.00%
- -  27/Nov/2021:02:13:01 +0100 "GET /ping" 200 - 0.258 2048 0.00%
- -  27/Nov/2021:02:13:04 +0100 "GET /ping" 200 - 0.190 2048 0.00%
- -  27/Nov/2021:02:13:04 +0100 "GET /ping" 200 - 0.166 2048 0.00%

$> gunzip -c /var/log/php8/pings/access.log.*.gz | wc -l
2838920

$> du -h /var/log/php8/pings/
32M     /var/log/php8/pings/

So, we need an option to disable logs when the "/ping" path is reached.

; This directive is used to apply (or prevent) the "GET /ping" to be logged.
; Directive "ping.path" have to be set, before this setting to be effective.
; Default Value: yes
;ping.dontlog = yes

Main thread from bugs.php.net : https://bugs.php.net/bug.php?id=80428 Patch file was issued in 2020 but has never been seen : php-fpm-ping_dontlog.txt

Julien75013 avatar Mar 06 '22 15:03 Julien75013

Patch file was issued in 2020 but has never been seen

Consider to submit a pull request for better visibility.

cmb69 avatar Mar 07 '22 11:03 cmb69

@bukka could you apply that patch for 8.1 branch and release it?

xepozz avatar Jul 12 '22 19:07 xepozz

@xepozz 8.1 is just for bug fixes and this is a feature so it cannot be applied there.

bukka avatar Jul 13 '22 08:07 bukka