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

Feature/log hints #23

Merged
merged 4 commits into from
Feb 12, 2014
Merged

Feature/log hints #23

merged 4 commits into from
Feb 12, 2014

Conversation

andrewjstone
Copy link
Owner

Keep track of pointers(hints) to some hot entries in order to minimize disk seeks and data reads. Use a cache eviction policy of removing every tenth hint so we can somewhat uniformly and minimally increase disk seeks with usage in order to maintain a fixed size cache. In other words, when we reach a maximum number of hints we delete 10% of them.

Fixes #22

This is the beginning of code that will reduce the amount of searching
needed to find a given index with rafter_log:get_entry. It will keep a
dictionary of previously seen index locations in the logfile and use
that as a cache for rafter_log:find_entry calls that search the log. As
it is very expensive to store pointers to all indexes, this hint
strategy will attempt to be smart and only store a subset of frequently
needed pointers.

Basic stastics are kept to keep track of how efficient the
implementation is.

It is anticipated in the future that search will find the "closest" hint
and not just need an exact cache hit. This should greatly reduce seeks
as well.

It is also possible in the future that hints will be persisted to their
individual log section files.
@andrewjstone
Copy link
Owner Author

@curiousleo Will you please pull this branch and confirm that this fixes your performance issues? I will then close #22 and merge this PR.

@curiousleo
Copy link
Contributor

@andrewjstone Sure, I'll do that later today! Looks like an awesome improvement!

@curiousleo
Copy link
Contributor

Yes, those changes do seem to fix the performance issues I experienced. Great!

@andrewjstone
Copy link
Owner Author

Sweet! Tracking this issue down was fun. Performance is fun. Thanks for the
kick in the seat to get things moving again :) Hopefully many more
perf/code enhancements coming soon.

On Wed, Feb 12, 2014 at 9:51 AM, Leonhard Markert
notifications@github.comwrote:

Yes, those changes do seem to fix the performance issues I experienced.
Great!

Reply to this email directly or view it on GitHubhttps://github.com//pull/23#issuecomment-34875577
.

andrewjstone added a commit that referenced this pull request Feb 12, 2014
@andrewjstone andrewjstone merged commit fe43733 into master Feb 12, 2014
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.

CPU at 100% and linear slowdown
2 participants