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....