Rails Out of Memory Fix: Phusion Passenger Tuning
Stop the Linux OOM Killer from crashing your servers. A guide to Rails out of memory fixes via Phusion Passenger tuning and worker process limits.
Cluster
Deep engineering on memory allocators (jemalloc), Ruby GC tuning, N+1 elimination, connection pooling, asset pipeline bloat, and OOM prevention in Passenger/Puma workers.
Stop the Linux OOM Killer from crashing your servers. A guide to Rails out of memory fixes via Phusion Passenger tuning and worker process limits.
Solve ActiveRecord::ConnectionTimeoutError. Learn how to configure PgBouncer for legacy Rails connection pooling using transaction mode.
Prevent OOM crashes on CI/CD. Learn how to debug and fix Rails asset pipeline memory bloat during rake assets:precompile.
Optimize your legacy Ruby performance. Learn how to tune garbage collection using RUBY_GC_HEAP_INIT_SLOTS and other ENV variables.
Stop Sidekiq memory bloat. Learn how to fix perceived memory leaks in legacy Ruby apps by replacing glibc malloc with jemalloc.
Proof-of-concept for replacing glibc malloc with jemalloc in legacy Rails Sidekiq workers. Reduce Resident Set Size (RSS) by up to 50% without altering application code.
Stop database timeouts. Learn how to identify and fix Rails N+1 queries using eager loading and the Bullet gem in legacy applications.