Skip to content

Commit

Permalink
Disable history scanner by default and tune the default RPS
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Nov 6, 2020
1 parent 94ecc07 commit 59d8af5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions service/worker/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ const (
type (
// Config defines the configuration for scanner
Config struct {
// PersistenceMaxQPS the max rate of calls to persistence
PersistenceMaxQPS dynamicconfig.IntPropertyFn
// ScannerPersistenceMaxQPS the max rate of calls to persistence
// Right now is being used by historyScanner to determine the rate of persistence API calls
ScannerPersistenceMaxQPS dynamicconfig.IntPropertyFn
// Persistence contains the persistence configuration
Persistence *config.Persistence
// ClusterMetadata contains the metadata for this cluster
Expand Down
2 changes: 1 addition & 1 deletion service/worker/scanner/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func HistoryScavengerActivity(
) (history.ScavengerHeartbeatDetails, error) {

ctx := activityCtx.Value(scannerContextKey).(scannerContext)
rps := ctx.cfg.PersistenceMaxQPS()
rps := ctx.cfg.ScannerPersistenceMaxQPS()

hbd := history.ScavengerHeartbeatDetails{}
if activity.HasHeartbeatDetails(activityCtx) {
Expand Down
10 changes: 5 additions & 5 deletions service/worker/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ func NewConfig(params *service.BootstrapParams) *Config {
TimeLimitPerArchivalIteration: dc.GetDurationProperty(dynamicconfig.WorkerTimeLimitPerArchivalIteration, archiver.MaxArchivalIterationTimeout()),
},
ScannerCfg: &scanner.Config{
PersistenceMaxQPS: dc.GetIntProperty(dynamicconfig.ScannerPersistenceMaxQPS, 100),
Persistence: &params.PersistenceConfig,
ClusterMetadata: params.ClusterMetadata,
TaskListScannerEnabled: dc.GetBoolProperty(dynamicconfig.TaskListScannerEnabled, true),
HistoryScannerEnabled: dc.GetBoolProperty(dynamicconfig.HistoryScannerEnabled, true),
ScannerPersistenceMaxQPS: dc.GetIntProperty(dynamicconfig.ScannerPersistenceMaxQPS, 5),
Persistence: &params.PersistenceConfig,
ClusterMetadata: params.ClusterMetadata,
TaskListScannerEnabled: dc.GetBoolProperty(dynamicconfig.TaskListScannerEnabled, true),
HistoryScannerEnabled: dc.GetBoolProperty(dynamicconfig.HistoryScannerEnabled, false),
ConcreteExecutionScannerConfig: &executions.ScannerWorkflowDynamicConfig{
Enabled: dc.GetBoolProperty(dynamicconfig.ConcreteExecutionsScannerEnabled, false),
Concurrency: dc.GetIntProperty(dynamicconfig.ConcreteExecutionsScannerConcurrency, 25),
Expand Down

0 comments on commit 59d8af5

Please sign in to comment.