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

Mv write sizing #132

Merged
merged 3 commits into from
May 8, 2014
Merged

Mv write sizing #132

merged 3 commits into from
May 8, 2014

Conversation

matthewvon
Copy link
Contributor

All types of memory mapped files previously shared the same mapping size of 20Mbytes. This is wasteful for many files, especially the smaller files created by Riak's AAE feature. The waste is in two forms. First the full 20Mbytes is always reserved by leveldb's flexcache. This could lead to 2.5Gbytes of available memory being set aside unnecessarily for a node with 64 databases/vnodes/partitions. The second waste is in physical writes to disk. The entire 20Mbyte mapping is written to disk, then the file is resized smaller. Again, this is a heavy burden for small files.


if (NULL!=options)
{
// large buffers, try for a little bit bigger than half hoping
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is the same as in db/builder.cc. Can it be abstracted to it's own function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AARGH! I missed this location. I thought there were 3 places that needed to call the function. You have found the 4th. Bad Matthew. Bad Bad Matthew. Yes I will substitute the call. Thank you for spotting this.

I did a copy/paste of the same code to multiple locations for proof of concept. Missed this one on the clean-up.

@andrewjstone
Copy link
Contributor

Besides my comment above, code looks good. Tests pass.

@andrewjstone
Copy link
Contributor

👍

matthewvon pushed a commit that referenced this pull request May 8, 2014
@matthewvon matthewvon merged commit c54ff5a into develop May 8, 2014
@matthewvon matthewvon mentioned this pull request May 8, 2014
@matthewvon matthewvon deleted the mv-write-sizing branch May 5, 2016 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants