Skip to content

Conversation

@jalauzon-msft
Copy link
Member

Adjusting the default connection_data_block_size to 256 KiB for all Storage packages. The current default for this value is 4 KiB, and some perf testing has revealed that increasing this value can drastically increase the speed of large file downloads without much cost to CPU or memory. Many values were tested on a range of VM sizes, and 256 KiB was found to be a good default across all VM SKUs.

Copilot AI review requested due to automatic review settings December 9, 2025 01:24
@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Dec 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR increases the default connection_data_block_size from 4 KiB to 256 KiB across all Azure Storage SDK packages based on performance testing that showed significant speed improvements for large file downloads with minimal resource impact.

  • Adds a new constant DATA_BLOCK_SIZE = 256 * 1024 to shared constants in all storage packages
  • Sets this value as the default for connection_data_block_size in the pipeline configuration
  • Updates comment from "Default socket timeouts, in seconds" to "Connection defaults" to reflect the broader scope

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/storage/azure-storage-queue/azure/storage/queue/_shared/constants.py Adds DATA_BLOCK_SIZE constant (256 KiB) and updates comment to "Connection defaults"
sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/constants.py Adds DATA_BLOCK_SIZE constant (256 KiB) and updates comment to "Connection defaults"
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/constants.py Adds DATA_BLOCK_SIZE constant (256 KiB) and updates comment to "Connection defaults"
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-blob/azure/storage/blob/_shared/constants.py Adds DATA_BLOCK_SIZE constant (256 KiB) and updates comment to "Connection defaults"
sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size
sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py Imports DATA_BLOCK_SIZE and sets it as default for connection_data_block_size

@weirongw23-msft
Copy link
Member

This looks great! The analyzer failure is coming from Queue package's Black formatter so it should be simple :)

@jalauzon-msft jalauzon-msft merged commit 14cb03a into Azure:main Dec 9, 2025
20 checks passed
@jalauzon-msft jalauzon-msft deleted the block-size-defaults branch December 9, 2025 23:07
jalauzon-msft added a commit to jalauzon-msft/azure-sdk-for-python that referenced this pull request Dec 10, 2025
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.

2 participants