Why does my application work fine until its idle for a while then the next request returns a “500 Internal Error” response?
Are you on mysql? If so, this is probably the mysql time out. Because cherrypy is a long running process it doesn’t make a new connection on every page load. After a period of inactivity the mysql server will timeout the connection. This causes an error the next time the application attempts to use the connection. One solution some people use is to set up a cron job that every so often wgets a page from the application that will cause a database query. There is also apparently a mysql wait_timeout setting that can be adjusted to stop the connection from timing out.
Related Questions
- Why does my application work fine until its idle for a while then the next request returns a "500 Internal Error" response?
- What happens if someone other than a Freshmen applicant request a fee waiver on the ApplyTexas application?
- Is there a limit to how much Administrative Costs the training provider can request on the application?