PHP scripts running more than hour

postcd

Well-Known Member
Oct 22, 2010
721
21
68
Hello,

one user account has quite heavy Wordpress blog and last week i found this account is running php processed that are not killed for a long time.. at Home »Server Status »Apache Status i see 2 processes:

POST /wp-cron.php?doing_wp_cron=1425434809.05796098709106445312
POST /wp-cron.php?doing_wp_cron=1425453710.31721806526184082031

"SS" value is: 26849 and 7948 (2 processes)
"SS Seconds since beginning of most recent request"

"Req" value (Milliseconds required to process most recent request) is around 300 000 for both processes.

so i want to ask what to check to discover why these are still runing even i have max_execution time 30 seconds?

Server Version: Apache/2.2.29 (Unix)
Server Built: Jan 16 2015 11:33:36
 
Last edited:

postcd

Well-Known Member
Oct 22, 2010
721
21
68
Im asking generally regarding .php scripts, id ont think any php script should have righ to run that long like above mentioned. and it should be controlled by server, thats why im asking there.
 

postcd

Well-Known Member
Oct 22, 2010
721
21
68
I just wasted my time reading that topic. I said my question is general. I will not do anything about that php script. I want it killed as any php script and ensure limitted runtime for all php scripts, i dont have Cloudlinux and will not use it. I want to achieve that goal with free tools and default cpanel/WHM/Apache server.
 

postcd

Well-Known Member
Oct 22, 2010
721
21
68
I found no solution yet. Im not sure for which purpose there is max_execution_time php variable while scripts running much longer time than that

Another idea might be to change Apache directive called "Timeout" (WHM/Service configuration/Apache configuration)?
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

Have you considered using a third-party application such as LFD that can kill processes running over a set period of time? cPanel/WHM will not automatically kill any PHP processes based on resource usage.

Thank you.
 

chiareu

Member
Feb 8, 2016
14
0
1
Bucharest
cPanel Access Level
Root Administrator
Hmm understand, so the server listen to the max_execution_time? and stop executing the script but script it's kept alive for some reason?

On my server there are a lot of php processes running for over 700000 seconds :) I don't understand what happening there.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
On my server there are a lot of php processes running for over 700000 seconds :) I don't understand what happening there.
Hello :)

Have you considered a third-party application such as Cloud Linux? Information on Cloud Linux is available at:

CloudLinux

Thank you.