-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MAP_POPULATE for our bbolt mmaps #13573
Conversation
…y. This should improve startup times when freelist sync is disabled.
I have only tested this to the extent of verifying via strace that MAP_POPULATE is used on linux. |
@ncabatoff Is it worth adding an env var to this to allow users to explicitly opt out of |
Good thinking, I'll add that. |
# Conflicts: # physical/raft/bolt_32bit_test.go # physical/raft/bolt_64bit_test.go
Added the suggested env var override. Did some more serious testing on a Linux machine: besides just looking at strace to see that the option is used/not used based on env var, I actually gave it a 300MB vault.db that had seen lots of activity and had a big freelist. With MAP_POPULATE, it took 2-6s to open the DB; without, 12-47s. The machine was doing nothing else, I have no idea why it was so variable, but I did many runs, dropping caches in between. To test the memory check, I used |
* Use MAP_POPULATE for our bbolt mmaps, assuming the files fit in memory. This should improve startup times when freelist sync is disabled.
* Use MAP_POPULATE for our bbolt mmaps, assuming the files fit in memory. This should improve startup times when freelist sync is disabled.
... assuming the files fit in memory. This should improve startup times when freelist sync is disabled.