Rails Connection Pool Exhaustion: Fixing ActiveRecord::ConnectionTimeoutError
ActiveRecord::
Deep dives on Rails reliability: background jobs, Postgres concurrency and AI-powered backends, each grounded in systems I build and ship.
ActiveRecord::
Why Postgres kills one transaction on a deadlock, how to read the 40P01 log, the lock-ordering rule that prevents it, and the SQL to diagnose it live.
Why read-modify-write leaks race conditions in Rails, how SELECT FOR UPDATE blocks, and when to use advisory locks — with real production code.
Solid Queue vs Sidekiq isn't a throughput threshold — it's about where your complexity lives and whether your database can absorb the queue. A decision framework.
Slow job? It either waited in the queue or ran slowly. Measure which with Sidekiq::
Solid Queue runs jobs on Postgres, not Redis. How the dispatcher, SKIP LOCKED claims, and polling actually work under the hood — and the trade-offs.
Sidekiq's default retry count, the backoff formula, and when to stop. Set retry intervals right — and skip jobs that can never succeed.
Sidekiq runs jobs at least once, so duplicates happen. The 5 windows where a job re-runs — and how to stop double-charges with idempotent workers.
An LLM call behind a Sidekiq job runs at least once. Make workers idempotent so a retry never double-classifies — or double-bills your OpenAI calls.