Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] UploadObject 是串行上传的吗? #21454

Open
66545shiwo opened this issue Oct 24, 2024 · 1 comment
Open

[BUG] UploadObject 是串行上传的吗? #21454

66545shiwo opened this issue Oct 24, 2024 · 1 comment
Assignees
Labels

Comments

@66545shiwo
Copy link

问题描述/What happened:
glance存储设定为MinIO,发现镜像上传至MinIO存储十分缓慢,查看源码:
source/cloudpods/vendor/yunion.io/x/cloudmux/pkg/cloudprovider/objectstore.go UploadObject方法:

	for i := 0; i < int(partCount); i += 1 {
		if i == int(partCount)-1 {
			partSize = sizeBytes - partSize*(partCount-1)
		}
		if debug {
			log.Debugf("UploadPart %d %d", i+1, partSize)
		}
		etag, err := bucket.UploadPart(ctx, key, uploadId, i+1, io.LimitReader(input, partSize), partSize, offset, sizeBytes)
		if err != nil {
			err2 := bucket.AbortMultipartUpload(ctx, key, uploadId)
			if err2 != nil {
				log.Errorf("bucket.AbortMultipartUpload error %s", err2)
			}
			return errors.Wrap(err, "bucket.UploadPart")
		}
		offset += partSize
		etags[i] = etag
	}

这里是分片上传是串行执行的吗? 是否有方法可以分片并发上传?

环境/Environment:
3.10.14

  • OS (e.g. cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Host: (e.g. dmidecode | egrep -i 'manufacturer|product' |sort -u)
  • Service Version (e.g. kubectl exec -n onecloud $(kubectl get pods -n onecloud | grep climc | awk '{print $1}') -- climc version-list):
@66545shiwo 66545shiwo added the bug Something isn't working label Oct 24, 2024
@wanyaoqi
Copy link
Member

@ioito 这里是否能加个并发度的参数

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants