Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have dedicated hosting on GoDaddy running a WordPress blog. It seems that whenever we get a high number of concurrent users (about 100), the site goes down. The way we've been fixing it, per the suggestion of GoDaddy, is to run service httpd start.

The above is a temporary fix. And the httpd service keeps going down because our traffic is reaching high numbers of concurrent users.

We also go this from chatting with GoDaddy:

Server Concierge:  Apache is maxing out your resources. As soon as I started Apache you went from 500 megs free of RAM to 0 free.
Server Concierge:  Currently it appears that you have over 500 connections to the server at the same time.
Server Concierge:  The majority of the connections are coming from just a few users.
Server Concierge:  You will need to ensure that your site is optimized to close Apache connections once they are finished.

What do we need to do to make Apache handle our traffic? We have SSH access, so if we can get step by step commands to execute, we can probably fix this problem.

share|improve this question

migrated from stackoverflow.com Jul 28 '11 at 22:39

This question came from our site for professional and enthusiast programmers.

    
Give nginx a try. –  nix Jul 28 '11 at 22:38
    
Is 100+ users really too much for Apache? I feel that trying to migrate to nginx might be a bigger headache at this point. Thoughts? –  StackOverflowNewbie Jul 28 '11 at 22:45
    
Apache can handle thousands of users, or just one, it completely depends on your website. Sounds like you've got more going on than just a WP blog. Any chance it's been hacked? –  Chris S Jul 28 '11 at 23:00
    
How would we know? And what can we do to prevent this? –  StackOverflowNewbie Jul 28 '11 at 23:09

1 Answer 1

up vote 4 down vote accepted

Since the 'Server Concierge' reported that the majority of the connections are coming from just a few users, edit /etc/httpd/httpd.conf and configure the following (these are example values):

KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 5

Just as a start.

Also, if it is indeed 'just' a wordpress blog, install wp-cache or wp-super-cache. Either can make a huge difference in your ability to handle traffic.

share|improve this answer
    
anastrophe - what would be ideal values to put in httpd.conf? –  StackOverflowNewbie Jul 28 '11 at 23:38
    
I did a quick check in /etc/httpd/conf/httpd.conf and these were the values I saw: KeepAlive Off, MaxKeepAliveRequests 100, KeepAliveTimeout 15. Also, once I change these values, do I need to restart httpd? –  StackOverflowNewbie Jul 28 '11 at 23:43
    
I would start with the values I proposed, just as a starting point. It's generally best to keep the timeout below seven seconds. You need to restart apache after making the change. But do look into wp-super-cache - it's a Wordpress plugin. –  anastrophe Jul 28 '11 at 23:47
    
Also, you can control with limits the connections to the server, to prevent resource starvation - though implicit in that is that the site becomes unavailable to connections over the limits (which isn't so bad, since it becomes unavailable anyway). Configure 'MaxClients' and 'ServerLimit' to some rational value, such as 100 each, rather than the defaults (which I don't recall at the moment). There are dozens and dozens of tunable parameters in Apache, it can be daunting, but a Google search or three on 'Apache performance tuning' should yield enlightenment. –  anastrophe Jul 28 '11 at 23:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.