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

Optimize shard index loading #6618

Merged
merged 1 commit into from
May 13, 2016
Merged

Optimize shard index loading #6618

merged 1 commit into from
May 13, 2016

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented May 12, 2016

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

On data sets with many series, large series keys and many shards,
the cost of parsing the key and re-indexing can be high.

Loading the TSM keys into the index was being done repeatedly for
series that were already loaded into the index by an earlier TSM file. This was
wasted worked and slows down shard loading.

Parsing the key was also innefficient and allocated a new string
slice. This was simplified to remove that allocation.

I tested this on a dataset with two databases containing 155 and 85 shards each with ~300k series keys in each DB and keys ~250bytes in length.

0.13.0 (old/new)

5:32 -> 0:32

master (old/new)

4:25 -> 0.33

master cache flushed (old/new)

5:09 -> 1:42

This should help #6250 in some cases although there may still be other bottlenecks that this data set does not bring out.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @e-dard to be a potential reviewer

On data sets with many series and potentially large series keys,
the cost of parsing the key and re-indexing can be high.

Loading the TSM keys into the index was being done repeatedly for
series that were already index by an earlier TSM file.  This was
wasted worked and slows down shard loading.

Parsing the key was also innefficient and allocated a new string
slice.  This was simplified to remove that allocation.
@corylanou
Copy link
Contributor

+1

@jwilder jwilder merged commit 1187195 into master May 13, 2016
@jwilder jwilder deleted the jw-shard-load branch May 13, 2016 20:16
@timhallinflux timhallinflux modified the milestones: 1.0.0, 1.0.0 beta Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants