Jemalloc
Memory allocation is key to performance, and jemalloc is an alternative malloc implementation. Enabling it is a matter of adding the following to your Dockerfile:YJIT
A “Just In Time” compiler can make your application run faster. Starting with Ruby 3.1, YJIT has been included in the official Ruby release sources. Using it requires a build time option and enabling at runtime. The official Ruby docker images for 3.2.0 and later, as well as Fullstaq Ruby, support YJIT and enabling it can be done with an environment variable:Enabling swap
While RAM is always faster, not everything that is loaded into RAM needs equal treatment. Enabling swap can allow less frequently used regions of memory to be moved out to disk (which these days is SSD). Seeswap_size_mb for configuring
for deploys.