Le 30/04/2025 à 7:56 PM, Christopher Faulet a écrit :
Le 30/04/2025 à 5:12 PM, Ionel GARDAIS a écrit :
Hi,
For technical showoff, I was using the fcgi-app feature to serve PHP FPM
websites (matomo and a planning portal) but with the 3.0.10 update, haproxy
starts using 100% cpu and requests ended in timeout.
PHP-FPM did not logged anything.
Unfortunately I had to revert quickly to a more academic use of fpm inside an
nginx server and I did not generate dump.
The relevant configuration bits are :
acl is-php path_reg ^/.+\.php(/.*)?
acl is-php path /
use_backend bck-matomo if host-matomo is-php
default_backend bck-nginx
backend bck-matomo
use-fcgi-app fpm-matomo
server fpm-matomo 127.0.0.1:8081 proto fcgi
fcgi-app fpm-matomo
log-stderr global
docroot /opt/matomo
index index.php
path-info ^(/.+\.php)(/.*)?$
Beside Christopher's commit 'BUG/MEDIUM: mux-fcgi: Properly handle read0 on
partial record', I've just noticed that the fcgi-app section name is the same
that the server name declared in the backend.
Are there obvious misconfiguration that could have break things between 3.0.9
and 3.0.10 ?
Thanks!
I can confirm there is an issue. After a bisect, I found the offending commit is
indeed "BUG/MEDIUM: mux-fcgi: Properly handle read0 on partial records". I will
review it because on 3.1 and 3.2, there is no issue.
Ok The following commit was not backported while it should be. My bad. Info in
the commit message are not accurate. Only the 3.0.10 is affected for now. So a
workaround is to upgrade to 3.1.7.
commit cc4981548b12e3162fc020be02917f8462f00866 (haproxy.org/master,
haproxy.org/HEAD)
Author: Christopher Faulet <cfau...@haproxy.com>
Date: Fri Feb 28 16:07:00 2025 +0100
BUG/MEDIUM: mux-fcgi: Try to fully fill demux buffer on receive if not empty
Don't reserve space for the HTX overhead on receive if the demux buffer is
not empty. Otherwise, the demux buffer may be erroneously reported as full
and this may block records processing. Because of this bug, a ping-pong loop
till timeout between data reception and demux process can be observed.
This bug was introduced by the commit 5f927f603 ("BUG/MEDIUM: mux-fcgi:
Properly handle read0 on partial records"). To fix the issue, if the demux
buffer is not empty when we try to receive more data, all free space in the
buffer can now be used. However, if the demux buffer is empty, we still try
to keep it aligned with the HTX.
This patch must be backported to 3.1.
(cherry picked from commit 0e08252294d5a7389ad42b51b4b931fab2e66f31)
Signed-off-by: Christopher Faulet <cfau...@haproxy.com>
--
Christopher Faulet