Forums

Web2py on pythonanywhere : soooooo slowwww first time access

Hello All,

I'm testing pythonanywhere free plan with some web2py websites. Seems to work fine except one thing : After some idle hours, the first access to my website is horrifically slow. One page takes about 30 seconds to load, which is not acceptable for me (and my customers...)

Is this delay related only on free plans, or on paying plans too?

I found a thread dated june 2013 here : https://www.pythonanywhere.com/forums/topic/679/ It was mentionned "we'll discuss ways that we could maybe "pre-warm" the web apps of paying customers at some point in the future" What is the status of this issue? do you have a workaround? (something other than subscribing to another paying service to ping the app and keep it warm...)

Thank you very much!

You should only see this behaviour if you've reloaded. We don't unload a webapp unless it has been idle (not seen a single request) for 26 hours. So we are talking seriously low traffic websites.

When you reload your webapp then it does two things. The worker processes need to start up again. That might take 5 seconds. Then, after the workers receive the first request they load the application code into the Python interpreter. That can take awhile. Especially for full large frameworks like Web2py. Each worker needs to go through the loading process. So the first few hits can all be slow until the code has been loaded into each worker.

So if you are seeing this behaviour after a couple of hours something else is going wrong. Perhaps you have a bug in your code that is causing the workers to die frequently? That's the most likely explanation I can think of.