optimizing apache for high traffic


I have a site with relatively high traffic. Normally the site goes down when it reaches about 1300 ppl online the same time. I am using Linode 2GB.

My current settings are like this (keepalive Off):

StartServers 4

MinSpareServers 12

MaxSpareServers 24

MaxClients 20

MaxRequestsPerChild 6000

While I know it involves a lot of testing, I have very little back-end programming skills. What would be a good value to start with?

Thanks so much,


4 Replies

Why would you have keepalive's off? That is generally a huge performance benefit. Without seeing a more information, I don't think anyone could tell you why your site goes offline or how to tune Apache for your load.


KeepAlives significantly hurt performance. They save some bandwidth and reduce average response times a bit, at the cost of a huge increase in memory consumption. That in turn significantly reduces the number of simultaneous clients that can be served.

Apache can be configured in such a manner that the memory load from keepalives isn't so huge (things like switching from mod_php to a fastcgi approach), but generally they're not worth it unless you have a ton of RAM. And that's not something that tends to happen in a VPS environment.

Yes, I took the advice from the Linode team and turned KeepAlives off. It does improve the site performance in my case.

Would it be helpful if I attach my htop/iotop or other results?

Further thoughts–Caching--

APC? (Pre 2.4 you have to tack it on, post you're g2g)


CDN? CloudFlare?

Where's your Database in all of this? Mysql are you running a performance profiler for helpful tuning?

Just some thoughts.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct