You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a validator, basically all of memory is used up by kernel page cache trying to guess what we want to cache. By explicitly marking appendvec files as FADV_RANDOM, the kernel should stop trying to cache accounts for us. In the future, we should try to explicitly cache what we need.
maybe this could also use direct io instead? Vibes wise I think Appendvec would have a lot of randomly sized reads and is not a good candidate for direct io and instead using fadvise is a good middle ground. Let me know your thoughts -- I also don't think this is the only spot we can put a fadvise, I'm not familiar with the accountsdb architecture and maybe the ledger storage can also use some flags like FADV_DONTNEED.
EDIT: #9701
Looks like accountdb could use direct io if this PR goes through.
let bytes_read = read_into_buffer(file,self.len(), offset,unsafe{
) and in fact setting DIO option when opening append vec files would allow us to disable kernel caches. That might need adjustments in the way this data is cached by validator (maybe just cache sizing), but I think it's the direction we want to take.
I was planning to use #9701 only for scans first. We should incorporate io-uring on the serving path too, but I was waiting for removal of mmap access mode, so that API changes would be simpler (that will happen once 4.0 is cut soon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running a validator, basically all of memory is used up by kernel page cache trying to guess what we want to cache. By explicitly marking appendvec files as FADV_RANDOM, the kernel should stop trying to cache accounts for us. In the future, we should try to explicitly cache what we need.
Summary of Changes
Mark appendvec files as FADV_RANDOM.
https://www.man7.org/linux/man-pages/man2/posix_fadvise.2.html