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
{{ message }}
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
When reading large files, memory mapped files give much better I/O
performance. They benefit from OS virtual memory manager and avoid the copies
of data between kernel space buffer to user space buffer. Full Snapshot
achieve files are around 80G and incremental snapshot archives are around 10G.
Both of them should easily fit into the memory on the machine. Also, these
files are read sequentially during the uncompress and untar, which will
benefit greatly from the disk prefetch. By using memory map files for the
snapshot archives, we can achieve much better read performance for unpacking
the snapshot files during the start of the validator.
Proposed Solution
Use memmap2 crate to map the snapshot file to memory and read its content from
the memory map. memmap2 is the equivalent of boost::memory_mapped_file in C++.
The text was updated successfully, but these errors were encountered:
It turns out that using memory map only shows improvement for "uncompressed" snapshot files. For compressed snapshot files, memory map doesn't gain any meaningful improvement.
memory map maybe helps on the 8% of the non page fault decompress. but it is not significant.
This run is from gce cluster. It looks like that the CPU only support avx1, 256bit. With a better cpu, that supports avx2, 512bit, we may see the improvement from the 23% copying time.
Problem
When reading large files, memory mapped files give much better I/O
performance. They benefit from OS virtual memory manager and avoid the copies
of data between kernel space buffer to user space buffer. Full Snapshot
achieve files are around 80G and incremental snapshot archives are around 10G.
Both of them should easily fit into the memory on the machine. Also, these
files are read sequentially during the uncompress and untar, which will
benefit greatly from the disk prefetch. By using memory map files for the
snapshot archives, we can achieve much better read performance for unpacking
the snapshot files during the start of the validator.
Proposed Solution
Use memmap2 crate to map the snapshot file to memory and read its content from
the memory map. memmap2 is the equivalent of boost::memory_mapped_file in C++.
The text was updated successfully, but these errors were encountered: