mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
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:
@@ -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 (
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user