Timo Dekker
Timo Dekker

Reputation: 11

PHP-FPM 7.4 sometimes hangs for a few requests

Hello all fellow devs,

I have a problem in a production site (laravel). Sometimes(like 4-8 request an hour) the most simple requests are causing this kind of errors:

[13-Dec-2020 18:07:07] WARNING: [pool www] child 514732, script '/home/****/****/public/index.php' (request: "GET /index.php") execution timed out (71.782847 sec), terminating

When i check my access log i see that it is the most simple request. It even happens with request where there is no mysql query executed. When i look at memory usage there is 1GB available when it happens. CPU is running at 10% tops.

PHP fpm settings

pm = dynamic
pm.max_children = 40
pm.start_servers = 15
pm.min_spare_servers = 15
pm.max_spare_servers = 25
;pm.process_idle_timeout = 10s;
pm.max_requests = 500

I hope you guys can help me, i have searched all over the internet but nothing works. Thank you so much.

Timo

Upvotes: 0

Views: 1748

Answers (2)

Tung Nguyen
Tung Nguyen

Reputation: 855

The problem come from Redis connection with TLS 1.3 (https://bugs.php.net/bug.php?id=79501) Redis connection with TLS 1.3 is not stable. If you connect to Redis with tls protocol, for example your Redis host is tls://your-redis-domain-here, PHP will use TLS 1.3 by default. To resolve this issue you have to specify tlsv1.2 in your connection, for example: tlsv1.2://your-redis-domain-here

Upvotes: 0

Timo Dekker
Timo Dekker

Reputation: 11

So it was an issue of the redis connection.

Solution was to use tls1.2.

https://github.com/phpredis/phpredis/issues/1726

Upvotes: 1

Related Questions