php-fpm卡住了,数据库连接很高

时间:2019-11-27 17:45:55

标签: php mysql dbconnection

我的基础设施中有一个情况,我不知道该怎么做才能启动它。我什么都不知道 CloudFlare-> LB池-> 2个HAProxy(作为LB)-> 3个后端(作为proxypass + apache + php-fpm的代理)-> MySQL集群主/读(RDS Aurora)

发生这种情况时,基础结构中的所有服务器的资源都占30-40%...但是我的数据库连接数非常高。 php-fpm也会发疯。

是的,我的访问量比平时更多...但是数据库连接的显示方式是10/15%...不是1000%。似乎是下一个场景:

出于某种原因而陷入困境...并且对DB的其余请求正在某种队列中...然后等待被阻塞的那个队列。

我的数据库连接平均速度为60 /秒。 Show processlist向我显示了一些运行2/5分钟的查询,但是如果我将其杀死,则php-fpm无法恢复自身。我需要停止所有3次安装,持续10到20秒。 (作为解决方法)

任何人都有一个更好的主意,在哪里挖掘或检查什么?!

[27-Nov-2019 17:20:09] NOTICE: child 30656 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 30656
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 30656: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 30656
[27-Nov-2019 17:20:09] NOTICE: child 30657 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 30657
[27-Nov-2019 17:20:09] NOTICE: finished trace of 30657
[27-Nov-2019 17:20:09] NOTICE: child 30860 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 30860
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 30860: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 30860
[27-Nov-2019 17:20:09] NOTICE: child 30865 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 30865
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 30865: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 30865
[27-Nov-2019 17:20:09] NOTICE: child 30911 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 30911
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 30911: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 30911
[27-Nov-2019 17:20:09] NOTICE: child 31139 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 31139
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 31139: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 31139
[27-Nov-2019 17:20:09] NOTICE: child 31181 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 31181
[27-Nov-2019 17:20:09] NOTICE: finished trace of 31181
[27-Nov-2019 17:20:09] NOTICE: child 31521 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 31521
[27-Nov-2019 17:20:09] ERROR: failed to ptrace(PEEKDATA) pid 31521: Input/output error (5)
[27-Nov-2019 17:20:09] NOTICE: finished trace of 31521
[27-Nov-2019 17:20:09] NOTICE: child 31602 stopped for tracing
[27-Nov-2019 17:20:09] NOTICE: about to trace 31602
[27-Nov-2019 17:20:09] NOTICE: finished trace of 31602

[27-Nov-2019 17:20:09] WARNING: [pool www] child 31602, script '/var/www/file.php' (request: "GET /server/file.php") executing too slow (1.317008 sec), logging
[27-Nov-2019 17:20:09] WARNING: [pool www] child 31521, script '/var/www/file.php' (request: "POST /api/file.php") executing too slow (1.192940 sec), logging
[27-Nov-2019 17:20:09] WARNING: [pool www] child 31181, script '/var/www/file.php' (request: "GET /server/sile.php") executing too slow (1.022093 sec), logging
[27-Nov-2019 17:20:09] WARNING: [pool www] child 31139, script '/var/www/file.php' (request: "POST /api/file.php") executing too slow (1.067162 sec), logging
[27-Nov-2019 17:20:09] WARNING: [pool www] child 30911, script '/var/www/file.php' (request: "POST /api/file.php") executing too slow (1.304240 sec), logging

database connections backends phpfpm

0 个答案:

没有答案