Forums

Lots of spontaneous, temporary 504s past few days?

Hi guys, has anyone else been experiencing instability on their server since 3 days ago?

Every like 2-3h hours, my users will not be able to connect with the server for 10-15min and receive a 504 instead. I havent made any changes to my webserver in a while, it just started happening all of sudden and seems to occur at random. To add on to that, even when it is working, it seems to be extremely slow since 3 days ago as well.

Is this something I can troubleshoot on my side? Could someone help me check this out? Appreciate any advice

We're not seeing any system issues right now, and I don't think we've heard of any issues from other people.

Are you using SQLite, by any chance? Often when a site that was behaving well suddenly starts slowing down it's because it's using SQLite, which works really well up until the database gets beyond a certain size (which varies, I think due to the structure of the data) or if the number of concurrent accesses increases. If you are using SQLite, moving to MySQL should fix the issue.

Other than that, we have a help page with useful hints and tips on debugging website performance problems.

Hi, thanks for geting back to me.

It has been 7 hours now since the issue last occurred, so fingers crossed it has somehow resolved itself. I did initially suspect my sqlite db size becoming an issue too, so I cleared out a bunch of old entries and reduced it back to a fraction of its size (20mb). It did unfortunately not fix the issue, so I dont think that was a problem.

Going to keep monitoring it for now.

If this starts again, provide us with some more detailed information, if possible, so we could try to investigate (you can also reach us at support@pythonanywhere.com).

It started happening again. After some trial and error I figured out that it indeed seems like sqlite was the problem. However, it doesnt seem to be directly related to the filesize. It was ~100MB big when the issues started happening, I cleaned it down to ~20MB and the issues continued. Even deleting it down to 300KB did not fix the issue. Creating a fresh database and copying the critical data over manually seems to have fixed it.

So I guess something must have happened to the sqlite database that caused it throw a fit.

That's weird. Do you see anything matching the errors you saw in the web app logs?