Jump to content

Site Monitor Utility


Hacktronics India

Recommended Posts

I am facing lot of issues, where my prestashop website goes offline, and then I had to restart manually all the php-fpm, apache.

I still don't know the reason, I had disabled almost all the 3rd party addons, but still after few hours the site goes offline,

there is no patterns, sometimes everything is fine for days, and sometimes just after few hours php-fpm becomes unresponsive.

I tried to figure out the root cause, but it was too difficult for me, so I wrote a simple web site monitor.

It will check the web site status, whether its up or down, and if its down it will restart the services.

This is much better than having a cron job, that would restart even if its up, and wait till the cron timer if its down.

As this is a generic monitor, it can be used with any php website like wordpress, etc. where you wanted to restart the php-fpm.

The 7Z compressed file contains the binary for ubuntu/linux x64 machine along with a sample config .toml file and a upstart .conf file to auto start the

web site monitoring after every reboot. ***Source code is not included***. The .sh contains command on how to install the upstart service.

I also use elasticsearch, so the program will check whether the elasticsearch server is up or not. If its down, it will restart the search server also.

https://drive.google.com/file/d/1gnQV00CUBa3AiC3uEcZZPQ3ewQ3PXDVm/view?usp=sharing

Link to comment
Share on other sites

11 minutes ago, musicmaster said:

Thank you for sharing.

I had once a site that regularly went down too. For some reason each mysql user used a big block of memory and if there were too many everything broke down. I solved it by adding some swapdisk space on the server.

I also faced lot of mysql issue, finally I figured out the issue, it was due to large tables. Prestashop creates many large tables, I created a copy of them and truncated the original tables.

ps_connections
ps_guest
ps_connections_source
ps_statssearch
ps_pagenotfound
ps_cart 

truncating these tables helped me with lot of website hang issues. But recently I am facing issues with php-fpm hanging, so I wrote this utility to keep guarding the website against any DOS issue, by restarting the services, once they become unresponsive.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...