This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
AccountsDb Async Fetching Service #17765
Labels
stale
[bot only] Added to stale content; results in auto-close after a week.
Problem
Currently, MMap access can trigger page fault. Typical usage is sequential
load_with_fixed_root
.Proposed Solution
The solution is an
AccountsDb
async worker pool that context switches to interleave page faults.The design is as follows:
AccountsDb
orAccounts
exposes some methods that rely on async workers instead of sequentially performing IO.TO DO: MORE DETAILS
Choices and Evidence
According to https://github.com/jimblandy/context-switch, a tokio context switch (similar to go green threads), is lower than kernel thread context switch/thread creation. (although apparently not for blocking IO 😢 )
An alternative is may, which implements something similar to coroutines: example use
While asking a threadpool to perform IO would actually increase the IO time in the non-page fauting case, this time is actually very small and doesn't add much to the critical path. But, it can drastically reduce the time waiting around for page faults, possible even on Optane-like low latency SSDs.
The text was updated successfully, but these errors were encountered: