After deploying our Rails app (4.0.9, Ruby 2.1.2), we notice requests to our app get hang after a while , usually 1 day or so.
Using the gem rack_timer
, we
The most possible cause is your connection with the database died (firewall, server configuration...) and Rails didn't notice, so a timeout happens inside ActiveRecord::QueryCache
. Once Rails notices the connection died, it reconnects and the execution flow continues.
Try setting the param read_timeout
in your database.yml
file to something like 10 seconds and check your connection and server settings.