WordPress.org

Ready to get started?Download WordPress

Forums

CPU Overload (19 posts)

  1. thelocomono
    Member
    Posted 6 years ago #

    As my friend Otto42 suggested, I am posting a new thread here to see if anyone has comments regarding how to resolve CPU overloads.

    I am currently running WP 2.3 using i3Theme v1.5 on th HostICan Tera plan (shared).

    2007 saw zero CPU overloads. 2008 already seen quite a bit of overloads. And the strangest part was nothing was changed so I reinstalled WP and cleaned the database up and started deducting possible issues.

    These are the possible issues I have started working on and noticed a significant improvement to the process.

    Deleted images in the Upload folder that were no longer there because of reinstallation. This resulted in a huge difference. As a result, I am now working on new images with file sizes of 50k or less.

    I also have disabled stats plugins including Tan Tan WordPress reports and Semiologic Google Adsense and this also resulted in a noticable difference. All I had to do was just insert the Google Anaylsis code into the footer and disable the plugin, removed from the plugin folder, cleaned up the mySQL database.

    I am using a number of plugins all except for 2 of them which are 4KB,

    wp-ajax-edit-comments (4KB)

    maxblogpress-stripe-ad (4KB)

    popularity-contest (4KB)

    featured-sites.php (20KB)

    wp-contact-form (4KB)

    akismet (4KB)

    sig2feed.php (6KB)

    google-sitemap-generator (4KB)

    top-commentators-widget (4KB)

    optimal-title (4KB)

    no-self-ping (4KB)

    live-comment-preview (4KB)

    dualfeeds (4KB)

    wp-super-cache (4KB)

    yatcp (4KB)

    sem-dofollow (4KB)

    no-www (4KB)

    feedentryheader (4KB)

    commentluv (4KB)

    srg_clean_archives (4KB)

    all-in-one-seo-pack (4KB)

    oneclick (4KB)

    Two possible issues I am exploring right now is the index files including trackbacks and spiders bots (cron jobs).

    I am considering removing the popularity plugin as well as the live preview since the commenters can edit their own comments after publishing using the ajax edit comment plugin.

    Any suggestions to further optimization of my wordpress structure will be appreciated.

  2. thelocomono
    Member
    Posted 6 years ago #

    I suppose the thought behind my issue is how does WordPress software and its plugins influence processor usage?

    Is it related to file size or more related to the scripts?

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    It's more related to the scripts themselves. A script which does a lot of work takes a lot of CPU. A script which just outputs some minor bits of code or modifies something doesn't.

    Generally speaking, if you're getting CPU overloading, then it means that you're getting an increased amount of traffic. It also means you have a crappy shared webhost, and should probably look for a better one that is capable of dealing with the increased traffic.

  4. thelocomono
    Member
    Posted 6 years ago #

    That's one thing I have been finding out about the traffic and web hosting as you mentioned here.

    Funny thing is, I have not yet exceeded the traffic I got in December which was my highest traffic month ever, over 5,000 visitors. Right now, I am only averaging 110 visitors so far (about 1300 this month so far).

    Somehow my theme borked last night so I switched to the default Kubrick theme immediately and surprisingly the CPU over load decreased dramatically. It is still there but not as frequently.

    So that lead me to two conclusions,

    It is the way the theme is written.

    It is the way the plugins are written.

    As Otto42 said, the scripts can call a large amount of CPU usage. I am curious as to how to identify the script itself that is calling a large CPU usage.

    Meaning is it an incomplete script? What are the common traits to look for within a script that causes an overload?

  5. whooami
    Member
    Posted 6 years ago #

    I have to pipe in and say that just from reading your last post, im a little confused.

    Have you spec'd out what your host is providing hardware-wise for their shared hosting clients? Sounds to me like they need to put some RAM in their boxes or find a new gig.

    and what traffic has to do with any of this when seen in such small numbers?

    5000 visitors a month is nothing, unless theyre all on your site at the v e r y same time.

  6. thelocomono
    Member
    Posted 6 years ago #

    That is why I shouldn't be getting any overload issues with the traffic because even though my traffic is increasing every month, it is still minor this month in comparision to last month.

    I will look into the hardware spec and let you know what my host server has for me.

  7. whooami
    Member
    Posted 6 years ago #

    I will look into the hardware spec and let you know what my host server has for me.

    dont expect the truth, especially if theyre running crap hardware. Take it from me, I know what high end rack servers, cluster users get, and I know what crap boxes (in comparison) shared hosting users get. Im in the business.

  8. MoonbatWingnut
    Member
    Posted 6 years ago #

    Do a Google on: Bluehost CPU quota exceeded

    That will lead to a lot of discussion about this topic. Although Bluehost offers a lot of capacity in terms of space and bandwidth, they throttle you on the CPU cycles. (I know you may not be on Bluehost, but the issue is likely the same.)

    Also see this:

    http://wordpress.org/support/topic/113211?replies=16

    Also, try your site here:

    http://www.websiteoptimization.com/services/analyze/

    HTH

  9. thelocomono
    Member
    Posted 6 years ago #

    I don't know how much this will help but here is the general overview

    OS Linux Database Data Disk Usage 2 MB

    Server Apache/2.2.6 (Unix) Database Index Disk Usage 137 KB

    PHP v5.2.5 MYSQL Maximum Packet Size 16 MB

    MYSQL v5.0.45-community MYSQL Maximum No. Connection 250

    PHP Memory Limit 32M

    PHP Max Upload Size 2M

    Server Load N/A PHP Max Post Size 55M

    PHP Max Script Execute Time 30s

    The Bluehost information wasn't too helpful. Oddly enough now that I have switched to the default Kubrick and installed WP DBMananger, my CPU overload time has decreased dramatically. Almost 0 downtime now.

    I am curious to see what you have to say about the hardware information I provided. I am also going to check out the website optimization analysis.

    As soon as I get a reply about the hardware, I will be closing this thread to prevent it from spinning out of control.

  10. whooami
    Member
    Posted 6 years ago #

    I am curious to see what you have to say about the hardware information I provided

    You havent provided any. :) Everything in your last post is software information.

  11. thelocomono
    Member
    Posted 6 years ago #

    Heh, I just realized that now. Gracias. I will look into this AGAIN. ;)

  12. Aleph Ozuas
    Member
    Posted 6 years ago #

    I am having this same problem with HostDime, my server, and they said that I am using 23% of CPU from 8 processors Opteron 64bits and 4GB of RAM in 9 WordPress installations and some plugins.

    Do you thing they are telling me the truth? How much users uses to have in this kind of host environment? Especially you whooami, that know the business, what do you think?

  13. Aleph Ozuas
    Member
    Posted 6 years ago #

    Hey people, what do you think? The guys are telling me truth?

  14. thelocomono
    Member
    Posted 6 years ago #

    What kind of plugins are you using? It appears to be coming from PHP scripts which can ramp up CPU usage in connection with the WP Database.

    I am discovering that the times I have come across this issue is happening whenever I use a PHP function that calls for the WP database.

    I admit I don't know much about PHP or how the WP database works but it does appear to be linked. The times I get the CPU messages occurs only when I was using deleting custom keys that were set up by a few plugins.

    If you have deactivated plugins recently, you may need to check the database to ensure the data the plugins left behind are removed otherwise it is calling for something that isn't there anymore.

  15. mjulson
    Member
    Posted 6 years ago #

    I'm having similar issues with HostIcan. I keep getting a forward to a CPU overuse page. The odd part is that I have extremely low traffic. Rarely ever have more than two people on at the same time. I don't use many plugins, and my theme is pretty standard.

    Support from hostican has been terrible as they say they don't support the end user applications. My problem has been that I can't get support for their environment period. They pointed me to the cpulogs folder that has a log of CPU usage. They say it shows the overage, but I'm not sure if it's every access or just those that exceed the cpu limit(which they say is 25% over 60 seconds). Here's an excerpt of the log file.

    [26/Feb/2008:19:50:29 -0500] 64.135.5.18 www.variablemarkup.com /home/variable/public_html/wp-content/themes/blue-charm/img/blockquote.gif 0.000999
    [26/Feb/2008:19:50:29 -0500] 64.135.5.18 www.variablemarkup.com /home/variable/public_html/wp-content/themes/blue-charm/img/shadow_top.gif 0.002000
    [26/Feb/2008:19:50:45 -0500] 66.249.72.19 www.variablemarkup.com /home/variable/public_html/sitemap.xml.gz 0.002000
    [26/Feb/2008:19:54:44 -0500] 64.34.145.194 www.variablemarkup.com /home/variable/public_html/robots.txt 0.001000
    [26/Feb/2008:19:54:44 -0500] 64.34.145.194 www.variablemarkup.com /home/variable/public_html/index.php 0.545916
    [26/Feb/2008:19:55:18 -0500] 64.73.252.58 www.variablemarkup.com /home/variable/public_html/index.php 0.413937
    [26/Feb/2008:19:56:03 -0500] 66.249.72.19 www.variablemarkup.com /home/variable/public_html/index.php 0.401939
    [26/Feb/2008:19:58:09 -0500] 64.73.252.58 www.variablemarkup.com /home/variable/public_html/index.php 0.403939
    [26/Feb/2008:19:59:45 -0500] 69.64.32.77 www.variablemarkup.com /home/variable/public_html/wp-content/cache/supercache/www.variablemarkup.com/index.html 0.002999
    [26/Feb/2008:20:00:06 -0500] 65.214.44.29 www.variablemarkup.com /home/variable/public_html/index.php 0.414936
    [26/Feb/2008:20:00:38 -0500] 64.73.252.58 www.variablemarkup.com /home/variable/public_html/index.php 0.403938
    [26/Feb/2008:20:00:40 -0500] 66.249.72.19 www.variablemarkup.com /home/variable/public_html/index.php 0.586909

    I assume that the end time listed, such as 0.586909 is the time in seconds that it took to execute that page. And that 0.58 is six 10ths of a second. With that said, with the overlap in timing shown, I don't see how it could consume >25% of cpu for 60 seconds with this pattern. Am I reading something wrong here?

    I also have difficulty figuring out what might be the culprit(if it's actually true I'm using that much cpu) since everything is recorded at index.php instead of the actual page being used. Anyone able to suggest a way of diagnosing this better?

    Anyone able to suggest a better host?

  16. lnxcode
    Member
    Posted 6 years ago #

    It really depends on what plugins your running. Its easy to try to run to another web host, rather then face the problem and try to find a resolution to the problem.

    Maybe its not the host that is having the problem, but the choice of plugins your running. A server wouldn't have problem with your account / domain if you didn't cause one or a plugin caused one.

  17. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    A server wouldn't have problem with your account / domain if you didn't cause one or a plugin caused one.

    HA! That's a good one. :)

    Web hosting services are rarely good at what they do. The good ones are few and far between.

    If my host complained to me about "CPU Usage", I'd immediately switch hosts. It's simply a pretty solid sign of a bad webhost, in my experience. It means that they oversold the box's capacity. Sure, you can have an out-of-control process or get a DoS attack or something, but if they tell you that the CPU Usage is high without explaining why that is the case, then they most likely don't know what they're doing.

  18. dnorman
    Member
    Posted 6 years ago #

    sounds like something was missing in your previous theme - likely causing some 404 requests for missing files (maybe some images were gone? css?) and WordPress was happily generating a page view for the missing files as a 404 page. That amplifies page loads dramatically, as a single page view turns into several (up to dozens?) of simultaneous page generations.

    take a close look at the theme, and make sure nothing's borked. Safari can tell you, if you look at the Activity panel - missing stuff will be red, IIRC...

  19. mjulson
    Member
    Posted 6 years ago #

    Thanks for the tip. I was missing a small css file on certain pages, I've since checked it again and no 404's are being generated, yet I was able to exceed my cpu allowance by surfing my own site quickly.

    Hostican says that you can't exceed 25% cpu for more than 60 seconds, but in this case, I added up the cpulogs for the three minutes I was surfing and found that with 227 requests (index.php, images, css, etc.)each averaging 0.109164 seconds for a total use of 24.78022 seconds in the three minutes, that it blew my cpu budget. I doubt that any of these transactions used 25% of a cpu to accomplish.

    Unfortunately, Hostican is pointing at my plugins being the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic