Skip to content

seg: read-ahead implemented as own mmap area + madvise_ (only concept, no erigon changes)#19397

Merged
AskAlexSharov merged 15 commits intomainfrom
alex/manual_read_ahead_o_34
Feb 24, 2026
Merged

seg: read-ahead implemented as own mmap area + madvise_ (only concept, no erigon changes)#19397
AskAlexSharov merged 15 commits intomainfrom
alex/manual_read_ahead_o_34

Conversation

@AskAlexSharov
Copy link
Copy Markdown
Collaborator

@AskAlexSharov AskAlexSharov commented Feb 22, 2026

Context: merge is slow becuse it reading large files mmap'ed by MADV_RANDOM.

Idea: It's possible to have 1 file-descriptor with N VMA (Virtual Memory Area). In another word: mmap many time same file.

Means each mmap can have own MADVISE_* hints:

  • all existing RPC requrests and ChainTip will go to existing mmap area (MADV_RANDOM).
  • merge will go to new temporary mmap area (MADV_NORMAL). existing RPC will not hit it.

overall 3gb file on raid of 4 nvme: 15s -> 3.7s. But impact impact on exec perf need to test. Also usually files are warm-enough to make speedup of merge less than "read cold file in wacuum".
Will see. Also accessor build likely will benefit from same thing.

@AskAlexSharov AskAlexSharov mentioned this pull request Feb 24, 2026
16 tasks
@AskAlexSharov AskAlexSharov changed the title [wip] merge: read-ahead based on - own mmap region seg: read-ahead implemented as own mmap area + madvise_ (only concept, no erigon changes) Feb 24, 2026
@AskAlexSharov AskAlexSharov enabled auto-merge (squash) February 24, 2026 03:15
@AskAlexSharov AskAlexSharov merged commit 71ef069 into main Feb 24, 2026
25 checks passed
@AskAlexSharov AskAlexSharov deleted the alex/manual_read_ahead_o_34 branch February 24, 2026 04:25
sudeepdino008 pushed a commit that referenced this pull request Mar 4, 2026
…cept, no erigon changes) (#19397)

Context: merge is slow becuse it reading large files `mmap'ed` by
`MADV_RANDOM`.

Idea: It's possible to have 1 `file-descriptor` with N `VMA` (Virtual
Memory Area). In another word: `mmap` many time same file.

Means each `mmap` can have own `MADVISE_*` hints: 
- all existing RPC requrests and ChainTip will go to existing `mmap`
area (MADV_RANDOM).
- merge will go to new temporary `mmap` area (MADV_NORMAL). existing RPC
will not hit it.

overall 3gb file on raid of 4 nvme: `15s -> 3.7s`. But impact impact on
exec perf need to test. Also usually files are warm-enough to make
speedup of `merge` less than "read cold file in wacuum".
Will see. Also `accessor build` likely will benefit from same thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants