4FreeForumsFree forum softwareStart a forum

Scaling Puma Web Workers and Sidekiq Queues for Mastodon Hubs

By 4FreeForums Editors · Published October 28, 2026 · Sources linked below

Scaling Mastodon Concurrency: Puma, Sidekiq, and PgBouncer Guide

Running a decentralized social community requires balancing incoming web requests, high-throughput background processing, and real-time feeds. When traffic spikes across the Fediverse, administrators must properly allocate system resources across three core process types: web handling, streaming connections, and background tasks. You can evaluate how these requirements match other platforms in our Forum Software Server Requirements Compared guide, or explore community moderation essentials in our Mastodon Moderation Tools: An At-a-Glance Profile. The following checklist details the exact configuration variables, background queue structures, and database connection limits documented in the Scaling up your server - Mastodon documentation.

1. Puma Web Worker and Thread Allocation Checklist

The web layer uses Puma to process short-lived HTTP requests for the application. Tuning this layer requires balancing memory allocation against processor capacity:

2. Sidekiq Concurrency and Database Pool Checklist

Background processing offloads asynchronous tasks to ensure user-facing HTTP responses remain quick and to keep request aborts from interrupting essential jobs. As documented in the Scaling up your server - Mastodon documentation, Sidekiq concurrency requires specific command-line arguments and matching database pools:

3. Sidekiq Queue Priority and Routing Checklist

Sidekiq manages tasks through prioritized queues defined by how severely an unworked queue degrades local member experience. Sidekiq processes jobs sequentially: it evaluates tasks in the first queue, and only if it finds none does it check the subsequent queue. You can isolate queues by passing arguments like bundle exec sidekiq -q default. The queues rank in descending importance:

  1. default: Processes all tasks that directly affect local users.
  2. push: Handles delivery of activity payloads out to external servers.
  3. ingress: Manages incoming remote activities. It has lower priority than default so local users still see their posts when the instance is under load.
  4. mailers: Manages the delivery of notification emails.
  5. pull: Carries lower-priority administrative tasks, such as imports, backups, resolving remote threads, user deletions, and reply forwarding.
  6. scheduler: Executes periodic cron tasks, including refreshing trending hashtags and clearing log files. This queue must never run in more than one Sidekiq process at a time.
  7. fasp: Manages interactions with external servers providing FASP services.

4. Streaming API Multi-Process Checklist

The streaming API server handles persistent HTTP and WebSocket connections so clients receive real-time notifications and timeline updates:

5. PgBouncer Connection Pooling Setup Checklist

Because the total count of open PostgreSQL connections generally equals the combined thread count across Puma, Sidekiq, and the streaming API, larger servers can easily exceed the default PostgreSQL limit of 100 connections:

6. Redis Partitioning and Caching Checklist

Redis maintains home feeds, list feeds, background Sidekiq queues, and streaming subscriptions. While Postgres data must never be lost, high-traffic hubs can separate volatile caches to protect primary memory queues:

Sources

Published October 28, 2026. No affiliate links on this page. Facts come from the sources linked above; check them for updates.