You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-blobs-tune-upload-download-javascript.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ The Storage REST layer doesn’t support picking up a REST upload operation wher
87
87
88
88
## Performance tuning for downloads
89
89
90
-
Properly tuning data transfer options is key to reliable performance for downloads. Storage transfers are partitioned into several subtransfers based on the values defined in [BlobDownloadToBufferOptions](/javascript/api/@azure/storage-blob/blobdownloadtobufferoptions).
90
+
Tuning data transfer options for downloads is available only when using the [downloadToBuffer](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtobuffer) method. This method downloads a blob in parallel to a buffer based on the values defined in [BlobDownloadToBufferOptions](/javascript/api/@azure/storage-blob/blobdownloadtobufferoptions). Other download methods don't support tuning data transfer options.
91
91
92
92
### Set transfer options for downloads
93
93
@@ -98,9 +98,24 @@ The following values can be tuned for downloads based on the needs of your app:
98
98
99
99
### Performance considerations for downloads
100
100
101
-
During a download, the Storage client libraries split a given download request into multiple subdownloads based on the configuration options defined by `BlobDownloadToBufferOptions`. Each subdownload has its own dedicated call to the REST operation. Depending on transfer options, the client libraries manage these REST operations in parallel to complete the full download.
101
+
During a download using `downloadToBuffer`, the Storage client libraries split a given download request into multiple subdownloads based on the configuration options defined by `BlobDownloadToBufferOptions`. Each subdownload has its own dedicated call to the REST operation. Depending on transfer options, the client libraries manage these REST operations in parallel to complete the full download.
102
102
103
-
## Next steps
103
+
#### Code example
104
+
105
+
The following code example shows how to set values for [BlobDownloadToBufferOptions](/javascript/api/@azure/storage-blob/blobdownloadtobufferoptions) and include the options as part of a [downloadToBuffer](/javascript/api/@azure/storage-blob/blobclient#@azure-storage-blob-blobclient-downloadtobuffer) method call. The values provided in the samples aren't intended to be a recommendation. To properly tune these values, you need to consider the specific needs of your app.
106
+
107
+
```javascript
108
+
// Specify data transfer options
109
+
constdownloadToBufferOptions= {
110
+
blockSize:4*1024*1024, // 4 MiB max block size
111
+
concurrency:2, // maximum number of parallel transfer workers
- To understand more about factors that can influence performance for Azure Storage operations, see [Latency in Blob storage](storage-blobs-latency.md).
106
121
- To see a list of design considerations to optimize performance for apps using Blob storage, see [Performance and scalability checklist for Blob storage](storage-performance-checklist.md).
0 commit comments