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

[ADDED] FileStore: read ahead capability #875

Merged
merged 2 commits into from
Jul 9, 2019
Merged

Conversation

kozlovic
Copy link
Member

@kozlovic kozlovic commented Jul 4, 2019

A new option file_read_buffer_size is added and defaults to 2MB.
If not set to 0, when a message is read from disk, the store will
actually read the following messages, up to that buffer size, and
add them to the internal cache (which already existed and has a
default TTL of 1sec).
This will speed up lookups of following messages since they are
likely to be in the cache.

Signed-off-by: Ivan Kozlovic ivan@synadia.com

A new option `file_read_buffer_size` is added and defaults to 2MB.
If not set to 0, when a message is read from disk, the store will
actually read the following messages, up to that buffer size, and
add them to the internal cache (which already existed and has a
default TTL of 1sec).
This will speed up lookups of following messages since they are
likely to be in the cache.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@coveralls
Copy link

coveralls commented Jul 4, 2019

Coverage Status

Coverage decreased (-0.05%) to 91.963% when pulling 6eaeb57 on filestore_optimizations into 89fe794 on master.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

A few comments, thank you for this, good stuff.

server/conf.go Outdated Show resolved Hide resolved
stores/filestore.go Outdated Show resolved Hide resolved
stores/filestore.go Outdated Show resolved Hide resolved
stores/filestore.go Outdated Show resolved Hide resolved
stores/filestore.go Outdated Show resolved Hide resolved
stores/filestore.go Outdated Show resolved Hide resolved
Still reading the indexes from file, but in a single I/O operation.
Tried to have indexes in memory to avoid that read and did not see
a dramatic advantage (at least in a simple test). Will revisit
that later.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@kozlovic kozlovic merged commit 502d27d into master Jul 9, 2019
@kozlovic kozlovic deleted the filestore_optimizations branch July 9, 2019 18:21
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.

3 participants