Merge pull request #5620 from swordqiu/automated-cherry-pick-of-#5616-upstream-release-3.1

Automated cherry pick of #5616: fix: increase apigateway default worker count to 32
This commit is contained in:
Zexi Li
2020-03-30 19:22:44 +08:00
committed by GitHub
4 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ type GatewayOptions struct {
SqlitePath string `help:"sqlite db path" default:"/etc/yunion/data/yunionapi.db"`
common_options.CommonOptions
common_options.CommonOptions `"request_worker_count->default":"32"`
}
var (
+4
View File
@@ -44,6 +44,10 @@ func StartService() {
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, options.OnOptionsChange)
if commonOpts.RequestWorkerCount < 32 {
commonOpts.RequestWorkerCount = 32
}
if opts.DisableModuleApiVersion {
mcclient.DisableApiVersionByModule()
}
+1
View File
@@ -28,6 +28,7 @@ import (
func InitApp(options *common_options.BaseOptions, dbAccess bool) *appsrv.Application {
// cache := appsrv.NewCache(options.AuthTokenCacheSize)
log.Infof("RequestWorkerCount: %d", options.RequestWorkerCount)
app := appsrv.NewApplication(options.ApplicationID, options.RequestWorkerCount, dbAccess)
app.CORSAllowHosts(options.CorsHosts)
+1 -1
View File
@@ -58,7 +58,7 @@ type BaseOptions struct {
TempPath string `help:"Path for store temp file, at least 40G space" default:"/opt/yunion/tmp"`
ApplicationID string `help:"Application ID"`
RequestWorkerCount int `default:"4" help:"Request worker thread count, default is 4"`
RequestWorkerCount int `default:"8" help:"Request worker thread count, default is 8"`
EnableSsl bool `help:"Enable https"`
SslCaCerts string `help:"ssl certificate ca root file, separating ca and cert file is not encouraged" alias:"ca-file"`