Skip to content

Commit 3e4a22c

Browse files
edits
1 parent 9a1952a commit 3e4a22c

File tree

2 files changed

+17
-54
lines changed

2 files changed

+17
-54
lines changed

articles/storage/blobs/storage-blob-upload-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ You can configure properties in [BlockBlobParallelUploadOptions](/javascript/api
7171
| Property | Description |
7272
| --- | --- |
7373
| [`blockSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-blocksize) | The maximum block size to transfer for each request as part of an upload operation. |
74-
| [`concurrency`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-concurrency) | The maximum number of parallel requests that are issued at any given time as a part of a single parallel transfer.
74+
| [`concurrency`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-concurrency) | The maximum number of parallel requests that are issued at any given time as a part of a single parallel transfer. |
7575
| [`maxSingleShotSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-maxsingleshotsize) | If the size of the data is less than or equal to this value, it's uploaded in a single put rather than broken up into chunks. If the data is uploaded in a single shot, the block size is ignored. Default value is 256 MiB. |
7676

7777
The following code example shows how to set values for [BlockBlobParallelUploadOptions](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions) and include the options as part of an upload 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.

articles/storage/blobs/storage-blobs-tune-upload-download-javascript.md

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -28,50 +28,34 @@ You can configure properties in [BlockBlobParallelUploadOptions](/javascript/api
2828

2929
| Property | Description |
3030
| --- | --- |
31-
| [`blockSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-blocksize) | The maximum block size to transfer for each request as part of an upload operation. |
32-
| [`concurrency`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-concurrency) | The maximum number of parallel requests that are issued at any given time as a part of a single parallel transfer.
33-
| [`maxSingleShotSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-maxsingleshotsize) | If the size of the data is less than or equal to this value, it's uploaded in a single put rather than broken up into chunks. If the data is uploaded in a single shot, the block size is ignored. Default value is 256 MiB. |
31+
| [`blockSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-blocksize) | The maximum block size to transfer for each request as part of an upload operation. To learn more, see [blockSize](#blocksize). |
32+
| [`maxSingleShotSize`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-maxsingleshotsize) | If the size of the data is less than or equal to this value, it's uploaded in a single put rather than broken up into chunks. If the data is uploaded in a single shot, the block size is ignored. Default value is 256 MiB. To learn more, see [maxSingleShotSize](#maxsingleshotsize). |
33+
| [`concurrency`](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions#@azure-storage-blob-blockblobparalleluploadoptions-concurrency) | The maximum number of parallel requests that are issued at any given time as a part of a single parallel transfer. |
3434

3535
> [!NOTE]
3636
> The client libraries will use defaults for each data transfer option, if not provided. These defaults are typically performant in a data center environment, but not likely to be suitable for home consumer environments. Poorly tuned data transfer options can result in excessively long operations and even request timeouts. It's best to be proactive in testing these values, and tuning them based on the needs of your application and environment.
3737
38-
#### maxSingleUploadSize
38+
#### maxSingleShotSize
3939

40-
The `maxSingleUploadSize` value is the maximum blob size in bytes for a single request upload. This value can be set using the following method:
40+
The `maxSingleShotSize` value is the maximum blob size in bytes for a single request upload.
4141

42-
- [`setMaxSingleUploadSizeLong(Long maxSingleUploadSize)`](/java/api/com.azure.storage.blob.models.paralleltransferoptions#com-azure-storage-blob-models-paralleltransferoptions-setmaxsingleuploadsizelong(java-lang-long))
42+
If the size of the data is less than or equal to `maxSingleShotSize`, the blob is uploaded with a single [Put Blob](/rest/api/storageservices/put-blob) request. If the blob size is greater than `maxSingleShotSize`, or if the blob size is unknown, the blob is uploaded in chunks using a series of [Put Block](/rest/api/storageservices/put-block) calls followed by [Put Block List](/rest/api/storageservices/put-block-list).
4343

44-
If the size of the data is less than or equal to `maxSingleUploadSize`, the blob is uploaded with a single [Put Blob](/rest/api/storageservices/put-blob) request. If the blob size is greater than `maxSingleUploadSize`, or if the blob size is unknown, the blob is uploaded in chunks using a series of [Put Block](/rest/api/storageservices/put-block) calls followed by [Put Block List](/rest/api/storageservices/put-block-list).
44+
It's important to note that the value you specify for `blockSize` *does not* limit the value that you define for `maxSingleShotSize`. The `maxSingleShotSize` argument defines a separate size limitation for a request to perform the entire operation at once, with no subtransfers. It's often the case that you want `maxSingleShotSize` to be *at least* as large as the value you define for `blockSize`, if not larger. Depending on the size of the data transfer, this approach can be more performant, as the transfer is completed with a single request and avoids the overhead of multiple requests.
4545

46-
It's important to note that the value you specify for `blockSize` *does not* limit the value that you define for `maxSingleUploadSize`. The `maxSingleUploadSize` argument defines a separate size limitation for a request to perform the entire operation at once, with no subtransfers. It's often the case that you want `maxSingleUploadSize` to be *at least* as large as the value you define for `blockSize`, if not larger. Depending on the size of the data transfer, this approach can be more performant, as the transfer is completed with a single request and avoids the overhead of multiple requests.
47-
48-
If you're unsure of what value is best for your situation, a safe option is to set `maxSingleUploadSize` to the same value used for `blockSize`.
46+
If you're unsure of what value is best for your situation, a safe option is to set `maxSingleShotSize` to the same value used for `blockSize`.
4947

5048
#### blockSize
5149

52-
The `blockSize` value is the maximum length of a transfer in bytes when uploading a block blob in chunks. This value can be set using the following method:
53-
54-
- [`setBlockSizeLong(Long blockSize)`](/java/api/com.azure.storage.blob.models.paralleltransferoptions#com-azure-storage-blob-models-paralleltransferoptions-setblocksizelong(java-lang-long))
50+
The `blockSize` value is the maximum length of a transfer in bytes when uploading a block blob in chunks.
5551

56-
The `blockSize` value is the maximum length of a transfer in bytes when uploading a block blob in chunks. As mentioned earlier, this value *does not* limit `maxSingleUploadSize`, which can be larger than `blockSize`.
52+
As mentioned earlier, this value *does not* limit `maxSingleShotSize`, which can be larger than `blockSize`.
5753

5854
To keep data moving efficiently, the client libraries may not always reach the `blockSize` value for every transfer. Depending on the operation, the maximum supported value for transfer size can vary. For more information on transfer size limits for Blob storage, see the chart in [Scale targets for Blob storage](scalability-targets.md#scale-targets-for-blob-storage).
5955

60-
#### maxConcurrency
61-
62-
The `maxConcurrency` value is the maximum number of parallel requests issued at any given time as a part of a single parallel transfer. This value can be set using the following method:
63-
64-
- [`setMaxConcurrency(Integer maxConcurrency)`](/java/api/com.azure.storage.blob.models.paralleltransferoptions#com-azure-storage-blob-models-paralleltransferoptions-setmaxconcurrency(java-lang-integer))
65-
6656
#### Code example
6757

68-
Make sure you have the following `import` directive to use `ParallelTransferOptions` for an upload:
69-
70-
```java
71-
import com.azure.storage.blob.models.*;
72-
```
73-
74-
The following code example shows how to set values for [ParallelTransferOptions](/java/api/com.azure.storage.blob.models.paralleltransferoptions) and include the options as part of a [BlobUploadFromFileOptions](/java/api/com.azure.storage.blob.options.blobuploadfromfileoptions) instance. If you're not uploading from a file, you can set similar options using [BlobParallelUploadOptions](/java/api/com.azure.storage.blob.options.blobparalleluploadoptions). The values provided in this sample aren't intended to be a recommendation. To properly tune these values, you need to consider the specific needs of your app.
58+
The following code example shows how to set values for [BlockBlobParallelUploadOptions](/javascript/api/@azure/storage-blob/blockblobparalleluploadoptions) and include the options as part of an upload 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.
7559

7660
```javascript
7761
// Specify data transfer options
@@ -84,15 +68,15 @@ const uploadOptions = {
8468
// Create blob client from container client
8569
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
8670

87-
// Upload blob with index tags
71+
// Upload blob with transfer options
8872
await blockBlobClient.uploadFile(localFilePath, uploadOptions);
8973
```
9074

9175
In this example, we set the maximum number of parallel transfer workers to 2 using the `concurrency` property. We also set `maxSingleShotSize` to 8 MiB. If the blob size is smaller than 8 MiB, only a single request is necessary to complete the upload operation. If the blob size is larger than 8 MiB, the blob is uploaded in chunks with a maximum chunk size of 4 MiB, which we define in the `blockSize` property.
9276

9377
### Performance considerations for uploads
9478

95-
During an upload, the Storage client libraries split a given upload stream into multiple subuploads based on the configuration options defined by `ParallelTransferOptions`. Each subupload has its own dedicated call to the REST operation. For a `BlobClient` object, this operation is [Put Block](/rest/api/storageservices/put-block). The Storage client library manages these REST operations in parallel (depending on transfer options) to complete the full upload.
79+
During an upload, the Storage client libraries split a given upload stream into multiple subuploads based on the configuration options defined by `BlockBlobParallelUploadOptions`. Each subupload has its own dedicated call to the REST operation. In this example, the operation is [Put Block](/rest/api/storageservices/put-block). The Storage client library manages these REST operations in parallel (depending on transfer options) to complete the full upload.
9680

9781
> [!NOTE]
9882
> Block blobs have a maximum block count of 50,000 blocks. The maximum size of your block blob, then, is 50,000 times `block_size`.
@@ -103,35 +87,14 @@ The Storage REST layer doesn’t support picking up a REST upload operation wher
10387

10488
## Performance tuning for downloads
10589

106-
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 `ParallelTransferOptions`.
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).
10791

10892
### Set transfer options for downloads
10993

11094
The following values can be tuned for downloads based on the needs of your app:
11195

112-
- `blockSize`: The maximum block size to transfer for each request. You can set this value by using the [setBlockSizeLong](/java/api/com.azure.storage.common.paralleltransferoptions#com-azure-storage-common-paralleltransferoptions-setblocksizelong(java-lang-long)) method.
113-
- `maxConcurrency`: The maximum number of parallel requests issued at any given time as a part of a single parallel transfer. You can set this value by using the [setMaxConcurrency](/java/api/com.azure.storage.common.paralleltransferoptions#com-azure-storage-common-paralleltransferoptions-setmaxconcurrency(java-lang-integer)) method.
114-
115-
#### Code example
116-
117-
Make sure you have the following `import` directive to use `ParallelTransferOptions` for a download:
118-
119-
```java
120-
import com.azure.storage.common.*;
121-
```
122-
123-
The following code example shows how to set values for [ParallelTransferOptions](/java/api/com.azure.storage.common.paralleltransferoptions) and include the options as part of a [BlobDownloadToFileOptions](/java/api/com.azure.storage.blob.options.blobdownloadtofileoptions) instance.
124-
125-
```java
126-
ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions()
127-
.setBlockSizeLong((long) (4 * 1024 * 1024)) // 4 MiB block size
128-
.setMaxConcurrency(2);
129-
130-
BlobDownloadToFileOptions options = new BlobDownloadToFileOptions("<localFilePath>");
131-
options.setParallelTransferOptions(parallelTransferOptions);
132-
133-
blobClient.downloadToFileWithResponse(options, null, null);
134-
```
96+
- [blockSize](/javascript/api/@azure/storage-blob/blobdownloadtobufferoptions#@azure-storage-blob-blobdownloadtobufferoptions-blocksize): The maximum block size to transfer for each request.
97+
- [concurrency](/javascript/api/@azure/storage-blob/blobdownloadtobufferoptions#@azure-storage-blob-blobdownloadtobufferoptions-concurrency): The maximum number of parallel requests issued at any given time as a part of a single parallel transfer. You can set this value by using the [setMaxConcurrency](/java/api/com.azure.storage.common.paralleltransferoptions#com-azure-storage-common-paralleltransferoptions-setmaxconcurrency(java-lang-integer)) method.
13598

13699
### Performance considerations for downloads
137100

0 commit comments

Comments
 (0)