Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Service monitoring and restart
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Service monitoring and restart

LeviLevi Member

Got interesting problem about few cases where PHP-FPM and/or MySQL hanged out. Service status OK, just received "gateway timeout" and that's it. Services "hanged out".

How to monitor for such behavior? Maybe with monit I could do something? Problem roots are users with shitty scripts. And I would like to restart services if there such "hang outs".

Comments

  • JustHostJustHost Member, Patron Provider

    Maybe use a bash script to check a website that is hosted on the server and if timeout is larger then x restart these services and have it check every 60 seconds or something

  • JabJabJabJab Member

    You don't need restarting script, you need to figure out why it is happening and fix that issue. PHP-FPM or MySQL is not kind of software that will just "hang out", constantly.

  • LeviLevi Member

    @JabJab said:
    You don't need restarting script, you need to figure out why it is happening and fix that issue. PHP-FPM or MySQL is not kind of software that will just "hang out", constantly.

    Problem is well known: shared hosting users. Since I provide free hosting, I would like to automate few things as much as it is possible.

  • risharderisharde Patron Provider, Veteran

    @LeroyJ you can probably write a shell script to check the status of php-fpm and mysql from a command like service php-fpm status . If 'dead' restart. I didn't google for you but there must be someone out there that has done this before either on stackoverflow or github

  • risharderisharde Patron Provider, Veteran

    I should mention that it does sound strange for php-fpm to entirely die without doing something really weird and mysql as well but I understand your use case is largely different from my experience

  • This might be a very basic question. But does the server have enough RAM to work with? Is it hanging because it's just slow? Then times out or something?

Sign In or Register to comment.