Remediation Hub (9)
Cap SIDEKIQ_CONCURRENCY & Enforce Deterministic Queue Weights
Oversized SIDEKIQ_CONCURRENCY=25-50 multiplies ActiveRecord connection demand and Ruby heap fragmentation on single-VPS Chatwoot stacks.
Target: SIDEKIQ_CONCURRENCY=10..15 | DB Pool: >= concurrency + 5
Why Higher Sidekiq Concurrency Often Slows Chatwoot Down
Raising SIDEKIQ_CONCURRENCY to 30+ on a 2-4 vCPU VPS increases Ruby GVL thread thrashing, exhausts PostgreSQL connections, and spikes RSS without raising net throughput. Keeping concurrency between 10 and 15 per Sidekiq container delivers predictable latency.
Aligning RAILS_MAX_THREADS and sidekiq.yml Queue Order
Ensure RAILS_MAX_THREADS equals or exceeds SIDEKIQ_CONCURRENCY so Sidekiq threads never raise ActiveRecord::ConnectionTimeoutError waiting for a DB handle. Weight critical and high queues explicitly inside config/sidekiq.yml.
Measured Thresholds & Configuration
| Node Tier | SIDEKIQ_CONCURRENCY | RAILS_MAX_THREADS |
|---|---|---|
| Hostinger KVM 2 (8 GB) | 10 - 12 threads (1 pod) | 15 connections |
| Hostinger KVM 4 (16 GB) | 15 + 10 (2 split pods) | 20 connections |
| Vultr HF 16 GB | 20 + 10 (2 split pods) | 25 connections |