···12351235 listen string
12361236 hostname string
12371237 cpuFraction float64
12381238- blockProfileRate int
1239123812401239 // config values related to shard merging
12411240 disableShardMerging bool
···12581257 fs.StringVar(&rc.listen, "listen", ":6072", "listen on this address.")
12591258 fs.StringVar(&rc.hostname, "hostname", zoekt.HostnameBestEffort(), "the name we advertise to Sourcegraph when asking for the list of repositories to index. Can also be set via the NODE_NAME environment variable.")
12601259 fs.Float64Var(&rc.cpuFraction, "cpu_fraction", 1.0, "use this fraction of the cores for indexing.")
12611261- fs.IntVar(&rc.blockProfileRate, "block_profile_rate", getEnvWithDefaultInt("BLOCK_PROFILE_RATE", -1), "Sampling rate of Go's block profiler in nanoseconds. Values <=0 disable the blocking profiler Var(default). A value of 1 includes every blocking event. See https://pkg.go.dev/runtime#SetBlockProfileRate")
12621260 fs.DurationVar(&rc.backoffDuration, "backoff_duration", getEnvWithDefaultDuration("BACKOFF_DURATION", 10*time.Minute), "for the given duration we backoff from enqueue operations for a repository that's failed its previous indexing attempt. Consecutive failures increase the duration of the delay linearly up to the maxBackoffDuration. A negative value disables indexing backoff.")
12631261 fs.DurationVar(&rc.maxBackoffDuration, "max_backoff_duration", getEnvWithDefaultDuration("MAX_BACKOFF_DURATION", 120*time.Minute), "the maximum duration to backoff from enqueueing a repo for indexing. A negative value disables indexing backoff.")
12641262···1368136613691367 // Tune GOMAXPROCS to match Linux container CPU quota.
13701368 _, _ = maxprocs.Set()
13711371-13721372- // Set the sampling rate of Go's block profiler: https://github.com/DataDog/go-profiler-notes/blob/main/guide/README.md#block-profiler.
13731373- // The block profiler is disabled by default and should be enabled with care in production
13741374- runtime.SetBlockProfileRate(conf.blockProfileRate)
1375136913761370 // Automatically prepend our own path at the front, to minimize
13771371 // required configuration.