-
Notifications
You must be signed in to change notification settings - Fork 632
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
Use jemalloc in rocksdb #7456
Use jemalloc in rocksdb #7456
Conversation
This should be enabled only if we enable jemalloc feature on neard |
Isn't it already using it? https://github.com/near/nearcore/blob/master/neard/Cargo.toml#L28 |
Do we understand the performance impact of this change? |
Nope, not yet. Do we have some standard set of tests that we can use? |
That's what I did last time: |
I mean this feature https://github.com/near/nearcore/blob/master/neard/Cargo.toml#L47 should enable jemalloc for RocksDB. |
@akhi3030 another approach came up recently here: #7494 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I am inclined to merge this without blocking on up-front benchmark:
- the status quo is that we don't know which allocator rocksdb is useing, 'cause it links the one dynamically from the computer neard is running on
- any significant perf degradation should be visible in our continous estimation
- we won't immediately notice change in memory usage, but I think it unlikely to worsen, and we can always revert if we observe something iffy on the betanet.
Makes sense. I'll merge. |
I still think this isn’t correct. We have a cargo feature in neard/Cargo.toml to enable jemalloc. IMO RocksDB jemalloc should be conditionally enabled if that feature is enabled. |
Can you point me to the relevant bit of code please? |
https://github.com/near/nearcore/blob/master/neard/Cargo.toml#L47 PS. An alternative is to get rid of the feature and always use jemalloc I suppose. Have we actually ever performed any benchmarks to see if jemalloc is faster for us? |
Ah, good catch, thanks mina86! Yeah, I think we should just enable jemalloc by default: it's not even the question of "faster", without jemalloc we don't know which allocator we are using. I don't remeber us performing benchmark for nearcore, but, eg, for rust-analyzer and rust-lang, we did observe jemalloc being measurably faster, and, in ra, we did spend some cycles chasing down issue which boiled down to "the user's allocator is not good". |
We’re using jemalloc in Rust code so it makes sense to do the same in RocksDB. Fixes: #6290
We’re using jemalloc in Rust code so it makes sense to do the same in
RocksDB.
Fixes: #6290