azure: Use default upload parameters to avoid consuming too much memory (#11251)

A lot of memory is consumed when uploading small files in parallel, use
the default upload parameters and add MINIO_AZURE_UPLOAD_CONCURRENCY for
users to tweak.
This commit is contained in:
Anis Elleuch
2021-01-12 07:48:09 +01:00
committed by GitHub
parent 7824e19d20
commit e2579b1f5a
3 changed files with 40 additions and 84 deletions

11
pkg/env/env.go vendored
View File

@@ -18,6 +18,7 @@
package env
import (
"strconv"
"strings"
"sync"
)
@@ -75,6 +76,16 @@ func Get(key, defaultValue string) string {
return defaultValue
}
// GetInt returns an integer if found in the environment
// and returns the default value otherwise.
func GetInt(key string, defaultValue int) (int, error) {
v := Get(key, "")
if v == "" {
return defaultValue, nil
}
return strconv.Atoi(v)
}
// List all envs with a given prefix.
func List(prefix string) (envs []string) {
for _, env := range Environ() {