diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-09-20 12:36:23 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-09-20 12:36:23 +0200 |
commit | 93d0243d531e37e9d117b5900e9af1573b411840 (patch) | |
tree | 7d51f6c3efa8fd6eba13232f3ddcc14c1aaa4de1 /config | |
parent | 667d2350911b2c3cca0545897eb67fda4b7d4b80 (diff) | |
download | gitlab-ce-93d0243d531e37e9d117b5900e9af1573b411840.tar.gz |
Use a ConnectionPool for Rails.cache on Sidekiq servers22364-rails-cache-redis-connection-pool
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb index 4792f6670a8..8166b6003f6 100644 --- a/config/application.rb +++ b/config/application.rb @@ -116,6 +116,10 @@ module Gitlab redis_config_hash = Gitlab::Redis.params redis_config_hash[:namespace] = Gitlab::Redis::CACHE_NAMESPACE redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever + if Sidekiq.server? # threaded context + redis_config_hash[:pool_size] = Sidekiq.options[:concurrency] + 5 + redis_config_hash[:pool_timeout] = 1 + end config.cache_store = :redis_store, redis_config_hash config.active_record.raise_in_transactional_callbacks = true |