# Downtime notifier

**URL:** <https://www.ruby-forum.com/t/downtime-notifier/190820>\
**Category:** Rails\
**Created:** [June 28, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820 "2010-06-28T18:56:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariachi77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Post date:** [June 28, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820/1 "2010-06-28T18:56:45Z")

</div>

What methods do people use to notify users of upcoming downtime in an  
application, and for handling requests nicely while scheduled downtime  
is occurring? My Google-fu is not yielding me anything useful-looking.

---

<div class="post-metadata">

**Author:** ![mariachi77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Post date:** [June 28, 2010, 7:05pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820/2 "2010-06-28T19:05:33Z")

</div>

On 28 Jun 2010, at 18:55, Michael P. wrote:

> What methods do people use to notify users of upcoming downtime in an  
> application, and for handling requests nicely while scheduled downtime  
> is occurring? My Google-fu is not yielding me anything useful-looking.

Depends, the easiest way is to use capistrano:  
[http://www.google.be/search?q=capistrano+maintenance+page](http://www.google.be/search?q=capistrano+maintenance+page)

It will put a maintenance page in the public folder for the time that  
your app is offline.

There’s other ways to do it, like handling it in Apache itself if  
you’re using Mongrel cluster, like checking if the mongrels are up and  
if they’re not, serve a custom error page.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![mariachi77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Post date:** [June 28, 2010, 7:20pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820/3 "2010-06-28T19:20:46Z")

</div>

On 28 Jun 2010, at 19:03, Peter De Berdt wrote:

> There’s other ways to do it, like handling it in Apache itself if  
> you’re using Mongrel cluster, like checking if the mongrels are up  
> and if they’re not, serve a custom error page.

And concerning the notification, it’s all up to what you personally  
prefer tbh. One way to go about it is create a Downtime model and with  
a start and end time, put a before\_filter in application\_controller.rb  
that fetches all those \> Time.now, then show them by rendering a  
partial into every view if the number of records is higher than one.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![mariachi77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Post date:** [June 28, 2010, 8:13pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820/4 "2010-06-28T20:13:28Z")

</div>

On 28 June 2010 18:19, Peter De Berdt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> And concerning the notification, it’s all up to what you personally prefer  
> tbh. One way to go about it is create a Downtime model and with a start and  
> end time, put a before\_filter in application\_controller.rb that fetches all  
> those \> Time.now, then show them by rendering a partial into every view if  
> the number of records is higher than one.

I was contemplating methods of easily having a pop-up or banner to say  
“the site is going down in ten minutes”. That sounds like a nice  
reusable one.

---

<div class="post-metadata">

**Author:** ![mariachi77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@mariachi77](https://www.ruby-forum.com/u/mariachi77)\
**Post date:** [June 28, 2010, 7:47pm UTC](https://www.ruby-forum.com/t/downtime-notifier/190820/5 "2010-06-28T19:47:07Z")

</div>

On Mon, Jun 28, 2010 at 9:55 AM, Michael P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> What methods do people use to notify users of upcoming downtime in an  
> application,

We use comatose to manually post a very visible notice about any  
scheduled maintenance…

> and for handling requests nicely while scheduled downtime  
> is occurring?

… though we have 2 load-balanced servers, so generally we can get  
away with updating stuff invisibly 🙂

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
