Skip to content
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

More intelligent mmapping by storage_allocator #81

Open
ujvl opened this issue Feb 20, 2018 · 2 comments
Open

More intelligent mmapping by storage_allocator #81

ujvl opened this issue Feb 20, 2018 · 2 comments

Comments

@ujvl
Copy link
Collaborator

ujvl commented Feb 20, 2018

On Linux machines the vm.max_map_count limit is hit very quickly (default on an ec2 c4.8xlarge instance is 65536). This needs to be manually increased for archival to be successful (since reflogs have relatively small buckets and each bucket is memory mapped).

Instead the storage_allocator could potentially memory map larger-than-requested chunks of files and store the excess of the available range for future calls. It would also have to map at a different granularity depending on what's being mmapped (data log vs reflog buckets). This could be done by just looking at the size passed to the mmap call.

@anuragkh
Copy link
Contributor

I think we'd discussed this before --- if we keep a single file per reflog, then we can remap whenever we archive a new block to keep contiguous memory locations for all reflog blocks. That way, we perform a single mmap per reflog, and reap benefits of contiguous memory.

This seems cleaner than mmapping larger than requested file-chunks to me.

@ujvl
Copy link
Collaborator Author

ujvl commented Feb 20, 2018

You could do remapping, but then you need to redesign swappable_ptr to support more than a single swap, which I found hard to do when I tried to initially. There was more memory overhead for each pointer and I don't even think I covered all the possible race conditions. At first look it seems a lot harder to get that right than pushing the complexity to the allocator, but I'm not totally sure, would need to spend more time on it.

@anuragkh anuragkh removed the bug label May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants