Skip to content

Commit

Permalink
Remove block profile rate config (#818)
Browse files Browse the repository at this point in the history
Tiny clean-up, as we rarely use Datadog profiling (and I've never heard of us setting this env var).
  • Loading branch information
jtibshirani authored Sep 10, 2024
1 parent ac3c943 commit 44eab0c
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions cmd/zoekt-sourcegraph-indexserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,6 @@ type rootConfig struct {
listen string
hostname string
cpuFraction float64
blockProfileRate int

// config values related to shard merging
disableShardMerging bool
Expand All @@ -1258,7 +1257,6 @@ func (rc *rootConfig) registerRootFlags(fs *flag.FlagSet) {
fs.StringVar(&rc.listen, "listen", ":6072", "listen on this address.")
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.")
fs.Float64Var(&rc.cpuFraction, "cpu_fraction", 1.0, "use this fraction of the cores for indexing.")
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")
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.")
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.")

Expand Down Expand Up @@ -1369,10 +1367,6 @@ func newServer(conf rootConfig) (*Server, error) {
// Tune GOMAXPROCS to match Linux container CPU quota.
_, _ = maxprocs.Set()

// Set the sampling rate of Go's block profiler: https://github.com/DataDog/go-profiler-notes/blob/main/guide/README.md#block-profiler.
// The block profiler is disabled by default and should be enabled with care in production
runtime.SetBlockProfileRate(conf.blockProfileRate)

// Automatically prepend our own path at the front, to minimize
// required configuration.
if l, err := os.Readlink("/proc/self/exe"); err == nil {
Expand Down

0 comments on commit 44eab0c

Please sign in to comment.