fix(glance): image stream worker count (#21538)

This commit is contained in:
屈轩
2024-11-07 09:48:31 +08:00
committed by GitHub
parent 0b791de55f
commit cb409c75b8
3 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ func init() {
}
ImageManager.SetVirtualObject(ImageManager)
imgStreamingWorkerMan = appsrv.NewWorkerManager("image_streaming_worker", 10, 1024, true)
}
func InitImageStreamWorkers() {
imgStreamingWorkerMan = appsrv.NewWorkerManager("image_streaming_worker", options.Options.ImageStreamWorkerCount, 1024, true)
}
/*
+2
View File
@@ -51,6 +51,8 @@ type SImageOptions struct {
S3BucketName string `help:"s3 bucket name" default:"onecloud-images"`
S3MountPoint string `help:"s3fs mount point" default:"/opt/cloud/workspace/data/glance/s3images"`
S3CheckImageStatus bool `help:"Enable s3 check image status"`
ImageStreamWorkerCount int `help:"Image stream worker count" default:"10"`
}
var (
+2
View File
@@ -68,6 +68,8 @@ func StartService() {
common_options.StartOptionManager(opts, opts.ConfigSyncPeriodSeconds, api.SERVICE_TYPE, api.SERVICE_VERSION, options.OnOptionsChange)
models.InitImageStreamWorkers()
if opts.PortV2 > 0 {
log.Infof("Port V2 %d is specified, use v2 port", opts.PortV2)
opts.Port = opts.PortV2