Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Search: add index shard concurrency to site config #58514

Merged
merged 4 commits into from
Nov 27, 2023

Conversation

jtibshirani
Copy link
Member

In sourcegraph/zoekt#702, we updated indexserver to parse symbols in parallel
by spawning a new ctags process per shard. By default, indexing uses all
available CPUs to create shards in parallel, so now it will create many more
processes than before.

As a safeguard, we're exposing a site config setting to reduce the indexing
concurrency. It's not intended to be set by users, but will let us experiment
and make sure the defaults are solid.

As part of this change, I bumped the Zoekt dependency:

sourcegraph/zoekt@0959170...5c51794

Relates to #58112

Test plan

New unit test, also existing coverage from proto round trip tests

@cla-bot cla-bot bot added the cla-signed label Nov 22, 2023
@jtibshirani jtibshirani marked this pull request as ready for review November 22, 2023 23:39
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Nov 22, 2023

Codenotify: Notifying subscribers in CODENOTIFY files for diff 03b86e3...d86085f.

Notify File(s)
@keegancsmith internal/search/backend/index_options.go
internal/search/backend/index_options_test.go

@jtibshirani jtibshirani requested a review from a team November 22, 2023 23:47
"description": "The number of threads each indexserver should use to index shards. If not set, indexserver will use the number of available CPUs. This is exposed as a safeguard and should usually not require being set.",
"type": "integer",
"group": "Search",
"examples": [["10"]]
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be

Suggested change
"examples": [["10"]]
"examples": [10]

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, fixed.

@jtibshirani jtibshirani merged commit 5a8bf40 into main Nov 27, 2023
20 checks passed
@jtibshirani jtibshirani deleted the jtibs/shard-concurrency branch November 27, 2023 03:14
vovakulikov pushed a commit that referenced this pull request Dec 12, 2023
In sourcegraph/zoekt#702, we updated indexserver to parse symbols in parallel
by spawning a new ctags process per shard. By default, indexing uses all
available CPUs to create shards in parallel, so now it will create many more
processes than before.

As a safeguard, we're exposing a site config setting to reduce the indexing
concurrency. It's not intended to be set by users, but will let us experiment
and make sure the defaults are solid.

As part of this change, I bumped the Zoekt dependency to pull in the change to
IndexOptions.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants