Merge branch '22364-rails-cache-connection-pool-sidekiq-servers' into 'master'

Use a ConnectionPool for Rails.cache on Sidekiq servers

## What does this MR do?

On Sidekiq server we'll use a connection pool to connect to the redis store used for Rails cache. But now we're sure we're not modifying the configuration used on the lazy create Redis connection inside the connection pools. I've create a PR on [redis-activesupport](https://github.com/pacoguzman/redis-activesupport) too. @jacobvosmaer-gitlab make this easier updating the Gitlab::Redis class !6472

Closes #22364

See merge request !6468
This commit is contained in:
Rémy Coutable 2016-09-29 12:12:01 +00:00
commit ce0591df70
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ v 8.13.0 (unreleased)
- Avoid database queries on Banzai::ReferenceParser::BaseParser for nodes without references
- Fix permission for setting an issue's due date
- 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
- Revoke button in Applications Settings underlines on hover.
- Update ruby-prof to 0.16.2. !6026 (Elan Ruusamäe)

View File

@ -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