Commit 6c21435e authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '35559-puma-redis-pool-quick-fix' into 'master'

Grow Redis conn pool size with Puma thread count

Closes #35559

See merge request gitlab-org/gitlab!20210
parents 0796525b ec1e931e
......@@ -255,8 +255,8 @@ module Gitlab
caching_config_hash[:compress] = false
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
if Sidekiq.server? # threaded context
caching_config_hash[:pool_size] = Sidekiq.options[:concurrency] + 5
if Sidekiq.server? || defined?(::Puma) # threaded context
caching_config_hash[:pool_size] = Gitlab::Redis::Cache.pool_size
caching_config_hash[:pool_timeout] = 1
end
......
......@@ -25,6 +25,8 @@ module Gitlab
if Sidekiq.server?
# the pool will be used in a multi-threaded context
size += Sidekiq.options[:concurrency]
elsif defined?(::Puma)
size += Puma.cli_config.options[:max_threads]
end
size
......
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