I have a question about Apache MPM Prefork configuration on VPS servers.

One slicehost articles, they suggest to set MaxClients to 40 if I have 256MB RAM on my virtual server. (http://articles.slicehost.com/2010/5/20/configuring-the-apache-mpm-on-debian)

However since each client request uses approx 50MB RAM memory, swapping is guaranteed and my VPS slows down.

10146 45944 /usr/sbin/apache2 -k start
10147 52528 /usr/sbin/apache2 -k start
10150 49680 /usr/sbin/apache2 -k start
10151 48756 /usr/sbin/apache2 -k start

I've found out that if I set MaxClients to 4 (!) instead, I don't get any swapping, and the webserver is supposed to be faster (or am I wrong?)

So, I don't understand why they do suggest 40 instead.


2 Answers 2


The amount of MaxClients you can have purely depends on the nature of your site.

If you are serving out mostly static content, then Apache doesn't use very much memory and 40 (or more) can be set to MaxClients.

On the other hand, if you do have some memory-heavy stuff going on (such as you run a CMS like Drupal or a blog with WordPress), memory requirements per process will heavily balloon and so goes down the MaxClients value you can have. With those heavy PHP applications a single process can easily consume anything from 10 to ??? megabytes of RAM.

  • I can second that. Have a look at how much memory each instance of apache eats up. Then see how many processes you can afford to have running at the same time (with each using that much memory). So, a rhough starting point might be (total memory) / (2 for system stability and other processes) / (memory per process) as MaxClients. From then on, watch (top) your mem usage and adjust as seen fit. Oct 6, 2012 at 14:55

They probably suggest that, because 50 MB memory per request is not the common thing.

You should probably check, if you can get rid of any modules you're using. Also check if you can move any mod_ (like mod_php) to fcgid.

After you did that, you probably have only thread-safe modules left and can safely switch to worker MPM, which will likely resolve all your performance problems.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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