ossutil allows you to set a bandwidth limit to limit file transfer speeds in uploads to and downloads from Object Storage Service (OSS). Bandwidth limiting helps align data transfer speeds with your actual network conditions, multitasking scenarios, and data processing requirements.
The bandwidth limit applies globally, not only to one single connection.
Scenarios
Bandwidth limiting is suitable for uploading large files to OSS and downloading large objects from OSS in scenarios such as varying network environments and multitasking.
Prerequisites
OSS is activated. For more information, see Activate OSS.
A bucket is created. For more information, see Create a bucket.
ossutil 2.0 is installed. For more information, see Install ossutil.
Parameters
Parameter | Description |
--bandwidth-limit | The maximum bandwidth for data transfers. The minimum value of this parameter is 1024 B/s. The default bandwidth unit is B/s. When you configure the parameter, you can suffix the numerical value with a unit. The supported units include B for byte/s, K for KB/s, M for MB/s, and G for GB/s. For example, 50M specifies that the bandwidth is limited to 50 MB/s. |
Examples
Limit the upload speed
The following sample command uploads the upload.rar file to the "bucket" bucket and sets the maximum upload speed to 20971520 by using the default bandwidth unit B/s.
ossutil cp D:\\upload.rar oss://bucket/ --bandwidth-limit 20971520The following sample command uploads the upload.rar file to the "bucket" bucket and sets the maximum upload speed to 50 MB/s.
ossutil cp D:\\file.rar oss://bucket/dir -r --bandwidth-limit 50MLimit the download speed
The following sample command downloads the download.rar object from the "bucket" bucket to the current local directory and sets the maximum download speed to 20 MB/s.
ossutil cp oss://bucket/download.rar . --bandwidth-limit 20971520