Commit 263c7f0b authored by Paco Guzman's avatar Paco Guzman

Use a ConnectionPool for Rails.cache on Sidekiq servers

It’s important to remember that connections on ConnectionPool are created 
when needed so if modify the objects later to create those connections weird 
things could happen

https://gitlab.com/gitlab-com/infrastructure/issues/464#note_15850653
parent f4ded8a8
...@@ -6,6 +6,7 @@ v 8.13.0 (unreleased) ...@@ -6,6 +6,7 @@ v 8.13.0 (unreleased)
- Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller) - Log LDAP lookup errors and don't swallow unrelated exceptions. !6103 (Markus Koller)
- Add more tests for calendar contribution (ClemMakesApps) - Add more tests for calendar contribution (ClemMakesApps)
- Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison) - Fix robots.txt disallowing access to groups starting with "s" (Matt Harrison)
- Use a ConnectionPool for Rails.cache on Sidekiq servers
- Only update issuable labels if they have been changed - Only update issuable labels if they have been changed
- Revoke button in Applications Settings underlines on hover. - Revoke button in Applications Settings underlines on hover.
- Update ruby-prof to 0.16.2. !6026 (Elan Ruusamäe) - Update ruby-prof to 0.16.2. !6026 (Elan Ruusamäe)
......
...@@ -116,6 +116,10 @@ module Gitlab ...@@ -116,6 +116,10 @@ module Gitlab
redis_config_hash = Gitlab::Redis.params redis_config_hash = Gitlab::Redis.params
redis_config_hash[:namespace] = Gitlab::Redis::CACHE_NAMESPACE redis_config_hash[:namespace] = Gitlab::Redis::CACHE_NAMESPACE
redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever 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.cache_store = :redis_store, redis_config_hash
config.active_record.raise_in_transactional_callbacks = true config.active_record.raise_in_transactional_callbacks = true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment