Support » Fixing WordPress » Help! Blog suddeningly taking up 100% of CPU

  • My blog was taken down by my hosting provider today, A Small Orange, because:

    Your blog is executing a query that is eating up 100% of the cpu time, you will need to work with the wordpress group to figure out what this query is and why its executing over and over and eating up all the cpu time:

    Query SELECT option_name, option_value FROM wp_options WHERE autoload = \’yes\’

    Any idea what could be causing this? I’m running 2.6.1 and have several plug ins running (could this be the issue?). The blog gets under 1,000 page views a day, by the way.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Well, that query runs every page load. But it doesn’t run over and over, just once per page.

    Do you have any web hit executing repeatedly? wp-cron, perhaps?

    This is the first time this has happened. So, I’m not sure what is different today.

    My host said they disabled all my plugins and the problem is still persisting.

    This happened right around the time my daily WP backup was supposed to happen. This is the specific plugin:

    What uses wp-cron?

    What uses wp-cron?

    Lots of things. But it would help to know the actual problem before attempting to fix it.

    Look at the log of hits to the site. Are you getting DOS attacked? Is wp-cron hitting a lot? What? Without looking at the logs, you will never know what’s causing the problem. WordPress can’t magically execute queries by itself, you know.

    I have a shared hosting account, and I’ve been suspended. So, I currently don’t have access to that information. I’m trying to get it, but they aren’t being very helpful with this situation.

    This is the response I got from my host:

    “You need to ask them what exactly calls this query. Its not a matter of hits to the site, its a single query, the one i sent you originally that is causing the problems. They should know what part of their script is calling this query, they need to check their code and figure out where this query is coming from. Logs wont show anything but what people are accessing your site, there are no errors, so the error log is not getting anything. The access log would prove no use to us, as we have no idea what script is executing this query.”


    Can you explain a little more to me about what calls this query and what it does?

    Query SELECT option_name, option_value FROM wp_options WHERE autoload = \’yes\’

    (Feel free to copy and paste my entire response in your note back to them.)

    Yes, we know exactly what causes that query: everything.

    That query is called every single time WordPress is executed, period. It is the main query that loads all the “autoload” options from the options table in the database. This is done so that it doesn’t have to load them all individually. The autoload options are loaded from the database into a cache in memory. Then, future attempts by the software to load options come out of that memory cache instead of hitting the database.

    In other words, that query is there to REDUCE LOAD. Not increase it.

    So basically, your hosting provider is full of crap. This statement: “Logs wont show anything but what people are accessing your site,” is absolute BS. The logs will show WHAT FILES THEY ARE HITTING THE MOST. WordPress has multiple entry points. We need to know what’s getting hit the most often in order to determine where your load problem is.

    Because no matter what they say or think, that query is NOT causing load. It’s a well indexed table, and requires no CPU time for the database to execute. All it’s going to do is transfer some data from the database to WordPress. It doesn’t have to do row scans or full searches or anything of that sort. All they are really seeing is the fact that it is the most commonly executed query and then they are assuming that it is the problem. They are mistaken, and they really need to find somebody who knows WTF they are doing instead of talking out of their asses. Somebody with actual database experience would help, but any experienced sysadmin should know better than this.

    It’s a damn shame too, I was planning on switching my hosting to ASO here soon, but if this is the kind of behavior they have, then I’ll have to reconsider that move.

    I’ll send your reply back to my host to see if the can provide me with any assistance. They haven’t been particularly helpful, and I can no longer access my own logs.

    Quick question, is it possible for a schedule cron event to not happen properly and for it to keep looping code or queries?

    Quick question, is it possible for a schedule cron event to not happen properly and for it to keep looping code or queries?

    Yes, if the server is setup such that the PHP code cannot open a connection back to itself or something else is blocking wp-cron from operating properly. Which is why I asked to look at those logs.

    If you get your site functional again, install the WP-Crontrol plugin. It adds a section in the admin that lets you see and modify the wp-cron jobs. If there’s a lot of them pending, then your server is likely having problems connecting back to itself. Could be lots of causes for this.

    ASO has been helpful in the past, and they do respond quickly to requests (almost always same day). This is the first time they have ever not been able to provide me assistance.

    I think they might not have a lot of experience with WordPress. Basically all they tell me to do is ask you guys for help because they have no idea what’s going on.

    And I honestly know very little about SQL or system administration.


    This problem happened exactly when a database backup was scheduled to happen. That’s what leads me to believe this might be cron related. I’m going to try to get them to look closer at the logs or let me look at them again.

    A full DB backup would take a lot of horsepower, and could easily cause CPU load. And if it took longer than the PHP server was set to allow it to run, then the job would not finish and would start over again a short time later.

    I am having exactly the same problem as this user.
    “bluehose” suspends my site approximately every 5 mins.
    I have optimized my databases daily; and also disabled
    unneeded plugins – but still I’m hitting this shutdown wall
    due to excessive cpu usage.

    is there a possible list of plug ins which do not play well with
    the most recent version of wordpress ? as this is causing even non
    wordpress sites to be shutdown.

    it’s costing my about half my visitors a day lately.

    HELP Please

    ausetkmt: Please start your own thread.

    Also, there’s no quick fix for this sort of thing. You have to diagnose what’s causing the CPU overloads. And to do that, you need a hosting service that doesn’t suck.

    If they won’t help you out, then switch hosts.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Help! Blog suddeningly taking up 100% of CPU’ is closed to new replies.