Forums

How to keep a Django webapp running

I have a Django webapp which takes about 30 seconds to start up when I go to the URL for the first time after the webapp is reloaded. After I've gone to it once it reloads quickly after that, but the next day when I go to the URL it takes 30 seconds again to reload. I assume it's slow because the app is being restarted after being idle for a while. How do I keep my webapp active so that it loads up quickly each time?

It's only the first hit that is slow, after that is normal. We restart servers from time to time.

How often are servers rebooted? It seems that if my site is idle a couple of hours it will take long the first time again. Is there anything I can do to get around so my site stays active?

When they get rebooted changes - it's not on a schedule. Your web app will be "paused" after 26 hours if it has not been used. There is no way to avoid the slow first hit after a server reboot but you can reduce the impact by making the startup of your web app as fast as possible.

Thanks. I'll see what I can do to improve the start-up time.