我的网络服务器每隔 1-2 天就会达到无法访问的状态,直到我完全重新启动服务器。
服务器是 Debian Bullseye,配备最新的 Apache + PHP 7.4。我使用 FPM,因为我想要 HTTP2。16 GB RAM vServer。
/var/log/apache2/error.log
:
[Sat May 07 18:01:57.970776 2022] [proxy_fcgi:error] [pid 139033:tid 139719866291968] (70007)The timeout specified has expired: [client xxxIPxxx:47330] AH01075: Error dispatching request to : (polling)
[Sat May 07 18:02:42.854791 2022] [proxy_fcgi:error] [pid 269312:tid 139720560633600] (70007)The timeout specified has expired: [client xxxIPxxx:32702] AH01075: Error dispatching request to : (polling)
当然,我发现了有关此问题的不同帖子/解决方案,并且我已经增加了 PHP 和 FPM 的超时时间,但这个错误仍然存在。
/var/log/php7.4-fpm.log
:
[07-May-2022 07:05:01] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[07-May-2022 07:46:42] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[07-May-2022 09:14:09] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[07-May-2022 09:27:13] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[07-May-2022 12:27:16] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
[07-May-2022 15:05:19] NOTICE: [pool www] child 265395 exited with code 0 after 13010.271694 seconds from start
[07-May-2022 15:05:19] NOTICE: [pool www] child 267508 started
[07-May-2022 15:13:40] NOTICE: [pool www] child 265396 exited with code 0 after 13510.447458 seconds from start
[07-May-2022 15:13:40] NOTICE: [pool www] child 267637 started
[07-May-2022 16:13:26] NOTICE: [pool www] child 265945 exited with code 0 after 13622.463297 seconds from start
[07-May-2022 16:13:26] NOTICE: [pool www] child 268279 started
[07-May-2022 17:42:16] NOTICE: [pool www] child 267508 exited with code 0 after 9417.705135 seconds from start
[07-May-2022 17:42:16] NOTICE: [pool www] child 269286 started
[07-May-2022 17:45:07] NOTICE: [pool www] child 267637 exited with code 0 after 9087.193478 seconds from start
[07-May-2022 17:45:07] NOTICE: [pool www] child 269309 started
[07-May-2022 19:20:39] NOTICE: Terminating ...
[07-May-2022 19:20:39] NOTICE: exiting, bye-bye!
[07-May-2022 19:20:55] NOTICE: fpm is running, pid 694
[07-May-2022 19:20:56] NOTICE: ready to handle connections
[07-May-2022 19:20:56] NOTICE: systemd monitor interval set to 10000ms
我怎么解决这个问题?
非常感谢。
答案1
我遇到了同样的问题,可以通过创建来解决它/etc/httpd/conf.modules.d/00-proxy_timeout.conf
。
作为内容尝试添加
Timeout xx
ProxyTimeout xx
将 xx 替换为适合您用例的秒数。只需尝试一下这些数字,看看它是否可以解决您的问题。
看一眼本指南。