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

Add madvise() after mmap(). #383

Merged
merged 1 commit into from
Jun 3, 2015
Merged

Conversation

benbjohnson
Copy link
Member

Overview

This pull request advises the memory-mapped data file to use MADV_RANDOM to avoid readahead. This can provide a performance boost to Bolt databases that are larger than memory by avoiding unnecessary disk I/O.

This commit advises the mmapped data file to use MADV_RANDOM to avoid
readahead. This can provide a performance boost to Bolt databases that
are larger than memory by avoiding unnecessary disk i/o.
@xiang90
Copy link
Contributor

xiang90 commented Jun 2, 2015

performance boost

Have you got a benchmark?

@benbjohnson
Copy link
Member Author

I don't have specific benchmark details that I can show but in production our disk latency went down by 80% and the number of pages being paged in & out dropped by about 90%.

benbjohnson added a commit that referenced this pull request Jun 3, 2015
Add madvise() after mmap().
@benbjohnson benbjohnson merged commit 8f42da0 into boltdb:master Jun 3, 2015
@benbjohnson benbjohnson deleted the madvise branch June 3, 2015 13:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants