How to automatically monitor and power cycle a droplet when it's down?

Hi everyone,

I’ve been running into issues where my website becomes non-responsive or very slow to load. Currently I’m using an external uptime monitor to notify me when this happens and I manually go into the DO control panel to do a Power Cycle, which fixes the problem. I’m not sure WHY this keeps happening but this fix seems to be working fine. The script I’m running does not have any MySQL connections, it is purely based on PHP.

Looking over the graphs in the DO control panel I notice no significant changes in CPU, bandwidth or disk spikes. The most I’ve ever been at was around 45% CPU for a short period of time. I don’t know what’s causing it and the graphs seem to offer me no clues, since even those spikes don’t correlate well to the downtime.

The only solution I can think of is to run a cheap $5 droplet which would run a cron say every 30 seconds, to check for downtime, and then execute some PHP code to powercycle the droplet automatically. Problem is I have no idea how to do this! Could anyone provide some guidance?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @ashishmpatel20,

As it already has been suggested, I’ll recommend using Watchdong as well. It’s a great tool to help you with exactly what you are looking for and it’s pretty straight forward to install


In most Linux distributions you can install from the package manager. For example on Ubuntu/Debian-based systems:

apt-get install watchdog

To check more information about it, you can check HERE

Regards, KDSys

This comment has been deleted