Support » Fixing WordPress » WordPress 1,2 slow… probably not its fault

  • I admin my father’s absurdly busy blog (, running on a slightly modified WordPress, on Debian Testing, with PHP4.

    Today, around 2pm, it ground to a halt. From serving up a page in a second or less, it now takes 10-30 seconds. And I have no idea why. If I restart Apache (2.0), then it races back to life. For about 2 minutes. Then it goes back to its slow ways.

    I am tearing my hair out… any suggestions for where I should look for help?



Viewing 14 replies - 1 through 14 (of 14 total)
  • Try to find any sections that look similar to the following and paste them here:

    <IfModule blahblah>
    StartServers 3
    MinSpareServers 2
    MaxSpareServers 5
    MaxClients 100
    MaxRequestsPerChild 1000

    Then take a look in /etc/apache2/mods-enabled and list what module names you have in there.

    We should be able to go from there.

    <IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 20
    MaxRequestsPerChild 0

    and in mods-enabled are…


    Many thanks,

    Since I posted this, the site has suddenly returned to full performance! Bizarre?

    It sounds like your apache is currently eating all the memory on your server. Change the section you posted to:

    <IfModule prefork.c>
    StartServers 5
    MinSpareServers 5
    MaxSpareServers 10
    MaxClients 100
    MaxRequestsPerChild 1000

    This alleviated similar problems on my server (which gets relatively few hits) so hopefully it should do the same for you.

    BTW, while this is tried and tested on my server, I didn’t get it from any documented source. It was mainly through trial and error that I came to the above setup.

    OK – I tried that, and again have come up against the same problem. After a while the site slows right down (and, indeed, seems now to have stopped completely). When I ssh into the box, it runs at a fair speed, so I’m sure the machine isn’t itself running slow.

    I wonder if it’s a slow or malformed SQL query… (damn I wish I could see *where* exactly the system is hiccuping).

    Are there any pointers in your error logs? They should be in /var/log/apache2

    Woah! Whole system now unstable. Power cycle time…

    (I will check the error logs when it comes back up.)

    OK. Only thing in the error log that looks like a likely culprit is:

    “server reached MaxClients setting, consider raising the MaxClients setting”, that occurs just before the site goes into slow-mo!

    I’ve upped it to 500 – but to be honest, I don’t think that’s the real problem. “ps -All” shows about 100 apache2 processes… and I suspect it’ll now race up to 500. Maybe it’s not timing out connections fast enough? But why would that only occur now?


    Well, I’ve turned off KeepAlive. I don’t know whether that will help. I guess I’ll watch and look. MaxClients has been adjusted down to 256. Hopefully, without the KeepAlive… well, we’ll see.

    Gosh – this is all turning into a horrible admin nightmare. I’ve also been getting “too many connections” errors on mysql – perhaps due to me restarting apache repeatedly, or perhaps the source of the problem.

    And my logs are multi-gigabyte size… I really wish I knew what i was doing!

    What do your access logs look like?? I had something similar happen to me once and I was getting my box hammered in what was essentially a DOS attack….

    Try having a look through these docs to see if they help your situation:,39025945,60079706p-39000639q,00.htm – I know this link is for poweredge servers, but it’s not really going to be all that specific to Dell 😉

    Hope this helps.

    Also, check out starritt’s suggestion too.

    OK: I seem to have narrowed the problem down to mySQL, and in particular to a slow query. This seems to be the issue:

    Copying to tmp table | SELECT * FROM wp_comments WHERE (comment_approved=’1′) GROUP BY Comment_ID DESC LIMIT 5

    Which is often taking a long, long time because the table – presumably – is locked. Does anyone have any idea why this might happen, and how it can be stopped?

    Grrr… thanks, Robert

    Just for the record: this query is from is my “recent comments” plug-in. Is it an appalling piece of SQL that’s causing the problem, or could there be something else?

    (Essentially, mySQL seems to lock-up… then too many queries… then *poof!* the system is down)

    had the same problem – update your PHP Version!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘WordPress 1,2 slow… probably not its fault’ is closed to new replies.