Rumah  >  Artikel  >  pembangunan bahagian belakang  >  php-fpm log中出现大量的failed to acquire scoreboard

php-fpm log中出现大量的failed to acquire scoreboard

WBOY
WBOYasal
2016-12-01 00:25:344912semak imbas

php-fpm log中出现大量的failed to acquire scoreboard, 导致子进程到了最大请求数,kill之后, 就拉不起新的子进程, 最后,就剩master进程了。
日志如下:

<code>ERROR: [pool ] no free scoreboard slot
WARNING: [pool www] child 31311 said into stderr: "WARNING: failed to acquire proc scoreboard"
</code>

经过排查,在开始出现这个问题的时候, 一个请求出现 500, 出现 500 的情况是由于, 查询数据库的结果集比较大,还有出现这个情况的时候,系统log也出现了

<code>TCP: time wait bucket table overflow
</code>

有知道原因的吗?

回复内容:

php-fpm log中出现大量的failed to acquire scoreboard, 导致子进程到了最大请求数,kill之后, 就拉不起新的子进程, 最后,就剩master进程了。
日志如下:

<code>ERROR: [pool ] no free scoreboard slot
WARNING: [pool www] child 31311 said into stderr: "WARNING: failed to acquire proc scoreboard"
</code>

经过排查,在开始出现这个问题的时候, 一个请求出现 500, 出现 500 的情况是由于, 查询数据库的结果集比较大,还有出现这个情况的时候,系统log也出现了

<code>TCP: time wait bucket table overflow
</code>

有知道原因的吗?

WARNING: failed to acquire proc scoreboard 是不是由于大数据结果集查询的数据都放内存进行操作,然后服务器系统内存不足,导致这个问题。
time wait bucket table overflow由于处理请求有问题,造成大量的TCP连接,连接的数目超过了系统配置的tcp_max_tw_buckets最大值。
尝试解决方式:

  1. 加大系统内存

  2. 分块处理大数据结果集,或按行读取大数据库结果集(游标方式)

  3. 修改tcp_max_tw_buckets的相关值

以上纯属个人推测,仅供参考,因为本人没有遇到过这个错误

查一下是不是哪个脚本耗掉了大量内存

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn