Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise VisibilityListMaxQPS limit for local docker-compose env #4238

Merged
merged 2 commits into from
Jun 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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