Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm newbie on VPS configuration. So, I've installed apache, php and mysql and now I need to know how to configure Prefork to optimize Apache.

The system configuration  is:
CPU Cores 2 x 2 Ghz @ 4 Ghz
RAM Memory 2304 MB DDR3
Burst Memory 3 GB DDR3
Disk Space 30 GB SSD
Bandwidth 3 TB
SwitchPort 1 Gbps

Actually, after linux, mysql, apache and php, there are 250 MB memory in use.

Well, I don't have idea to calculate. I saw in some websistes, some vars like:

KeepAlive On
KeepAliveTimeout 1
MaxKeepAliveRequests 100
StartServers 15
MinSpareServers 15
MaxSpareServers 15
MaxClients 20
MaxRequestsPerChild 0


StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

How I could to do: Prefork or worker? Where and how the vars are placed? In httpd.conf?

share|improve this question

migrated from Sep 27 '12 at 1:09

This question came from our site for pro webmasters.

I would suggest NGINX instead as this is NGINX's goal! – endyourif Sep 22 '12 at 23:24

This cannot be decided just by the specs of the hardware. There are many things that are important, especially what you are about to serve.

For Example:

A website that uses mod_php should use prefork as PHP might not be threadsafe. If you use fcgi you can use worker. Do you use a lot of AJAX for push notification on the website? Then you might set a very high MaxClient value. But you need to set it lower than Size Per Apache process * Clients what would be about 22MB Per Process. On the other hand you might not need such a high MaxClient if you serve a lot of static content. And the Spares as well. How much are you willing to have available "hot".

The question for Performance cannot be answered like this. More it's a constant testing and learning. Tightening screws and oiling up everything.

You should analyze your performance with a benchmarking tool like Apache Bench. Try different combinations and test them. That's how you get your configuration.

share|improve this answer

Your Answer


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.