https://whimsical.co/SJK9Qzo733f6jkw1Tfk4dT
- サーバーインスタンス(dyno)、ワーカーインスタンス(dyno)はそれぞれ1つずつ
- Sidekiqジョブは毎回DB接続を要求する
- puma threads <= db pool size
- puma threads <= sidekiq client connection pool size
- sidekiq concurrency <= db pool size
- sidekiq concurrency + 5 <= sizekiq server connection pool size
- puma workers * sizekiq client connection pool size + sidkiq server connection pool size <= redis max clients
- puma workers * (db pool size + 1) <= rdb max connections
- 上記は、puma threads * puma workersの同時リクエスト数を捌くための必要条件
- 実際には、Bad connectionsなどがあるので、ある程度余裕を持たせる必要がある
- モニタリングシステムやCLIなどもコネクションを消費するので、それらも考慮する必要がある