mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: increase concurrency of DeleteObjects() to N/10th (#15546)
instead of keeping the value 10 and static, make the concurrency a function of incoming number of objects being deleted.
This commit is contained in:
parent
67cf15d036
commit
bf38c0c0d1
@ -1046,8 +1046,16 @@ func (z *erasureServerPools) DeleteObjects(ctx context.Context, bucket string, o
|
||||
poolObjIdxMap := map[int][]ObjectToDelete{}
|
||||
origIndexMap := map[int][]int{}
|
||||
|
||||
// Always perform 1/10th of the number of objects per delete
|
||||
concurrent := len(objects) / 10
|
||||
if concurrent <= 10 {
|
||||
// if we cannot get 1/10th then choose the number of
|
||||
// objects as concurrent.
|
||||
concurrent = len(objects)
|
||||
}
|
||||
|
||||
var mu sync.Mutex
|
||||
eg := errgroup.WithNErrs(len(objects)).WithConcurrency(10)
|
||||
eg := errgroup.WithNErrs(len(objects)).WithConcurrency(concurrent)
|
||||
for j, obj := range objects {
|
||||
j := j
|
||||
obj := obj
|
||||
|
Loading…
Reference in New Issue
Block a user