-
Notifications
You must be signed in to change notification settings - Fork 985
[Storage] Change default parallelism to CPU-based value #26880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cc53525
43cd16f
f35f22e
0ac9073
6256896
236bfd8
18eb0ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,7 +273,8 @@ type uploadFromReaderOptions struct { | |
| CPKInfo *blob.CPKInfo | ||
| CPKScopeInfo *blob.CPKScopeInfo | ||
|
|
||
| // Concurrency indicates the maximum number of blocks to upload in parallel (0=default) | ||
| // Concurrency indicates the maximum number of blocks to upload in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
|
|
||
| TransactionalValidation blob.TransferValidationType | ||
|
|
@@ -334,7 +335,8 @@ type UploadStreamOptions struct { | |
| BlockSize int64 | ||
|
|
||
| // Concurrency defines the max number of concurrent uploads to be performed to upload the file. | ||
| // Each concurrent upload will create a buffer of size BlockSize. The default value is one. | ||
| // Each concurrent upload will create a buffer of size BlockSize. The default is based on | ||
| // CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency int | ||
|
Comment on lines
+338
to
340
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check if data validation tests are already there for all the affected upload and download methods. |
||
|
|
||
| TransactionalValidation blob.TransferValidationType | ||
|
|
@@ -350,7 +352,7 @@ type UploadStreamOptions struct { | |
|
|
||
| func (u *UploadStreamOptions) setDefaults() { | ||
| if u.Concurrency == 0 { | ||
| u.Concurrency = 1 | ||
| u.Concurrency = int(shared.DefaultConcurrencyValue()) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method returns 5 if |
||
| } | ||
|
|
||
| if u.BlockSize < _1MiB { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,8 @@ type uploadFromReaderOptions struct { | |
| // Progress is a function that is invoked periodically as bytes are sent to the FileClient. | ||
| // Note that the progress reporting is not always increasing; it can go down when retrying a request. | ||
| Progress func(bytesTransferred int64) | ||
| // Concurrency indicates the maximum number of chunks to upload in parallel (default is 5) | ||
| // Concurrency indicates the maximum number of chunks to upload in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
| // AccessConditions contains optional parameters to access leased entity. | ||
| AccessConditions *AccessConditions | ||
|
|
@@ -157,7 +158,8 @@ type uploadFromReaderOptions struct { | |
| type UploadStreamOptions struct { | ||
| // ChunkSize specifies the chunk size to use in bytes; the default (and maximum size) is MaxAppendBytes. | ||
| ChunkSize int64 | ||
| // Concurrency indicates the maximum number of chunks to upload in parallel (default is 5) | ||
| // Concurrency indicates the maximum number of chunks to upload in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
| // AccessConditions contains optional parameters to access leased entity. | ||
| AccessConditions *AccessConditions | ||
|
|
@@ -324,7 +326,7 @@ func (o *AppendDataOptions) format(offset int64, body io.ReadSeekCloser) (*gener | |
|
|
||
| func (u *UploadStreamOptions) setDefaults() { | ||
| if u.Concurrency == 0 { | ||
| u.Concurrency = 1 | ||
| u.Concurrency = shared.DefaultConcurrencyValue() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous, this returns the previous default value as 5 instead of 1 |
||
| } | ||
|
|
||
| if u.ChunkSize < _1MiB { | ||
|
|
@@ -428,7 +430,8 @@ type DownloadBufferOptions struct { | |
| CPKInfo *CPKInfo | ||
| // CPKScopeInfo contains a group of parameters for client provided encryption scope. | ||
| CPKScopeInfo *CPKScopeInfo | ||
| // Concurrency indicates the maximum number of chunks to download in parallel (0=default). | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
| // RetryReaderOptionsPerChunk is used when downloading each chunk. | ||
| RetryReaderOptionsPerChunk *RetryReaderOptions | ||
|
|
@@ -482,7 +485,8 @@ type DownloadFileOptions struct { | |
| CPKInfo *CPKInfo | ||
| // CPKScopeInfo contains a group of parameters for client provided encryption scope. | ||
| CPKScopeInfo *CPKScopeInfo | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. The default value is 5. | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
| // RetryReaderOptionsPerChunk is used when downloading each chunk. | ||
| RetryReaderOptionsPerChunk *RetryReaderOptions | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -606,7 +606,8 @@ type downloadOptions struct { | |
| // LeaseAccessConditions contains optional parameters to access leased entity. | ||
| LeaseAccessConditions *LeaseAccessConditions | ||
|
|
||
| // Concurrency indicates the maximum number of chunks to download in parallel (0=default). | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
|
|
||
| // RetryReaderOptionsPerChunk is used when downloading each chunk. | ||
|
|
@@ -646,7 +647,8 @@ type DownloadBufferOptions struct { | |
| // LeaseAccessConditions contains optional parameters to access leased entity. | ||
| LeaseAccessConditions *LeaseAccessConditions | ||
|
|
||
| // Concurrency indicates the maximum number of chunks to download in parallel (0=default). | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
|
|
||
| // RetryReaderOptionsPerChunk is used when downloading each chunk. | ||
|
|
@@ -669,7 +671,8 @@ type DownloadFileOptions struct { | |
| // LeaseAccessConditions contains optional parameters to access leased entity. | ||
| LeaseAccessConditions *LeaseAccessConditions | ||
|
|
||
| // Concurrency indicates the maximum number of chunks to download in parallel (0=default). | ||
| // Concurrency indicates the maximum number of chunks to download in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
|
|
||
| // RetryReaderOptionsPerChunk is used when downloading each chunk. | ||
|
|
@@ -1050,7 +1053,8 @@ type uploadFromReaderOptions struct { | |
| // Note that the progress reporting is not always increasing; it can go down when retrying a request. | ||
| Progress func(bytesTransferred int64) | ||
|
|
||
| // Concurrency indicates the maximum number of chunks to upload in parallel (default is 5) | ||
| // Concurrency indicates the maximum number of chunks to upload in parallel. | ||
| // The default is based on CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency uint16 | ||
|
|
||
| // LeaseAccessConditions contains optional parameters to access leased entity. | ||
|
|
@@ -1078,7 +1082,8 @@ type UploadStreamOptions struct { | |
| ChunkSize int64 | ||
|
|
||
| // Concurrency defines the max number of concurrent uploads to be performed to upload the file. | ||
| // Each concurrent upload will create a buffer of size ChunkSize. The default value is one. | ||
| // Each concurrent upload will create a buffer of size ChunkSize. The default is based on | ||
| // CPU core count (min 8, max 96). Set AZURE_STORAGE_USE_LEGACY_DEFAULT_CONCURRENCY=true to revert to the previous default. | ||
| Concurrency int | ||
|
|
||
| // LeaseAccessConditions contains optional parameters to access leased entity. | ||
|
|
@@ -1087,7 +1092,7 @@ type UploadStreamOptions struct { | |
|
|
||
| func (u *UploadStreamOptions) setDefaults() { | ||
| if u.Concurrency == 0 { | ||
| u.Concurrency = 1 | ||
| u.Concurrency = int(shared.DefaultConcurrencyValue()) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous |
||
| } | ||
|
|
||
| if u.ChunkSize < _1MiB { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add changelog entries in all the three packages