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

Recently I've uploaded some changes to my server that increases the amount of AJAX calls made to the server.

The application "fastness" has decreased a lot. The web server is nginx with php5-fpm module

If I run a "top" command on the server console I see:

  • Between 5 and 8 php5-fpm processes that takes about 70-80% of CPU usage

The configurations are: (just the significative part)


worker_processes  8;

    worker_connections  1024;
    multi_accept off;

    sendfile        on;
    keepalive_timeout  30;
    tcp_nodelay        off;
    client_max_body_size 64m;
    gzip  on;


pm = dynamic
pm.max_children = 10
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.process_idle_timeout = 5s;
pm.max_requests = 400

The Server specs:

  • 24Gb of RAM
  • Inter Xeon 8 Cores

What do you think about this problem? Is it caused by a server configuration not optimal? What configuration do you suggest for this server?

share|improve this question
It is really impossible to know without seeing the said scripts that are hitting PHP. Are you hitting CPU or memory limits? You said it is using 70-80%, what was it before? Is it slowness in PHP or in the network latency on the ajax scripts? – Dave Drager Nov 19 '12 at 22:13

With 24 GB of RAM you should increase these settings


to something more sane for your server. Your current settings are in a sort of "nice at home to play with" setting.

For example, see "Tuning PHP5-FPM" here and do the math. My guess would be to start out by multiplying the numbers by 10 or so.

Anyway, your PHP application could still be linear CPU-bound instead of worker-bound and tuning would not help a thing.

share|improve this answer
Thanks! Worked like a charm! – boblith Nov 21 '12 at 20:39
@boblith Glad to hear that. Please consider accepting the answer. – gertvdijk Nov 21 '12 at 21:19

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.