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

The site use nginx+php-fpm. Today, accessing some pages returns 502 state in a few seconds (different from 502 caused by php script timeout), while other pages stay in service.

Status page of php-fpm shows all processes are active, but they're all stucked in State: finishing, and load of server is low.

pid:                  12775
state:                Finishing
start time:           18/May/2013:16:50:27 +0800
start since:          755
requests:             59
request duration:     743543095
request method:       GET
request URI:          /index.php
content length:       0
user:                 -
script:               /data/webserver/index.php
last request cpu:     0.00
last request memory:  0

I'm wondering why this happened, although it becomes well after I restart the php-fpm.

share|improve this question
Hi Haocheng! I was having the same problem, some pages got stuck in finishing state, did you ever fix this? – Beto Aveiga Dec 3 '13 at 20:39
@BetoAveiga For me, it comes to be that the function registered by register_shutdown_function was stuck. – Haocheng Dec 9 '13 at 12:59

This problem was caused by a long running function registered in fastcgi_finish_request(), after a long investigation. FYI if you're looking for the answer.

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.