diff --git a/pkg/domain/domain.go b/pkg/domain/domain.go index e12d0c200617e..60e5cc444ac16 100644 --- a/pkg/domain/domain.go +++ b/pkg/domain/domain.go @@ -2407,6 +2407,7 @@ func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager) defer util.Recover(metrics.LabelDomain, "updateStatsWorker", nil, false) logutil.BgLogger().Info("updateStatsWorker started.") lease := do.statsLease + // We need to have different nodes trigger tasks at different times to avoid the herd effect. randDuration := time.Duration(rand.Int63n(int64(time.Minute))) deltaUpdateTicker := time.NewTicker(20*lease + randDuration) gcStatsTicker := time.NewTicker(100 * lease)