mysql - Server hangs all requests after a while -
Our Rail 4.0 4.0 application (Ruby 2.1.2) is running on NGNX with Pum 2.9.0.
I have recently seen that all requests for our application hang up after a while (usually 1 or 2 days)
while examining logs, which are This means that the requests have actually been hit on the rail app but in some way it is not going to increase further, it will usually be: My Puma config is as follows: What is the reason that can cause this problem? (Puma config, database connection, etc.) Thank you in advance. UPDATE: After installing Mani rack_timer to log the time spent on each middleware, I realized that our request is stuck on ActiveRecord :: QueryCache when it is hanging, too much Over time: I have removed this middleware by now and It's coming back when it's normal. However, I think the purpose of this middleware is to increase the performance, so deleting it is a temporary solution. Please help me find out the possible cause of this problem. FYI, we are using mysql (5.1.67) with the adapter mysql2 (0.3.13) The query cache is getting very big, so it can be a sign of starvation of Rama. We have seen this in one of our apps that run on Heroki. The default query cache is set to 1000. To reduce the limit, there is no noticeable performance drop for us, with the ease of use of RAM: However searching for "slow down active cache query cache" returns to other reasons, such as the old version of Ruby or Puma or rack-timeout: or maybe too large Value for Read_timeout: Debug is set to mode, I saw the following log stack:
[2014-10-11T00: 02: 31.727382 # 23458] Info -: for "/" start It has been done ...
Formula 16, 32 Worker 4 P> Our application is only for internal use, so the RPM is very low, and no request takes more than 2s.
Rack Timer (incoming) - ActiveRecord :: Query Cache: 925626.7731189728 MS
database.yml:
default: and default adapter: Postgrescill Pool: & lt;% = ENV ["DB_POOL"] || ENV ['MAX_THREADS'] || || 5% & gt; Timeout: 5000 Port: 5432 Host: Localhost Statement_limit: & lt;% = ENV ["DB_STATEMENT_LIMIT"] || 200% & gt;
Comments
Post a Comment