Scale PostgreSQL and background jobs in your Rails app: query plans, indexes, queues, and pools, from the team behind TestProf.
Step one
Most of this work starts with a Rails performance audit. In 2 to 3 weeks, it ranks your endpoints, jobs, and queries by the time and money they cost, and the database and background jobs plan comes out of it.
The Evil Martians method
First, we measure, with flamegraphs, allocation tracking, and query analysis. Partitioning, a fair prioritization scheme, and circuit breakers are some of the tools we often reach for. When Rails is the wrong tool for one hot path, we reach for Go, C, or Rust for that path and leave the rest alone.
Growing faster than your infrastructure?
Fair prioritization for multi-tenant Sidekiq queues, from our sidekiq-fair_tenant gem. A tenant that floods the queue slows down only itself.
class HeavyJob
include Sidekiq::Job
sidekiq_options \
queue: 'default',
fair_tenant_queues: [
{ threshold: 100, per: 1.day, queue: 'default_throttled' },
{ threshold: 40, per: 1.hour, queue: 'default_superslow' },
]
end
Our work speaks for itself
Gusto
Gusto runs payroll, benefits, and HR for more than 500,000 businesses, on one of the largest Rails monoliths anywhere, and crossed $1B in annual revenue in May 2026. Evil Martians worked on the infrastructure behind their background jobs: around 170 million Sidekiq jobs a day, peaking near 270 million, on about a thousand workers and a single Redis. From February to July 2026, Andrey Novikov embedded in their platform team to upgrade Sidekiq, turn on strict arguments, and fix bugs upstream in the libraries Gusto depends on.
In a time of rapid change and acceleration, it was amazing to see Andrey able to step in and create value so quickly.
Phillip Campbell
Senior Engineering Manager, Gusto
Whop
Whop serves millions of users and needed off PostgreSQL without a maintenance window. We moved 750GB of production data to PlanetScale with zero downtime, running dual databases through the cutover and reconciling the schema dialects as we went. We also cut their Rails test suite and CI time in half, twice.
Playbook
For Playbook, we partitioned a PostgreSQL table of about 140 GB and close to 60 million records while the app served over 800,000 users. A feature freeze wasn’t possible, so we used organizations as canaries, moving a few to the partitioned table first, and finished with zero downtime.
More teams we scaled
- bolt.new: our partnership runs since 2021. We built the performance infrastructure that carried it from zero to $40M+ ARR in five months.
- eBaymag: an events table taking over 30 million events a week had grown to 300 million records, and queries slowed down. We partitioned it by week and attached the old table as the first partition behind a
NOT VALIDcheck constraint, which skips the full data check that would cost downtime. Experiments with Ruby builds there also cut Ruby’s RAM usage by 2-3 times. - Coveralls: a customer on a small tier with a large, active codebase could back up the job queue for everyone else. We moved jobs over a threshold into slower weighted Sidekiq queues, tracked with a Redis sliding window, and complaints about processing delays disappeared. We released the fix as sidekiq-fair_tenant.
- Tines: 100x performance improvements in the target areas of their security automation platform.
- Doximity: Go-powered real-time features inside their Rails app.
- Wallarm: optimized the Go event-processing pipeline behind their high-throughput security data.
- NATS: made their Ruby SDK 3x faster.
- Steel: backend services built inside their TypeScript monorepo.