Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

How is filesize handled (compared to LMDB)? #266

Closed
bmatsuo opened this issue Nov 28, 2014 · 1 comment
Closed

How is filesize handled (compared to LMDB)? #266

bmatsuo opened this issue Nov 28, 2014 · 1 comment

Comments

@bmatsuo
Copy link

bmatsuo commented Nov 28, 2014

I couldn't find docs on how bolt handles map/file size and how resizing is handled.

LMDB lets processes limit the (maximum) size with mdb_set_mapsize. Is there an equivalent mechanism in bolt?

@benbjohnson
Copy link
Member

@bmatsuo The mmap size is automatically handled by the Bolt library. It starts out small (4MB) and will double as the database grows until it reaches 1GB. After it reaches 1GB then it'll remap the mmap every time the database grows by 1GB. Part of the reason for the design was that one of the applications using Bolt potentially had a lot of smaller sharded Bolt files. There wasn't a good way to predict which one would be large or small and setting a large mmap size caused the application to go over the Linux per-process virtual space limit.

I added a new comparison section to the README and made a note about the automatic handling of mmap size in the LMDB section.

Here's the relevant commit: 746cadc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants