Skip to content

Commit

Permalink
Raise VisibilityListMaxQP limit for local docker-compose env
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Jun 1, 2021
1 parent 84059fb commit d6b5108
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion service/frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
package frontend

import (
"os"
"strings"
"sync/atomic"
"time"

Expand Down Expand Up @@ -111,7 +113,7 @@ func NewConfig(dc *dynamicconfig.Collection, numHistoryShards int, enableReadFro
VisibilityMaxPageSize: dc.GetIntPropertyFilteredByDomain(dynamicconfig.FrontendVisibilityMaxPageSize, 1000),
EnableVisibilitySampling: dc.GetBoolProperty(dynamicconfig.EnableVisibilitySampling, true),
EnableReadFromClosedExecutionV2: dc.GetBoolProperty(dynamicconfig.EnableReadFromClosedExecutionV2, false),
VisibilityListMaxQPS: dc.GetIntPropertyFilteredByDomain(dynamicconfig.FrontendVisibilityListMaxQPS, 10),
VisibilityListMaxQPS: dc.GetIntPropertyFilteredByDomain(dynamicconfig.FrontendVisibilityListMaxQPS, defaultVisibilityListMaxQPS()),
ESVisibilityListMaxQPS: dc.GetIntPropertyFilteredByDomain(dynamicconfig.FrontendESVisibilityListMaxQPS, 30),
EnableReadVisibilityFromES: dc.GetBoolPropertyFilteredByDomain(dynamicconfig.EnableReadVisibilityFromES, enableReadFromES),
ESIndexMaxResultWindow: dc.GetIntProperty(dynamicconfig.FrontendESIndexMaxResultWindow, 10000),
Expand Down Expand Up @@ -157,6 +159,17 @@ func NewConfig(dc *dynamicconfig.Collection, numHistoryShards int, enableReadFro
}
}

// TODO remove this and return 10 always, after cadence-web improve the List requests with backoff retry
// https://github.com/uber/cadence-web/issues/337
func defaultVisibilityListMaxQPS() int {
cmd := strings.Join(os.Args, " ")
// NOTE: this is safe because only dev box should start cadence in a single box with 4 services, and only docker should use `--env docker`
if strings.Contains(cmd, "--root /etc/cadence --env docker start --services=history,matching,frontend,worker") {
return 10000
}
return 10
}

// Service represents the cadence-frontend service
type Service struct {
resource.Resource
Expand Down

0 comments on commit d6b5108

Please sign in to comment.