We’re running several Discourse sites with multisite under a single app. Recently, we did a batch of large user imports (hundreds of thousands of users across 6 sites). After the imports, Sidekiq is processing background jobs very slowly. The Sidekiq dashboard shows a huge backlog, and jobs are clearing at a much slower rate than expected.
Environment details:
- The VM was upgraded to 16 CPUs / 16GB RAM.
- However, in the Sidekiq interface, we only see 5 threads and it seems like only a small portion of the resources are being used.
- The main import queue (“nursingjobs” as multisite parent) is handling jobs for all the child sites, but job throughput is very low.
- Server metrics: CPU sometimes at 80–90%, memory at around 6.7/7.2GB.
We’re looking to:
- Speed up Sidekiq/background job processing to clear large backlogs post-import.
- Ensure Discourse is making use of all the available resources (CPU/RAM).
- Understand if there are thread/process limits that need adjustment.
Questions:
- What’s the best way to configure Sidekiq/Discourse for high-throughput post-import?
- What are the recommended settings for UNICORN_SIDEKIQS and DISCOURSE_SIDEKIQ_WORKERS on large multi-core systems?
- Are there Postgres or other app.yml settings we should tweak to avoid DB pool errors when raising Sidekiq concurrency?
- Any best practices for clearing huge Sidekiq backlogs quickly and safely after imports?
Sidekiq stats/screenshots available if helpful!