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.

/usr/bin/php High CPU Usage

Discussion in 'General Discussion' started by James.Simpson, Jul 5, 2016.

Tags:
  1. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Hi All,

    These past couple of days i've been having issues with my WHM server with a high CPU usage. I get an alert from CFS stating high CPU usage, and the process list is showing usr/bin/php using the most usage, but I am unable to see what process within PHP that is causing this load.

    It has only happened over these last couple of days, and no server settings have been changed for months, so i'm a little puzzled.

    The daily process log for today shows the following: - as you can see the top 3 entries at the most CPU usage is php, followed by sa-compile - which is supposed to be spam assasin, but we dont have mail enabled on the server, but we do have ClamAV on.
    - Removed -

    Last week, I did get another one of these high load emails, but this was becuase it looked like the server was getting a Ddos attack, with 104 connections from the same IP address in France, linked to a BOT server.

    The apachestatus.html file that gets emailed, is pretty useless this time, as it does not show much on there, so i'm not sure where i can look to see what is causing the issue. The server CPU usage is still higher than normal at the moment too.
     
    #1 James.Simpson, Jul 5, 2016
    Last edited by a moderator: Jul 7, 2016
  2. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Some more information

    PHP Version
    /usr/local/cpanel/bin/rebuild_phpconf --current
    The server is running OPCache and is set up and running. Only serving one main website.

    It is strange as it only seems to happen during the day (that i know of).
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please attach images to your posts using the "Upload a File" button. It's just to the right of the Post Reply button.

    What does the alert email say exactly?
     
  4. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Email states

    Subject: High 5 minute load average alert - 6.14

    Body:
    Apache Status Attachment: pastebin.com/Lew5v3tM
    Netstat Attachemnt: pastebin.com/0Y98AD1C
    VMStat Attachment: pastebin.com/A0XXazk1
    Process Attachment: pastebin.com/hxtZF84F

    Thanks in advanced
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  6. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Would this suggest that FCGI is crashing?

    Code:
    mod_fcgid status:
    
    Total FastCGI processes: 14
    Process: php5  (/usr/local/cpanel/cgi-sys/php5)
    Pid    Active    Idle    Accesses    State
    30725    78    17    1    Working
    30826    38    38    0    Working
    30810    43    38    1    Working
    30823    39    38    1    Working
    30820    39    39    1    Working
    30818    40    40    1    Exiting(communication error)
    30816    42    42    1    Exiting(communication error)
    30813    42    42    3    Exiting(communication error)
    30806    45    43    5    Exiting(communication error)
    30803    46    45    2    Exiting(communication error)
    30800    46    46    2    Exiting(communication error)
    30797    48    48    1    Exiting(communication error)
    30794    48    48    1    Exiting(communication error)
    30791    49    49    3    Exiting(communication error)
    
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,834
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    It doesn't indicate that FCGI is crashing, however you can review /usr/local/apache/logs/error_log for FCGI-related error messages if you think it's the culprit. You may also need to consult with a qualified system administrator if you are unable to determine the source of the CPU usage:

    System Administration Services

    Thank you.
     
  8. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Yea the log file seems to be full of the following (even though i have tweaked the settings)

    It seems these are added to the log file when a user clicks another link without the page fully loading, and even pressing the stop button the the browser.
     
  9. James.Simpson

    James.Simpson Member

    Joined:
    Feb 18, 2013
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Root Administrator
    Well it happened again this morning, and I think I've finally figured it out... Here is the error right before the crash

    That would assume that the process is hitting the limit, but the limit is set as follows:

     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,834
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You may find this thread helpful for that particular error message:

    mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php5

    However, as mentioned on that thread, you may want to consider switching to a different PHP handler if you are not comfortable with customizing the values. Per our documentation, we only recommend the mod_fcgid Apache module for advanced system administrators who understand how to modify the performance of the mod_fcgid Apache module.

    Thank you.
     
Loading...

Share This Page