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.

WHM cPanel and CPU

Discussion in 'General Discussion' started by stgeorge, Jul 20, 2012.

  1. stgeorge

    stgeorge Member

    Joined:
    Jul 20, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I am a website Administrator new to WHM and cPanel management.

    The problem I have is CPU.

    I have the same problem on a Server that I am Admin on and a Server where I am a Client.
    Both Servers set CPU limits to 10%.

    I will start with the Server where I am a Client to give you an Example.

    My account was Terminated for using 100% CPU over 5 hours.
    The information was taken from the WHM Daily Process Logs Re CPU usage.
    At the time I was using Admin in a Joomla 1.5, (not Joomla 2.5, more resource hungry), CMS.
    I was also logged into my cPanel on the Hosting Server.

    All I was doing was uploading an tar.gz archive, extracting and modifying configuration files with the cPanel Editor. Uploading a database and sorting out the account while I was in cPanel ready for the domain registrar resolving the TLD to the hosting server.

    Once the Domain had resolved I was in my Joomla Admin, modifying a few Articles.

    The only error reports stored in a file were relating to a component that creates a mobile site for joomla that yses the database for the TerraWurlf browser agents.

    I ignored the 2 errors, thinking I would deal with it the next day.
    The next day I was Suspended by the Host.

    It seems that if being logged into cPanel for 5 hours and being logged into a joomla CMS Admin uses 100% of CPU, then there is something seriously wrong with WHM and cPanel.

    Now to the Server where I have WHM Admin Access.

    We have been suspending users based on High CPU usage with information from the WHM Daily Process Logs.
    Many of these users are hitting 60-80% CPU.

    When they question the Suspension many are stating that they are just using the scripts normally. Often but not all the time they are Wordpress Users.

    We created a Auto Suspend Script and initially set it at 20%, we have since raised this to 50% as it was suspending too many Users.

    We have since found out that whenever a single user logs into cPanel, 50% of CPU is being used just for cPanel by that Single User.

    Both the above Free Hosting is on shared hosting.

    My question is, what on earth is cPanel doing using as much as 50% of CPU?

    What are we missing here?

    Incidentally, logging in with SSH and top does not show extremely high CPU usage although there are spikes in CPU during some processes.
    So is there a problem with the WHM Daily Process Logs?

    Server Information where I am Admin:
     
    #1 stgeorge, Jul 20, 2012
    Last edited: Jul 20, 2012
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    If usage spikes for a moment, like say extracting a large compressed file, it might show here. These figures should not be looked at as, if its showing in red, this user is causing problems. Certainly you might wish to look closer at the account(s), but there may be occasional spikes shown here. I wouldn't use this to base suspending someone over though.
     
  3. stgeorge

    stgeorge Member

    Joined:
    Jul 20, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks for your reply!
    I take it that you are referring to the WHM Daily Process Logs. Are these supposed to be an average or peak usage.
    If average then Users should be suspended.
    If peak then they are of no use.

    We are still experimenting with the auto suspend script, (not written by me).
    However if we cannot get the info we require, then CPU Monitoring or Stats become useless.

    Also how is it that actually using cPanel itself is causing so much CPU usage?

    I know it is loaded with Ajax, but cannot figure out why when a User logs into cPanel the CPU jumps through the roof.

    I know of one Free Host that restricts the processes so that when a User logs into cPanel the sites goes down with a 500 error.
    It is only when you log out of cPanel that the site comes back up again.

    Thanks again
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    From the top of that page on one of my servers:


    Where are you seeing this at exactly?


    If you do not know of CSF, you might like to:
    ConfigServer Security & Firewall

    This can alert you to, and stop and block even, scripts and users depending on usage and many other things. Worth having for sure.
     
  5. stgeorge

    stgeorge Member

    Joined:
    Jul 20, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    logging in with SSH and top does not show extremely high CPU usage when I log into cPanel.
    Any actions in cPanel keep the CPU usage high.
    It is as if cPanel, by itself, is the resource Hog.
    But I am going to test it all later to see what happens in the Server I am Admin on, to see if I can replicate the Client scenario in my first post.

    Thanks for that, I have read about CSF before, have not checked yet to see if we have that.

    Will do a little more testing and report back.

    Incidentally:
    Admin Server cPanel:
    Client Server cPanel:
     
    #5 stgeorge, Jul 20, 2012
    Last edited: Jul 20, 2012
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Make sure you've cleared your browser cache, cPanel is up to date, and you're on a default cPanel theme. (x3) in doing so you help narrow down any other issues that could be present.
     
  7. stgeorge

    stgeorge Member

    Joined:
    Jul 20, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I tested the Server with my largest Joomla 1.5 installation, created and put this into an AddOn Domain with SSH top open.
    These are the CPU % Results:

    Uploaded 73 mb archive tar.gz:
    Spiked at 1.3
    Average around 0.3 - 0.7

    Added a database:
    Spiked at 2.7
    Average around 0.3

    Archive Extraction:
    Spiked at 15

    Uploaded SQL Database 34mb:
    Spiked at 39
    Additional Spikes 22 & 32
    Average around 3
    Root Spiked at 36

    Moved Files, (Drag and Drop), from Extracted Archive Directory to AddOn Domain Directory:
    Spiked at 15
    Additional Spikes 8 & 10 & 12
    Average around 2-4

    We have a Script running that Auto Suspends Users that exceed 50% CPU set in the Script.

    After we started the Auto Suspension Script my Account got suspended for 51% CPU, logged by The Daily Process Log, which has two lists:
    The First List for average use during the day.
    The 'Top Processes' list that will show spikes.

    The 51% was logged in the 'Top Processes' list.

    We disabled the Script and I then ran some tests with SSH top open on the same Site:

    Submitting a php Contact Form within a CMS 15%
    Submitting a php Contact Form within Static Site 5%

    A site I have that uses a CCK, (Content Construction Kit).
    Caching to File Off the CCK pages can spike at 12%.
    The problem with the above is, it is a single Hit. If more than one person was to hit the CCK, then not sure what world happen.

    Normal Joomla 1.5 CMS pages can spike at 7%

    Logging In and Out of a Joomla 1.5 Admin spikes at 15%

    Caching to File On the CCK pages can spike at 5%, (same pages that I know I have hit and cached).
    Caching to File On the Joomla pages can spike at 0 to 3%, (same pages that I know I have hit and cached).

    WHM Daily Process Logs Notice:
    Question is:
    Does this not mean that whatever percentage we use for the Auto Suspension Script should be multiplied by 4?
    For example:
    If we wish to set it at 20% including Spikes, the Script should be set at 80%.
    If we wish to set it at 40% including Spikes, the Script should be set at 160%

    Another Admin Noticed this:
    Issue is definitely WHM/cPanel.

    Take a look at the attached screenshot from SSH.

    The first free -m was before WHM/cPanel daemon was started (right after the server reboot). All my commands were performed fast.

    The second free -m was after WHM/cPanel daemon was started. HUGE difference.
    SSH_WHM.jpg

    See Also:
    http://forums.cpanel.net/f41/what-belive-whm-cpu-usage-cpgs-cpu-usage-120873.html
     
    #7 stgeorge, Jul 25, 2012
    Last edited: Jul 25, 2012
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  9. stgeorge

    stgeorge Member

    Joined:
    Jul 20, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    We have CSF, but all I have seen on this re usage and application with other scripts is:
    Login Failure Daemon (LFD), bundled with CSF
    /http://winfoes.co.uk/forum/Website-Hosting/651-What-is-lfd-in-cPanel-Server-Status-Service#652

    I am not sure that CSF will help if it is taking Spikes in CPU from the logs as the Script we are using works well.
    It is just getting the settings right, hence the question:
    As for the link:
    whm says i have 24 cpu's... but i have 4

    We are not getting a false report on the number of CPU's

    Thanks for the help though.

    Unfortunately we are still looking for answers.
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm unclear on what that comment means.

    From the CSF page I linked you to:

    I cannot assist you with your custom banning script, my apologies.
     
Loading...

Share This Page