1

I have a Craft installation on DigitalOcean, with the smallest package:

512MB Memory
1 Core Processor
20GB SSD Disk
1TB Transfer

I installed the default LAMP droplet.

PROBLEM: MySQL crashes from time to time. There were no significant server load either.

What might be a root cause?

Bonus question:

Is there a plugin that automatically reports when the site is down?

enter image description here

  • Question is still open, when Craft crashes gracefully, I would assume it to fire a hook event. Note that crash can mean a faulty MySQL connection too, but for the visitors it doesn't matter. – Tibor Szasz Aug 13 '16 at 10:39
3

There's no plugin for that... it wouldn't quite make sense. If the site went down, the plugin would be down too.

Your best bet is to find a 3rd party service to monitor the site's uptime. There are several services which will alert (via text or email) if your site becomes unavailable. Here are a few examples...

  • Ahh, that makes sense :) Uptime robot monitoring is already installed for that site and I haven't reveived an alert. Maybe server is not serving 500 code? I haven't tested it, because of putting off fire. – Tibor Szasz Aug 13 '16 at 2:44
  • FWIW Constellix Sonar can also be useful because it'll capture traceroutes from its nodes that report issues. Also free for some undefined amount of time. – Matt Stein Aug 13 '16 at 3:09
  • Thanks, I already use some similar solution on another project. Is there an onError hook for craft? If it can display a nice maintenance page, I'm sure it can send and error report before :) – Tibor Szasz Aug 13 '16 at 3:24
  • @TiborSzasz No onError hook. Craft has some internal logic to serve {errorCode}.html templates for internal exceptions, but if your database burns down and someone hacks into your server and uninstalls Apache obviously that stuff goes out the window. Like Lindsey says, use a third party service to monitor uptime, and possibly a third party service like Rollbar to monitor exceptions. – Mats Mikkel Rummelhoff Aug 13 '16 at 19:07
  • 2
    @MatsMikkelRummelhoff Craft doesn't explicitly define an onError event because Yii already provides one (yiiframework.com/doc/api/1.1/CApplication#onError-detail) as well as onException (yiiframework.com/doc/api/1.1/CApplication#onException-detail) – Brad Bell Aug 14 '16 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.