Skip to content

Commit

Permalink
Raise VisibilityListMaxQPS limit for local docker-compose env
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Jun 1, 2021
1 parent 84059fb commit de3a6ac
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 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 Expand Up @@ -326,3 +339,4 @@ func (s *Service) Stop() {
s.Resource.Stop()
s.params.Logger.Info("frontend stopped")
}

0 comments on commit de3a6ac

Please sign in to comment.