diff --git a/cmd/client-s3.go b/cmd/client-s3.go index c55d9a66..306c7b1b 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -21,13 +21,11 @@ import ( "crypto/tls" "hash/fnv" "io" - "log" "net" "net/http" "net/url" "os" "path" - "strconv" "strings" "sync" "time" @@ -65,20 +63,6 @@ var cseHeaders = []string{ "X-Amz-Meta-X-Amz-Matdesc", } -// getNumMultiPartThreads gets the number of multipart threads to be used for mc cp/mirror functions -// If not set, default to 4. -func getNumMultiPartThreads() uint { - multipartThreadStr := os.Getenv("MC_MULTIPART_THREADS") - if multipartThreadStr != "" { - numThreads, err := strconv.ParseUint(multipartThreadStr, 10, 32) - if err != nil { - log.Fatal("MC_MULTIPART_THREADS must be a positive integer.") - } - return uint(numThreads) - } - return defaultMultipartThreadsNum -} - // newFactory encloses New function with client cache. func newFactory() func(config *Config) (Client, *probe.Error) { clientCache := make(map[uint32]*minio.Client) @@ -592,11 +576,10 @@ func (c *s3Client) Put(ctx context.Context, reader io.Reader, size int64, metada if bucket == "" { return 0, probe.NewError(BucketNameEmpty{}) } - numParallelThreads := getNumMultiPartThreads() opts := minio.PutObjectOptions{ UserMetadata: metadata, Progress: progress, - NumThreads: numParallelThreads, + NumThreads: defaultMultipartThreadsNum, ContentType: contentType, } n, e := c.api.PutObjectWithContext(ctx, bucket, object, reader, size, opts) diff --git a/cmd/cp-main.go b/cmd/cp-main.go index 9fbf910e..75801cc4 100644 --- a/cmd/cp-main.go +++ b/cmd/cp-main.go @@ -66,8 +66,6 @@ USAGE: FLAGS: {{range .VisibleFlags}}{{.}} {{end}} -ENVIRONMENT VARIABLES: - MC_MULTIPART_THREADS: To set number of multipart threads. By default it is 4. EXAMPLES: 1. Copy a list of objects from local file system to Amazon S3 cloud storage. diff --git a/cmd/mirror-main.go b/cmd/mirror-main.go index 68fbbcfc..b2a58a66 100644 --- a/cmd/mirror-main.go +++ b/cmd/mirror-main.go @@ -89,8 +89,6 @@ USAGE: FLAGS: {{range .VisibleFlags}}{{.}} {{end}} -ENVIRONMENT VARIABLES: - MC_MULTIPART_THREADS: To set number of multipart threads. By default it is 4. EXAMPLES: 1. Mirror a bucket recursively from Minio cloud storage to a bucket on Amazon S3 cloud storage.