WordPress.org

Ready to get started?Download WordPress

Forums

WordPress 1,2 slow... probably not its fault (15 posts)

  1. rcs1000
    Member
    Posted 9 years ago #

    I admin my father's absurdly busy blog (www.politicalbetting.com), 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?

    Thanks,

    Robert

  2. Splee
    Member
    Posted 9 years ago #

    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
    </IfModule>

    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.

  3. rcs1000
    Member
    Posted 9 years ago #

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

    and in mods-enabled are...

    cgi.load
    mod_python.load
    perl.conf
    perl.load
    php4.conf
    php4.load
    rewrite.load
    userdir.conf
    userdir.load

    Many thanks,
    Robert

  4. rcs1000
    Member
    Posted 9 years ago #

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

  5. Splee
    Member
    Posted 9 years ago #

    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
    </IfModule>

    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.

  6. rcs1000
    Member
    Posted 9 years ago #

    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).

  7. Splee
    Member
    Posted 9 years ago #

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

  8. rcs1000
    Member
    Posted 9 years ago #

    Woah! Whole system now unstable. Power cycle time...

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

  9. rcs1000
    Member
    Posted 9 years ago #

    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?

    Hmmmm....

  10. rcs1000
    Member
    Posted 9 years ago #

    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!

  11. starritt
    Member
    Posted 9 years ago #

    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....

  12. Splee
    Member
    Posted 9 years ago #

    Try having a look through these docs to see if they help your situation:

    http://httpd.apache.org/docs-2.0/misc/perf-tuning.html
    http://www.xs4all.nl/~thomas/oscon2003/PerformanceTuning.html
    http://whitepapers.zdnet.co.uk/0,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.

  13. rcs1000
    Member
    Posted 9 years ago #

    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

  14. rcs1000
    Member
    Posted 9 years ago #

    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)

  15. paxos
    Member
    Posted 9 years ago #

    Hi,
    had the same problem - update your PHP Version!

Topic Closed

This topic has been closed to new replies.

About this Topic