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.
…github.com/moby/moby into release/1.21.x+ent (hashicorp#13572) (hashicorp#13629) * [VAULT-43618] sdk: migrate from github.com/docker/docker to github.com/moby/moby (hashicorp#13549) (hashicorp#13573) Resolve GHSA-x744-4wpc-v9h2 and GHSA-pxq6-2prw-chj9 in `vault` by replacing `github.com/docker/docker` with `github.com/moby/moby/client` @ `v0.3.0` and `github.com/moby/moby/api` @ `v1.54.0`. This is necessary as `docker/docker` is no longer maintained and the fixes are not available in it. Resolve GO-2026-4518, GHSA-x6gf-mpr2-68h6 and GHSA-jqcq-xjh3-6g23 by upgrading to github.com/jackc/pgx/v5. This is necessary as v4 is not longer maitained. Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
... assuming the files fit in memory. This should improve startup times when freelist sync is disabled.