The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP scripts running more than hour

Discussion in 'General Discussion' started by postcd, Mar 4, 2015.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    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
     
    #1 postcd, Mar 4, 2015
    Last edited: Mar 4, 2015
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: PHP scripts running more than hour, why?

    Have you asked about this over on the WordPress forums?
     
  3. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    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.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    /https://wordpress.org/support/topic/wp-cron-server-overload

    Wordpress support is where your answers are though.
     
  5. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    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.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Good luck with that.
     
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    620
    Likes Received:
    6
    Trophy Points:
    18
    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)?
     
    #7 postcd, Aug 8, 2015
    Last edited: Aug 8, 2015
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  9. chiareu

    chiareu Registered

    Joined:
    Feb 8, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
    #9 chiareu, Feb 8, 2016
    Last edited: Feb 8, 2016
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

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

    CloudLinux

    Thank you.
     
Loading...

Share This Page