我想问一个关于我的服务器问题的问题。我不知道为什么它发送了 521 代码,而资源仍然正常。我认为配置错误。我使用的是 Webuzo 面板的默认设置。什么都没有改变。我认为问题出在 php-fpm
request_slowlog_timeout = 5s
slowlog = var/log/php-fpm-dsimlife.logs
listen.allowed_clients = 127.0.0.1
pm = ondemand
pm.max_children = 5
pm.start_servers = 0
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 20
pm.process_idle_timeout = 10
request_terminate_timeout = 120s
php_flag[allow_url_fopen] = off
php_flag[log_errors] = off
php_flag[short_open_tag] = off
php_value[disable_functions] =
php_value[error_log] =
php_value[error_reporting] =
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes
security.limit_extensions = FALSE
env[HOSTNAME] = \$HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
仅供参考,我使用的是 Dual Xeon E5-2670 @2.60 Ghz 32GB 服务器,这是我的 php-fpm 日志
[20-Mar-2023 01:13:41] WARNING: [pool dsimlife-user] child 502345, script '/home/dsimlife/public_html/id1com/api.php' (request: "POST /api.php?f=syncAccount") executing too slow (5.824632 sec), logging
[20-Mar-2023 01:13:42] WARNING: [pool dsimlife-user] child 502462, script '/home/dsimlife/public_html/id1com/api.php' (request: "POST /api.php?f=getCompany") executing too slow (5.300816 sec), logging
[20-Mar-2023 01:13:42] WARNING: [pool dsimlife-user] child 502450, script '/home/dsimlife/public_html/id1com/api.php' (request: "POST /api.php?f=citizenActivity") executing too slow (6.625257 sec), logging
[20-Mar-2023 01:13:42] WARNING: [pool dsimlife-user] child 502348, script '/home/dsimlife/public_html/id1com/api.php' (request: "POST /api.php?f=getCompany") executing too slow (5.166035 sec), logging
[20-Mar-2023 01:13:59] WARNING: [pool dsimlife-user] child 502566, script '/home/dsimlife/public_html/id1com/api-admin.php' (request: "GET /api-admin.php?f=dailyTask&password=@bobby123@") executing too slow (6.047916 sec), logging
[20-Mar-2023 01:14:07] WARNING: [pool dsimlife-user] child 502592, script '/home/dsimlife/public_html/id1com/api-bot.php' (request: "GET /api-bot.php?f=runWork&password=@bobby123@") executing too slow (5.230719 sec), logging
这是我的错误日志
2023/03/20 00:34:56 [error] 487375#0: *73 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.70.189.120, server: id1.dsimlife.com, request: "POST /api.php?f=getCompanyLicense HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *235 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 162.158.162.128, server: id1.dsimlife.com, request: "POST /api.php?f=getCompanyWarehouse HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *296 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.70.142.115, server: id1.dsimlife.com, request: "POST /api.php?f=getCompany HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *294 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 162.158.38.172, server: id1.dsimlife.com, request: "POST /api.php?f=getCompanyWorkplace HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *290 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 162.158.170.239, server: id1.dsimlife.com, request: "POST /api.php?f=getCompanyPO HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *292 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 162.158.38.224, server: id1.dsimlife.com, request: "POST /api.php?f=getWorkplace HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
2023/03/20 00:34:56 [error] 487375#0: *288 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.70.147.134, server: id1.dsimlife.com, request: "POST /api.php?f=getCompanyWarehouse HTTP/1.1", upstream: "fastcgi://unix:/usr/local/apps/php74/var/fpm-dsimlife.sock:", host: "id1.dsimlife.com"
以下是基于我的 htop
我非常感谢任何有关答案,我已经弄清楚了近 8 个小时,但没有任何变化。我也在这里使用计算器:https://spot13.com/pmcalculator/[这表明根据我们的服务器和脚本使用情况设置 php-fpm 的数量]但它仍然不起作用。