-
Notifications
You must be signed in to change notification settings - Fork 730
nix: change default GC for cardano-node #6222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
As far as resource usage goes, we found that:
|
This table illustrates the shorter average duration and greatly reduced frequency of GC pauses of parallel ( |
Do you have any advice regarding performance when using the non-moving GC? |
What we've observed at least in a benchmarking setting (i.e. network under saturation for an extended period of time) is that the non-moving GC led to higher resource usage overall; CPU moderately, and RAM footprint significantly. That bought you higher responsiveness, but unfortunately not much advantage as far as block production metrics are concerned. So internally, optimizing for the use of the non-moving GC hasn't been a priority. Hence, my advice:
|
I had been experimenting with the nonmoving-gc on a low performance ARM machine I use as a backup over the past couple of years. I did try various rts settings a couple of years ago but found that the only way I could have that machine not miss slot leadership checks in BP mode with previous cardano-node versions was by using the nonmoving-gc. The "stop the world" garbage collector caused too much delay resulting in missed slot checks when it ran no matter what other rts settings I tested. I had been compiling the cardano-node using various different versions of ghc 9.x. over that time but most recently I was able to compile cardano-node version 10.3.1 with ghc 9.12.2. This is what
cardano-node version 10.3.1 compiled with ghc 9.12.2 using rts settings |
Another question I have relates to your choice of setting Can you provide some guidance about whether |
Your case is a great example of optimizing against an environment-specific bottleneck: Increased responsiveness was obviously worth the higher RAM requirements. As to As to |
For the number of cores used: However, there's a ton of things to consider:
So the value we use here has shown to cater to the widest array of environments, and across different node roles (block producer, relay, full node wallet), given the system specs that we recommend in the release notes. Thanks for bearing with me, I hope that brought some clarity. Even though the whole RTS tuning seems pretty complicated, you have to give it to Haskell that the same build can adapt pretty much to any environment - whereas in other languages, many performance characteristics can only be adapted by actually changing the implementation. |
Thank you for your time, considered thoughts, and all the work you are doing. I am totally amazed at how robust cardano-node is and how you are able to rewrite Haskell functional code to be more optimised. 🥇 |
Description
This PR changes the default garbage collector (GC) settings for the
cardano-node
nix service config (SVC).Sequential GC is replaced by parallel, load-balanced GC for all but the youngest generation.
Changing the default compiler to GHC9.6 prompted scrutinizing GC settings, as the ones most beneficial on GHC8.10 can't be assumed to automatically be the best pick for GHC9.6. The change in this PR showed slight improvement in network performance, and solid reduction of GC pauses in our benchmarks (see below).
Please note that these settings are not imposed to operate a
cardano-node
- however, they're recommended for efficiency of block producers.-I0
, which is strongly advised to minimize GC pauses).rtsArgs
to replace all default RTS arguments with custom settings, andrts_flags_override
to override individual arguments fromrtsArgs
.Checklist
hlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-9.6
andghc-9.12