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

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

or

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 webmasters.stackexchange.com Sep 27 '12 at 1:09

This question came from our site for pro webmasters.

    
I would suggest NGINX instead endyourif.com/its-lemp-not-lamp as this is NGINX's goal! –  endyourif Sep 22 '12 at 23:24

1 Answer 1

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

 
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.