Road To Heroku #2105
Replies: 5 comments 16 replies
-
Thanks a lot for the detailed report. @bjfish can reproduce the gradual slowdown on macOS. For RSB with the Rack app, on Linux I did not observe such a slowdown.
I'm not sure it is more realistic, it probably ends up measuring a lot more how fast the kernel is at creating new connections when the application response time is really small like here.
That's simply something for the RSB harness. Running wrk for 150 seconds (for RSB I did it in batches of 10 seconds) before should have the same effect. |
Beta Was this translation helpful? Give feedback.
-
In the flamegraph, 11.8% of the total time across all threads is spent in |
Beta Was this translation helpful? Give feedback.
-
@ssnickolay Do you have some instructions on how you run |
Beta Was this translation helpful? Give feedback.
-
I did some TruffleRuby native testing locally (also 32GB ram) with some different memory/cexts-lock settings and this worked well for me:
I could also observe degraded performance over time and this combination of settings also alleviated this issue. |
Beta Was this translation helpful? Give feedback.
-
headius found an issue in monitor.rb related to interrupts, I wonder if it might be related. |
Beta Was this translation helpful? Give feedback.
-
I took this title of the discussion to show the end goal. However, I expect it will not be as easy as I would like.
The catalyst for the question is my attempt to run a tiny production Cuba application with TruffleRuby on Heroku. I did it, but the first load tests showed a significant difference in performance between CRuby and TruffleRuby, not in favor of TruffleRuby. Based on the speech from the last Kaigi, I expected another result.
Step by step, I simplified the application to find the reason for the slow performance, and this is what I have:
config.ru
is copy-past of https://github.com/eregon/rsb/blob/bench/rack_test_app/config.ruwrk
without keep-alive. This is more realisticThe results:
wrk
commands run one after the other within the test, without restarting the server!CRuby 2.6.6 (Test#0)
TruffleRuby (native)
I used the locally built version, but also tested with
asdf
(there is no difference):Test#1
Test#2
TruffleRuby (JVM)
The command:
Test#3
Test#4
Questions & Notes
Test#1
I added twowrk
launches, but I did more (3-4), and the results of 2+ are pretty much the same (so this is not a warmup issue)../runners/current_ruby_cli.rb --warmup-seconds 150 --benchmark-seconds 120 --no-wrk-close-connection --wrk-concurrency 1 --wrk-connections 1 --server-ruby-opts '--experimental-options --cexts-lock=false --engine.CompilerThreads=-1 --engine.SplittingGrowthLimit=10.0 --engine.SplittingMaxNumberOfSplitNodes=200000000' rails puma
, so used it with native (viaTRUFFLERUBYOPT="..."
)that still not so fast as CRuby (but almost the same)
3. How to pass
--warmup-seconds 150
to puma server?4. Perhaps the most important question: if you take a look at
Test#2
andTest#4
you'll see that on a huge load server begins to degrade. Perhaps this is not related to the load itself but is related to the number of requests, and with lowwrk
settings (-c5
), it takes longer to reproduce. Ultimately, the server stops accepting any requests and gets stuck. It fails to turn off with signals (Cntrl+C
) and have to kill the process:I reproduced this many times, and it does not depend on the TruffleRuby version (available on native or JVM).
5. I prepared the flamegraph of execution with the native version. Unfortunately, I cannot make a flame graph when the server "sticks" because the report is not returned. https://drive.google.com/file/d/1tDpOF2p4H_7DRM_q1sq4UHcCrLcif8Vu/view?usp=sharing
6.
This error is shown when starting a puma in a cluster mode on 1) Heroku 2) in docker with Debian 3) locally on the MacOS X. Is it right?
Beta Was this translation helpful? Give feedback.
All reactions