Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

So I have it all running, no errors, but I'm trying to optimise it for a 4gb Rackspace Cloud server.

This is what I have currently:


pm.max_children = 200
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 60
pm.max_requests = 100


worker_processes 4;
events {
        worker_connections 2000;
        # multi_accept on;


memory_limit = 16m;

Just doesn't seem to perform as well as my Apache2 setup with the same server when runnning

ab -n 30000 -c 350
share|improve this question

migrated from Sep 25 '11 at 5:31

This question came from our site for professional and enthusiast programmers.

Posted on the wrong site. Belongs on ServerFault. – bradley Sep 24 '11 at 16:24
ab is for testing apache2. Try http_load: – petermolnar Sep 27 '11 at 14:08
up vote 2 down vote accepted

You will need to tweak and adjust until you find your sweet spot but "pm.max_requests = 100" seems very low. Something like 500 or 1000 or maybe more, might be better. Fastcgi will have to kill and respawn children after each one serves pm.max_requests.

PHP memory should not directly impact speed and is the same for both test targets or yours but "memory_limit = 16m;" is low. Start at 256M. You have 4GB of RAM so why limit PHP to a measly 16mb max?

share|improve this answer
I'd also add, I think you do not need 60 spare servers, fewer would be enough, but do raise max_requests. – petermolnar Sep 27 '11 at 14:08
I thought that php's memory_limit was the limit on memory that a php process could use, if the php script he runs doesnt require more memory why increase it? in fpm-php this means the worker process would consume more memory and limit the number of spawned process or did I get it wrong? – Purefan Apr 15 '13 at 8:17

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.