I have php-fpm 7.0 and nginx 1.11.6 in FreeBSD 10.3.
Sometimes I get 504 timeout even when the server has a lot of free resources.
Nginx waiting answer from php-fpm 30 seconds. I write application logs and see that most longest php process worked 24 seconds. I also got 504 error for processes that work less than second.
Slow log enabled and should log all longer than 12 seconds and slow log empty.
I try write logs from shutdown handler to catch long time processes, but they all work much faster than 30 seconds.
Admins said that looks line nginx doesn't get answer from php-fpm.
Now I am confused and I don't know what I should be looking for. Which log can I enable that could help me find the issue. What symptoms can I also check?