1.

Why Do I Sometimes Get 500 Internal Errors After My App Has Been Idle?

Answer»

Are you using a MySQL DATABASE? 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.

Are you using a MySQL database? 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.



Discussion

No Comment Found