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.

  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.