I want to enable YJIT on a Rails project. I have moved the codebase to Ruby 3.2 and am trying to enable YJIT by setting the RUBY_YJIT_ENABLE
to 1
in a canary release receiving 50% of the traffic so that I can see the two side by side.
In the canary release, with the env var set, when I SSH into production I get:
~/app $ env | grep YJIT
RUBY_YJIT_ENABLE=1
~/app $ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) +YJIT [x86_64-linux-musl]
Unfortunately, I don't see the performance benefits that others are reporting. Below you can see two graphs, one for the memory usage and one the average request time for requests. In both graphs, blue is the canary release with YJIT enabled and yellow is the one with YJIT disabled (both are ruby 3.2).
That's why I wanted to ask if there is anything else that I need to do. Does the ruby -v
output mean that YJIT is enabled?
Is the rustc
a runtime dependency for YJIT to work? Because my current setup doesn't include it.