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

index: enable shard merging by default #798

Merged
merged 2 commits into from
Aug 1, 2024
Merged

Conversation

stefanhengl
Copy link
Member

@stefanhengl stefanhengl commented Jul 31, 2024

Relates to SPLF-175

This enables shard merging by default for zoekt-sourcegraph-indexserver.

Sourcegraph has been using shard merging in production for several years. We have recently confirmed significant performance improvements for queries which are bound by matchTree construction.

I also remove -merge_max_priority because we have stopped using it.

Use SRC_DISABLE_SHARD_MERGING to disable shard merging.

Test plan:
mostly CI, I did some manual testing to confirm that shard merging is enabled by default for zoekt-sourcegraph-indexserver.

@cla-bot cla-bot bot added the cla-signed label Jul 31, 2024
@stefanhengl stefanhengl requested a review from keegancsmith July 31, 2024 15:44
@stefanhengl stefanhengl marked this pull request as ready for review July 31, 2024 15:44
Comment on lines 1241 to 1242
fs.Int64Var(&rc.targetSize, "merge_target_size", getEnvWithDefaultInt64("SRC_MERGE_TARGET_SIZE", 2000), "the target size of compound shards in MiB")
fs.Int64Var(&rc.minSize, "merge_min_size", getEnvWithDefaultInt64("SRC_MERGE_MIN_SIZE", 1800), "the minimum size of a compound shard in MiB")
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to change the defaults here since we may have lots of environments which only ever created much smaller shards so may have very low memory limits?

Copy link
Member Author

@stefanhengl stefanhengl Aug 1, 2024

Choose a reason for hiding this comment

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

We discussed this on Zoom. Sourcegraph Cloud instances have a minimum 4GB MEM for indexserver, so the current limits should be ok. Self-hosted customers should have at least a comparable configuration.

@stefanhengl stefanhengl merged commit 764fe4f into main Aug 1, 2024
9 checks passed
@stefanhengl stefanhengl deleted the sh/enable-shard-merging branch August 1, 2024 15:41
stefanhengl added a commit to sourcegraph/docs that referenced this pull request Aug 2, 2024
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.

2 participants