I find it difficult to understand exactly how concurrency works on Heroku and how to set the optimal value :concurrency
for Sidekiq
Here's the setting -
Puma Web Server
2 workers
5 threads
Heroku Dynos
8 web dynos
2 "worker" dynos (These will run Sidekiq, not to be confused with Puma Workers)
DB Connections
120 Max Connections Allowed by Postgres
5 Active Record Pool Size (default)
?? Sidekiq :concurrency value
Each Puma employee is allowed to use 5 ActiveRecord DB connections by default (which is good for each of the 5 threads). Because Web Dyno has two of these Puma employees, each Web Dyno consumes up to 10 connections. In all 8 web speakers they occupy 80 connections
120 - 80 = 40 , 2- , Sidekiq. , Sidekiq ( ?), Sidekiq 20 (.. :concurrency 20
)
!