Re:Surviving a traffic surge: Three techniques to scale your...
by ceejayoz on Tuesday March 29, 2011 @03:08PM
(#2383935)
Apache's memory usage should not exceed the available RAM on the machine. If you do that, it starts having to use swap, which drastically slows things down - if you're already getting lots of hits, it'll start a death spiral.
Apache's memory usage varies based on what modules are enabled and the code they're serving and a number of other factors.
The rule of thumb is to take the average free RAM when Apache isn't running, divide it by the average RAM usage of a single Apache process on your system, and set MaxClients to a couple under that value.
For example, on a 512MB Linode box, if you've got 450MB free when Apache isn't running, and Apache takes up 12MB per process, you'd allow about 35 at the most.
Apache's memory usage varies based on what modules are enabled and the code they're serving and a number of other factors.
The rule of thumb is to take the average free RAM when Apache isn't running, divide it by the average RAM usage of a single Apache process on your system, and set MaxClients to a couple under that value.
For example, on a 512MB Linode box, if you've got 450MB free when Apache isn't running, and Apache takes up 12MB per process, you'd allow about 35 at the most.