本文介绍了很慢:ActiveRecord :: QueryCache#调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 工作人员2 
线程计数3
在heroku上运行的应用程序pool 5

它看起来像是一些请求被卡在中间件中,并且使应用程序非常慢非常!)。
我已经看到其他人讨论这个问题,但目前还没有解决方案。



如果您有任何提示,请告诉我。







解决方案

我会回答我自己的问题:
我只需要检查所有查询到我的数据库。其中一个人花了很长时间,即使没有经常请求,也会在整个服务器上放慢一段时间(甚至在完成过程之后,还有一些塞车服务器)。
解决方案:
检查所有对数据库的查询,修复最慢的查询(它可能仅仅意味着在几步之内将其分解,这可能意味着在没有流量等情况下在晚上运行)。 ..)。
一旦这些查询得到解决,所有事情都应该恢复正常。


I have an app on heroku, running on Puma:

workers 2
threads_count 3
pool 5

It looks like some requests get stuck in the middleware, and it makes the app very slow (VERY!).I have seen other people threads about this problem but no solution so far.

Please let me know if you have any hint.

!

!

解决方案

I will answer my own question:I simply had to check all queries to my DB. One of them was taking a VERY long time, and even if it was not requested often, it would slow down the whole server for quite some time afterwards(even after the process was done, there was a sort of "traffic jam" on the server).Solution:Check all the queries to your database, fix the slowest ones (it might simply mean breaking it down in few steps, it might mean make it run at night when there is no traffic, etc...). Once this queries are fixed, everything should go back to normal.

这篇关于很慢:ActiveRecord :: QueryCache#调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 13:59