2

On a php5-fpm status page, what is the bottleneck that is preventing my server from accept()'ing new sockets fast enough?

pool:                 www
process manager:      static
start time:           20/Jan/2015:16:37:18 +0000
start since:          176705
accepted conn:        903749
listen queue:         0
max listen queue:     129
listen queue len:     128
idle processes:       59
active processes:     69
total processes:      128
max active processes: 128
max children reached: 0

As you can see, I've reached my listen queue, and this happens quite frequently. I understand the basic logic behind the listen queue, and it is laid out in some detail here: php-fpm status page: what are the "queue" items in this report?

I realize that I should increase the queue length, and I will make it so. However, my question is why is my listen queue filling up, and what is the bottleneck to prevent it from filling up in the first place? I assume if there is a large listen backlog, then there has to be something that isn't "keeping up"? Is this a CPU bottleneck / load issue that it cannot accept() fast enough?

A.B. Carroll
  • 545
  • 1
  • 4
  • 11

1 Answers1

3

You don't appear to have enough PHP worker processes for the traffic you're receiving.

The obvious solutions are:

  1. Allow for more total processes. But you need to have the CPU and RAM to handle this, and you didn't say anything about what resources you have available or how much was consumed.
  2. Make your application run faster. Better programming, appropriate use of page caching and opcode caching, etc.
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • 1
    You have 59 idle NOW, but your site has been much more busy, with 128 active and 128 _more_ waiting for one to free up and accept(). – Michael Hampton Jan 22 '15 at 18:50
  • Thanks. I didn't realize it was ONLY queuing them when I was out of workers all together. I thought it was queuing them under other circumstances, -- specifically if it could not accept() fast enough. – A.B. Carroll Feb 04 '15 at 04:12