Skip to content

Conversation

@nickliu-msft
Copy link
Member

@nickliu-msft nickliu-msft commented Dec 10, 2025

Updated the default concurrency count. Also included compat switch logic to toggle back to previous default.

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Dec 10, 2025
@github-actions
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.Storage.Blobs
Azure.Storage.Common

1 similar comment
@github-actions
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.Storage.Blobs
Azure.Storage.Common

@nickliu-msft nickliu-msft changed the title Updated Default Concurrency to Processor count Updated Default Concurrency count Dec 11, 2025

private readonly ArrayPool<byte> _arrayPool;

private readonly int DefaultConcurrentTransfersCount = Math.Min(Math.Max(Environment.ProcessorCount * 2, 8), 32);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally had to do this since Math.Clamp() is not supported for netstandard2.0 and earlier

{
public const int DefaultConcurrentTransfersCount = 5;
[EditorBrowsable(EditorBrowsableState.Never)]
public const int DefaultConcurrentTransfersCount = LegacyDefaultConcurrentTransfersCount;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that this is to avoid altering a ton of files but i think it's probably better for code health to do that. We don't want to be confused about whether we're using old or new values. We want to know it's legacy when we see it. I'd rather this const just not exist.

Copy link
Member Author

@nickliu-msft nickliu-msft Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Constants.DefaultConcurrentTransfersCount is no longer being referenced at all, we are replacing all usage with the new Constants.LegacyDefaultConcurrentTransfersCount. The reason why we hid it rather than removed it is to avoid a breaking change

Copy link
Member

@jaschrep-msft jaschrep-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick suggestions. looks fine otherwise.

- Added support for Server-side Encryption Rekeying.
- Added cross-tenant support for Principal-Bound User Delegation SAS.
- Added support for Dynamic User Delegation SAS.
- Updated the default concurrency transfer count.
Copy link
Member

@jalauzon-msft jalauzon-msft Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go in an "Other changes" section and I think we should be more descriptive as this is a potentially impactful change. Something like:

"Changed the default "whatever the public facing setting is called" from 5 to "insert formula". This controls the maximum number of concurrent tasks that will be used during large uploads and downloads, and this change should result in higher throughput for these operations by default in most environments. This can be overridden by adjusting "public facing setting" or using the new compat switch "list compat switch and env var""
(I don't really know how compat switches work so write whatever makes sense, so customers know how to disable this. I think it's an app config and an env var)

Additionally, this change should affect more than just Blob, right? We should add this to any package is affects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this in the commons changelog as well. Will revise the wording to be more descriptive tho

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the concurrency change seems to only affect partitionDownload and partitionedUpload. partitionDownload seems to be only for blobs and partitionedUpload is for blobs, datalake, and files it seems. Which is why I updated in both Blobs and Commons changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants