This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
use huge pages via mmap() instead of hugetlbfs #9577
Merged
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.
Change Description
Previously, huge page usage in nodeos required specifying hugetlbfs mount points via the
database-hugepage-path
option. To make huge page usage easier to use, as it can be quite a performance boost, this PR completely removes thedatabase-hugepage-path
option and tries to allocate huge pages directly via mmap() whendatabase-map-mode
is eitherheap
orlocked
. This is easier for operators as there is no need to fuss with hugetlbfs which is doubly a headache inside a container.The general logic when operating on Linux with the
database-map-mode
set to eitherheap
orlocked
is now,When running on macOS there is a new attempt to use 2MB pages. This is new functionality. However, in my testing, the chance of successfully using 2MB pages is exceedingly slim for any database size nodeos is likely to use.
It’s important to note there are some additional subtle differences in behavior now:
locked
mode required to use huge pages, bothheap
andlocked
will attempt to use huge pagesreversible-blocks-db-size-mb=340
, and there is a 1GB page available for use, the database will still be placed in a 1GB page despite the DB only being 340MB. This is different behavior than before which required the DB size to be a multiple of the huge page size to even attempt huge page usage.Example
Say you have nodeos configured with a chain DB of 16GB, and a reversible DB of 340MB, i.e.
To have these databases placed in 1GB pages at runtime, reserve 17 1GB pages:
and start nodeos with
database-map-mode=heap
(orlocked
). There will be a message at start up such asindicating that 1GB pages are in use.
Be aware that reserving large numbers of 1GB pages post-boot is increasingly unlikely the longer the platform is running. You would likely want to reserve these pages very quickly (right after boot) or even modify the kernel command line (via GRUB, UEFI, etc) to reserve them automatically ASAP.
Needs EOSIO/chainbase#69
Change Type
Select ONE
Consensus Changes
API Changes
Documentation Additions