How do you handle scheduled downtime?

2 views
Skip to first unread message

soniiic

unread,
Jun 14, 2009, 1:32:25 PM6/14/09
to Django users
Hello,

I've been wondering how django devs handle scheduled downtime? Do you
use a different urls.py to always redirect someone to a 'service
unavailable' page?

Or is there something fancy that you do?

Thanks,

Jason Emerick

unread,
Jun 14, 2009, 2:05:36 PM6/14/09
to django...@googlegroups.com
My setup is nginx which proxies back to apache+mod_wsgi.

Whenever there is downtime, I just change my nginx config for the site to point to a static file which is a maintenance page instead of the normal config which proxies the requests to apache that way I can completely take down apache or do whatever I need to.

Jason Emerick

The information transmitted (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is intended only for the person(s) or entity/entities to which it is addressed and may contain confidential and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited.  If you received this in error, please contact the sender and delete the material from any computer.

Miles

unread,
Jun 14, 2009, 7:24:43 PM6/14/09
to Django users
We have a default virtual host configured to show a maintenance page,
so when we disable the django virtual host, everything gets direct
there.

Graham Dumpleton

unread,
Jun 14, 2009, 8:13:22 PM6/14/09
to Django users
If using Apache/mod_wsgi and its daemon mode, just swap out the WSGI
script file with another which has a really basic raw WSGI application
which provides appropriate error response with explanation. The act of
replacing the WSGI script will cause the mod_wsgi daemon processes to
reload, thus unloading your Django application, and replacing it with
the simple WSGI application.

Be aware that you should not return normal 200 status responses, you
should use an appropriate error response, perhaps:

HTTP_SERVICE_UNAVAILABLE = 503

to ensure that nothing caches your outage page.

Graham
Reply all
Reply to author
Forward
0 new messages