php7.0-fpm occasional crash

Hey everyone, I'm currently using phalcon with the following setup

  • Ubuntu 14.04 trusty
  • Phalcon 3.0.3
  • nginx/1.4.6
  • php7.0-fpm

Problem is, occasionally the server would crash out of the blue, and when it happens, the fpm needs to be reloaded using sudo service php7.0-fpm restart and it goes back to normal operation. What could be the root cause of the trouble? Is this a known issue? Any help/pointer on this issue would be much appreciated, thank you!



66.8k

dig into logs, turn all error reports and pipe them into a file and monitor it

@Izo, thanks for the reply

>dig into logs, turn all error reports and pipe them into a file and monitor it

Is there something specific I should be looking out? Or should I report back and paste the log file?



66.8k

I dont know to be honest, i have seen some problems with fpm, but its regualr stuff, never actually have to restart the service.

My blind guess would be that workers/proccess are not enough and requests takes high amount of time and you have to wait some time to spawn a new process.

post screenshot of htop when service is stuck aswell.

But i am not sure if I am gonna be able to help.

You can contact me at discord or slack, my nickname there is Izo

then we will see what we can do, perhaps a teamviewer to check it myself to see if i can spot anything

Is its possible that you have compileAlways enabled? If yes then it's not phalcon issue, it's php issue from they category like it won't be fixed because it's os/file system related - it tries to access file which is currently written by other process.

@Izo after taking a stroll through the nginx error log, I found several [error] 41371#0: *3308726 connect() to unix:/run/php/php7.0-fpm.sock failed (11: Resource temporarily unavailable) errors, but mostly just php warnings. What could be the root cause?

@WojciechŚlawski Thanks for the response. Yes! I do have compileAlways enabled, is that the problem? Should I disable it and see how it goes?

edited May '17

Yes, it is a problem. It's just how php is developed, it's not phalcon issue.

Well i see you use sockets, if there is many connections then it's known thing that sockets are not stable, you should switch to tcp/ip if you have many requests.

Check this issue here - https://github.com/phalcon/cphalcon/issues/12506

Related php bug from 2010 - https://bugs.php.net/bug.php?id=52752 to this compileAlways

edited May '17

>Yes, it is a problem. It's just how php is developed, it's not phalcon issue. > >Well i see you use sockets, if there is many connections then it's known thing that sockets are not stable, you should switch to tcp/ip if you have many requests. > >Check this issue here - https://github.com/phalcon/cphalcon/issues/12506 > >Related php bug from 2010 - https://bugs.php.net/bug.php?id=52752 to this compileAlways

Thanks for the links, it is strongly similar to the issue I'm currently facing. I've tried using tcp by following this . Disabled compileAlways also. Unfortunately the errors are still occuring though. Is there a certain tcp configuration I'm missing or other parts I should look into?

Then idk, it doesn't look like seg fault. You could check if you have any core dump or run php-fpm in gdb.

Is there a known issue related to volt partials? I tried rolling back to a previous commit, before I started using partials. The server has not crashed since

What you mean? I don't know, im not using them.