Requests got stuck in ActiveRecord::QueryCache middleware

后端 未结 1 885
时光说笑
时光说笑 2021-02-09 04:15

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

相关标签:
1条回答
  • 2021-02-09 04:47

    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.

    0 讨论(0)
提交回复
热议问题