pcntl_fork()中超过300秒的最大执行时间 [英] Maximum execution time of 300 seconds exceeded in pcntl_fork()

查看:322
本文介绍了pcntl_fork()中超过300秒的最大执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代理正在运行,并且在正常模式几个星期后,突然我们得到:



最大执行时间超过300秒

$ this- <$>



< > pids [$ next_child] = pcntl_fork();



也有:

  [root @ a〜]#ulimit -u 
385913

[root @ a〜]#ps ax | wc -l
400

[root @ a〜]#cat / proc / sys / kernel / pid_max
4194303

strace显示

poll([{fd = 4,events = POLLIN | POLLPRI | POLLHUP}],1,1000)= 0(超时)

我们在php5.4 centos,它可以是一个PHP错误?

解决方案

这个错误有点神秘。

注意,而不是集中在函数<$ c $ 上,因此我们必须做一些调试才能找到问题的底部。 c> pcntl_fork
或PHP的错误。我将专注于这是一个系统资源问题。因为,它抛出的行包含fork的错误。




  • 错误可能是错误或不重要。要测试这个添加 ini_set('MAX_EXECUTION_TIME',-1); 到脚本的最顶部。如果你的脚本按预期运行没有任何问题,那么是真的。如果不是,那么我们应该检查行为。如果你的代理开始在为客户提供服务时遇到问题,他们会正常抛出错误,这可能意味着错误意味着一些沿着资源不足的东西。如果不是这样,您应该检查代理的行为,以便您可以更多地了解问题的原因。


  • 错误可能与




如果遇到问题,仍然存在,您需要提供有关您的环境和配置的更多信息,以便我们可以帮助您。



问题:使用Magento?


I have some agents running, and after several weeks of normal mode, suddenly we get:

Maximum execution time of 300 seconds exceeded

on a line that is

$this->pids[$next_child] = pcntl_fork();

also we have:

[root@a ~]# ulimit -u
385913

[root@a ~]# ps ax | wc -l
400

[root@a ~]# cat /proc/sys/kernel/pid_max
4194303

strace shows

poll([{fd=4, events=POLLIN|POLLPRI|POLLHUP}], 1, 1000) = 0 (Timeout)

we are on php5.4 centos, could it be a PHP bug? or what could be wrong?

解决方案

This error is a bit cryptic. So, we must do some debugging to get to the bottom of the issue.

Note: Rather than concentrating on the function pcntl_fork or PHP bugs. I'll concentrate on this being a system resource issue. Because, the line it throwing the error contains fork. We'll see where it goes from there

  • The error might be a bug or unimportant. To test this add ini_set('MAX_EXECUTION_TIME', -1); to the very top of your script. If your script runs as intended without any problems, then it is true. If not, then we should examine the behavior. If your agents start having problems serving clients around the time they would normal throw the error, that might mean the error meant something along the lines of resources not being enough. If that's not the case you should examine the behavior of the agents so you can learn more about the cause of the issue.

  • The error might be related to the size of Active URL cache being too high if you are using it from what I've heard.

If the problem still persists, you need to provide more information about your environment and configurations so that we can help you.

Question: Are you by any chance using Magento?

这篇关于pcntl_fork()中超过300秒的最大执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆