服务器不断使用我的 php 脚本创建进程
我正在共享托管服务器(hostgator)上运行 PHP 脚本。该 PHP 脚本是使用 codeigniter
框架编写的。 Hostgator 共享托管服务器仅允许 25 个进程运行。我不知道为什么我的脚本不断在服务器上创建进程。 cpanel 进程服务器日志如下所示:
2221 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
30577 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
30343 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
29994 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
32278 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
28528 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
27757 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.2%
CUP 使用率几乎为 0%,内存使用率仅在 0.1-0.3% 之间
这是因为代码错误吗?
或者,知道为什么这个过程不断被创建吗?我知道如果没有看到我的代码就很难说,但我想要一些通用的方法来使我更容易跟踪问题。
是的,我刚刚询问了服务器支持,他们说他们正在使用 fastcgi。但事实是,他们最多只允许 25 个进程。每当达到25个进程时,我在浏览时就会得到内部服务器。而且很容易就得到25个进程。那么我该怎么办呢?我可以从我的脚本站点做一些事情吗?我运行了其他不属于我的脚本,例如 phpbb 论坛,但这些进程没有出现在进程中。请好心建议我。谢谢。
I am running a PHP script on a shared hosting server (hostgator). That PHP script is written with the codeigniter
framework. Hostgator Shared hosting server only allows 25 processes to run. I have no idea why my script keeps creating the process on the server. The cpanel process server log looks like this:
2221 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
30577 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
30343 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
29994 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
32278 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
28528 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.1% Kill Process
27757 /usr/bin/php /home/megain/public_html/megainfine/index.php 0% 0.2%
The CUP Usage is almost 0% and Memory usage is only between 0.1-0.3%
Is this because of bad code?
Or, any idea why this process keeps getting created? I know that it will be hard to say without seeing my code, but I would like some general approach that will make the problem easier for me to trace.
Yes, I just asked the server support and they said they are using fastcgi. But the fact is that, they only allow 25 process maximum. Whenever it reach 25 process, I got internal server when browsing. And it very easily to got 25 process. So how can i do ? Can i do something from my scripting site ? I have run other scripts which is not mine like phpbb forum, but those processes are not appear in the processes. Please kindly suggest me. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP 脚本可能是使用 fastcgi 运行的。我相信使用此功能时,Web 服务器将使 PHP 进程在请求之间保持运行以供重用,这比每次启动一个新进程更有效。
It might be that PHP scripts are run using fastcgi. I believe when using this the web server will keep PHP processes running between requests for re-use, which is more efficient than starting a new one each time.
这是相当不寻常的。您知道创建这些进程的确切时刻吗?另外,您应该检查代码中的 ignore
_user_
abort() 函数和 忽略_user_
中止设置。This is rather unusual. Do you know the exact moment when these processes are created? Also, you should check your code for ignore
_user_
abort() function and your php.ini for ignore_user_
abort setting.