how to automatically terminate a hanging php process

This is a discussion on how to automatically terminate a hanging php process within the PHP General forums, part of the PHP Programming Forums category; I am running a php site on a shared host environment. They have 20 max concurrent process limitation. Recently, I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-12-2005
feng.hong@gmail.com
 
Posts: n/a
Default how to automatically terminate a hanging php process

I am running a php site on a shared host environment. They have 20 max
concurrent process limitation. Recently, I am having issue of some
phpcgi process just hanging there and my site run out of process quota.

the time limitation in php.ini is 180 seconds. However, those php just
doesn't quit after 180 seconds, I check ps result. seems all those
process just consume 0 seconds of CPU(which explains why it didn't get
termiated?) It just didn't finish properly. what kind of things will
cause process stay there? if I didn't close mysql connection, not free
up result, will that cause it?

Is there anyway I can place a automatic timeout mechanism in this
situation. some kind of time signal after 30 seconds and just exit the
process.

i tried pcntl_alarm but seems it need declare(ticks=1) to work....
anyone have any suggestions?

thanks so much!, this thing is driving me crazy....

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:19 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0