By default, all buckets in the same region under an Alibaba Cloud account share bandwidth. When multiple buckets transfer large amounts of data concurrently, bandwidth contention can delay transfers for critical services. To address this, configure resource pool QoS throttling: threshold-based throttling prevents a bucket from consuming excessive bandwidth, while priority-based throttling guarantees a minimum bandwidth for core services. These complementary methods ensure your critical workloads remain stable.
How it works
Threshold-based throttling
You can set bandwidth caps for objects at each level, such as buckets and BucketGroups, to prevent excessive resource consumption.
Hierarchical relationships
Resource pool hierarchy: A resource pool can contain a multi-level hierarchy of objects. The following diagrams show several common structures.
Requester dimension (independent): The requester is not part of the resource pool hierarchy. It is an independent dimension for throttling.
Throttling principles
Basic principle
resource pool: Max 100Gbps
├─ bucket A: Max 40Gbps ← Cannot exceed 40 Gbps, even if other resources are idle
├─ bucket B: Max 30Gbps
└─ bucket C: Unlimited ← Can use all remaining bandwidthConstraint rules
Multiple limits applied simultaneously: The effective bandwidth is the minimum of all applicable limits.
The sum of the bandwidths of child objects cannot exceed their parent's total bandwidth.
The requester is an independent constraint: This constraint applies in addition to the resource pool's hierarchical constraints, and the lowest limit takes precedence.
Example
When a RAM user accesses a bucket, the traffic is subject to both:
The requester limit (20 Gbps) ← Independent dimension
The bucket limit (30 Gbps) ← Resource pool hierarchy
Effective maximum bandwidth = min(20 Gbps, 30 Gbps) = 20 Gbps
Priority-based throttling
You can configure 3 to 10 priority levels within a resource pool. A higher number indicates a higher priority. By assigning a minimum bandwidth commitment to objects at different priority levels, you can ensure that high-priority services receive bandwidth first during resource contention. Objects without a specified priority level use the default priority. Priority levels without a configured minimum bandwidth commitment use the default commitment.
Core mechanisms
Guaranteed bandwidth: Each priority level has a minimum bandwidth commitment, which guarantees that the specified bandwidth will be available.
Preemption mechanism: High-priority traffic can preempt bandwidth from lower-priority traffic that is using bandwidth beyond its minimum bandwidth commitment. The highest priorities preempt first.
Idle bandwidth utilization: Lower-priority traffic can use the idle portion of a higher priority's minimum bandwidth commitment. However, higher-priority traffic always has precedence to use any available bandwidth.
Configuration constraint: The sum of all minimum bandwidth commitments across all priority levels cannot exceed the total bandwidth of the resource pool.
Typical scenarios
In the following scenarios, the resource pool has a total bandwidth limit of 100 Gbps and is configured with multiple priority levels. A higher number indicates a higher priority.
Combining throttling methods
When both methods are used, the effective bandwidth for a resource is determined by the interplay of the threshold-based cap, the priority-based minimum commitment, and the actual demand.
Rules of precedence
The threshold-based cap is a hard limit: The final allocated bandwidth cannot exceed this cap, regardless of the minimum bandwidth commitment.
The priority-based commitment is a soft guarantee: The system attempts to fulfill this commitment, but the allocation cannot exceed the hard limit.
Configuration examples
Standard configuration
bucket A is configured with:
Priority-based throttling: minimum bandwidth commitment of 50 Gbps ← Priority dimension
Threshold-based throttling: maximum cap of 80 Gbps ← Resource pool hierarchy
Result: The available bandwidth for bucket A ranges from a guaranteed minimum of 50 Gbps to a maximum of 80 Gbps.
Conflicting configuration
If bucket A has a conflicting configuration:
Priority-based throttling: minimum bandwidth commitment of 80 Gbps ← Priority dimension
Threshold-based throttling: maximum cap of 50 Gbps ← Resource pool hierarchy
Result: The actual available bandwidth for bucket A is 50 Gbps. The threshold-based cap is a hard limit and takes precedence, overriding the higher minimum commitment.
Request a resource pool
When the bandwidth for your account in a region reaches or exceeds 400 Gbps, contact Technical Support to request a resource pool, console access, and priority-based throttling.
Provide the following information when you submit a ticket:
Buckets within a single resource pool must belong to the same user, be in the same region, and have the same redundancy type. The resource pool creation process may involve data migration and resource reallocation.
Region: China (Hangzhou)
Resource pool name: qos-resource-pool-1
Bucket list: qos-examplebucket-1, qos-examplebucket-2
Total upload bandwidth: 300 Gbps
Internal network upload bandwidth: 100 Gbps
Public network upload bandwidth: 200 Gbps
Total download bandwidth: 100 Gbps
Internal network download bandwidth: 50 Gbps
Public network download bandwidth: 50 Gbps
Console access to resource pool: Required
Priority-based throttling: RequiredThreshold-based throttling
Use this feature to limit the maximum bandwidth and prevent a specific entity from consuming excessive resources.
Bucket bandwidth limit
This prevents excessive traffic to a single bucket from impacting the performance of other buckets.
Console
On the Resource Pool QoS page, click the name of the target resource pool. Then, to the right of the target bucket, click Modify Throttling Configurations and set the bucket bandwidth as required.
ossutil
Before you begin, install ossutil.
Configure the bandwidth limit for the bucket with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth> </QoSConfiguration>Apply the bandwidth configuration to a specific bucket. The following command applies the configuration to a bucket named examplebucket.
ossutil api invoke-operation --op-name put-bucket-qos-info --method PUT --bucket examplebucket --parameters qosInfo --body=file://qos.xmlView the bandwidth configuration of the bucket.
ossutil api invoke-operation --op-name get-bucket-qos-info --method GET --bucket examplebucket --parameters qosInfo
SDK
You can set the bandwidth limit for a bucket using only the Python SDK V2 and Go SDK V2.
Configure the bandwidth limit for the bucket with a local file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth> </QoSConfiguration>Apply the bandwidth configuration to a specific bucket.
import alibabacloud_oss_v2 as oss def PutBucketQoSInfo(): # Obtain access credentials from environment variables for authentication credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Set qos_xml_body to an empty string. qos_xml_body = "" # Open the file named qos.xml and read its content into the qos_xml_body variable. with open('qos.xml', 'r') as qos_file: qos_xml_body = qos_file.read() # Specify input parameters for the PutBucketQoSInfo operation to specify the QoS rules for the bucket. req = oss.OperationInput( op_name = 'PutBucketQoSInfo', # Operation name, specifying the operation to set bucket QoS information method = 'PUT', # The type of the HTTP method. In this example, PUT is used to update resources. parameters = { 'qosInfo': '', # The QoS-related parameters. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = qos_xml_body, # The request body, which contains the content read from the qos.xml file. bucket = 'examplebucket', # The name of the bucket. ) # Use the invoke_operation method of the client to run the request and obtain the response or error message. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) if __name__ == "__main__": GetBucketQoSInfo()
API
Call the PutBucketQoSInfo operation with the following request body to limit the bandwidth for a bucket.
<QoSConfiguration>
<TotalUploadBandwidth>100</TotalUploadBandwidth>
<IntranetUploadBandwidth>-1</IntranetUploadBandwidth>
<ExtranetUploadBandwidth>20</ExtranetUploadBandwidth>
<TotalDownloadBandwidth>100</TotalDownloadBandwidth>
<IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>
<ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth>
</QoSConfiguration>Bucket requester bandwidth limit
RAM user
If multiple services share a single bucket, you can limit the bandwidth for a specific RAM user to prevent that user from consuming excessive resources.
Console
Obtain the RAM user ID.
On the Resource Pool QoS page, click the name of the target resource pool. Then, to the right of the target bucket, click Configure Bandwidth Throttling Rules and set the required bandwidth for the RAM user to access the bucket.
ossutil
Before you begin, install ossutil.
The following example shows how to limit the bandwidth for a RAM user accessing a bucket in a resource pool.
Configure the bandwidth limit for a RAM user accessing a bucket in the resource pool with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM user ID.
Apply the bandwidth configuration to a RAM user. The following command applies the configuration to the RAM user with the UID
266xxxxaccessing theexamplebucketbucket.ossutil api invoke-operation --op-name put-bucket-requester-qos-info --method PUT --bucket=examplebucket --parameters requesterQosInfo --parameters qosRequester=266xxxx --body file://qos.xml(Optional) View the bandwidth configuration for the RAM user.
ossutil api invoke-operation --op-name get-bucket-requester-qos-info --method GET --bucket=examplebucket --parameters requesterQosInfo --parameters qosRequester=266xxxx
SDK
You can limit the bandwidth for a RAM user accessing a bucket using only the Python SDK V2 and Go SDK V2.
Configure the bandwidth limit for a RAM user accessing a bucket in the resource pool with a local file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM user ID.
Apply the bandwidth configuration to the RAM user accessing the bucket.
import alibabacloud_oss_v2 as oss def PutBucketRequesterQoSInfo(): # Obtain access credentials from environment variables for authentication. credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Set qos_xml_body to an empty string. qos_xml_body = "" # Open a file named qos.xml and read its content into the qos_xml_body variable. with open('qos.xml', 'r') as qos_file: qos_xml_body = qos_file.read() # Specify input parameters for the PutBucketRequesterQoSInfo operation to configure throttling rules for a requester accessing a bucket. req = oss.OperationInput( op_name = 'PutBucketRequesterQoSInfo', # The name of the operation. method = 'PUT', # The type of the HTTP method. In this example, PUT is used. parameters = { 'requesterQosInfo': '', # The QoS-related parameters. 'qosRequester': '2598732222222xxxx', # The unique identifier for the requester, which is used to distinguish different requesters. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = qos_xml_body, # The request body, which contains the content read from the qos.xml file. bucket = 'examplebucket', # The name of the bucket. ) # Use the invoke_operation method of the client to execute the request and obtain the response. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) # Display the response body, which typically contains the specific data returned by the request. print(resp.http_response.content) if __name__ == "__main__": PutBucketRequesterQoSInfo()
API
Obtain the RAM user ID.
Call the PutBucketRequesterQoSInfo operation with the following request body to limit the bandwidth for a RAM user accessing a bucket.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth> </QoSConfiguration>
RAM role
You can use a bucket with a Content Delivery Network (CDN) to store static assets and accelerate content delivery. To allow the CDN to retrieve files from a private bucket, you must enable origin fetch. The CDN assumes the RAM role AliyunCDNAccessingPrivateOSSRole. In this scenario, you can limit the origin fetch bandwidth.
Console
Obtain the RAM role ID.
On the Resource Pool QoS page, click the name of the target resource pool. Then, to the right of the target bucket, click Configure Bandwidth Throttling Rules and set the required requester bandwidth.
ossutil
Before you begin, install ossutil.
Configure the bandwidth limit for the RAM role accessing a specific bucket with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>40</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM role ID.
Apply the bandwidth configuration to a RAM role. The following command applies the configuration to the RAM role with the ID
362xxxxaccessing theexamplebucketbucket.ossutil api invoke-operation --op-name put-bucket-requester-qos-info --method PUT --bucket=examplebucket --parameters requesterQosInfo --parameters qosRequester=362xxxx --body file://qos.xml(Optional) List the bandwidth configurations for all RAM roles in the resource pool.
ossutil api invoke-operation --op-name list-resource-pool-requester-qos-infos --method GET --parameters resourcePool=examplePool --parameters requesterQosInfo
SDK
You can limit the bandwidth for a RAM role accessing a bucket using only the Python SDK V2 and Go SDK V2.
Configure the bandwidth limit for the RAM role accessing a bucket in the resource pool with a local file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>40</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM role ID.
Apply the bandwidth configuration to the RAM role.
import alibabacloud_oss_v2 as oss def PutBucketRequesterQoSInfo(): # Obtain access credentials from environment variables for authentication. credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Set qos_xml_body to an empty string. qos_xml_body = "" # Open a file named qos.xml and read its content into the qos_xml_body variable. with open('qos.xml', 'r') as qos_file: qos_xml_body = qos_file.read() # Specify input parameters for the PutBucketRequesterQoSInfo operation to configure throttling rules for a requester accessing a bucket. req = oss.OperationInput( op_name = 'PutBucketRequesterQoSInfo', # The name of the operation. method = 'PUT', # The type of the HTTP method. In this example, PUT is used. parameters = { 'requesterQosInfo': '', # The QoS-related parameters. 'qosRequester': '2598732222222xxxx', # The unique identifier for the requester, which is used to distinguish different requesters. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = qos_xml_body, # The request body, which contains the content read from the qos.xml file. bucket = 'examplebucket', # The name of the bucket. ) # Use the invoke_operation method of the client to execute the request and obtain the response. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) # Display the response body, which typically contains the specific data returned by the request. print(resp.http_response.content) if __name__ == "__main__": PutBucketRequesterQoSInfo()
API
Obtain the RAM role ID.
Call the PutBucketRequesterQoSInfo operation with the following request body to limit the bandwidth for a RAM role accessing a bucket.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>40</ExtranetDownloadBandwidth> </QoSConfiguration>
BucketGroup bandwidth limit
You can group low-priority buckets into a BucketGroup to manage and limit their total bandwidth.
Console
On the Resource Pool QoS page, click the name of the target resource pool. Then, click Create A Bucket Group, define a name for the BucketGroup, and set the required bandwidth.
On the target resource pool page, click Create Bucket Group to the right of a target bucket to add the low-priority bucket to the BucketGroup.
ossutil
Before you begin, install ossutil.
The following commands add the
scheduled-postsandarchived-commentsbuckets to a BucketGroup.Add the
scheduled-postsbucket to the BucketGroup.ossutil api invoke-operation --op-name put-bucket-resource-pool-bucket-group --method PUT --bucket scheduled-posts --parameters resourcePool=pool-for-ai --parameters resourcePoolBucketGroup=test-groupAdd the
archived-commentsbucket to the BucketGroup.ossutil api invoke-operation --op-name put-bucket-resource-pool-bucket-group --method PUT --bucket archived-comments --parameters resourcePool=pool-for-ai --parameters resourcePoolBucketGroup=test-group(Optional) Get the list of buckets in the BucketGroup.
ossutil api invoke-operation --op-name list-resource-pool-bucket-groups --method GET --parameters resourcePool=pool-for-ai --parameters resourcePoolBucketGroup
Configure the bandwidth limit for a specific BucketGroup in the resource pool with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>20</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>10</ExtranetUploadBandwidth> <TotalDownloadBandwidth>30</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth> </QoSConfiguration>Apply the bandwidth configuration to the BucketGroup.
ossutil api invoke-operation --op-name put-resource-pool-bucket-group-qos-info --method PUT --parameters resourcePoolBucketGroupQosInfo --parameters resourcePool pool-for-ai --parameters resourcePoolBucketGroup offline-group --body=file://qos.xml(Optional) Get the bandwidth configuration of the BucketGroup.
ossutil api invoke-operation --op-name get-resource-pool-bucket-group-qos-info --method GET --parameters resourcePool=pool-for-ai --parameters resourcePoolBucketGroup=offline-group --parameters resourcePoolBucketGroupQoSInfo
SDK
You can limit the bandwidth of a BucketGroup using only the Python SDK V2 and Go SDK V2.
Add buckets from a resource pool to a BucketGroup.
import alibabacloud_oss_v2 as oss def PutBucketResourcePoolBucketGroup(): # Obtain access credentials from environment variables for authentication. credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Specify input parameters for the PutBucketResourcePoolBucketGroup operation. req = oss.OperationInput( op_name = 'PutBucketResourcePoolBucketGroup', # The name of the operation. method = 'PUT', # The type of the HTTP method type. In this example, PUT is used. parameters = { 'resourcePoolBucketGroup': 'example-group', # The name of the bucket group in the resource pool. 'resourcePool': 'example-resource-pool', # The name of the resource pool. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = None, # The request body, which is typically not required for PUT requests. bucket = 'examplebucket', # The name of the bucket. ) # Use the invoke_operation method of the client to execute the request and obtain the response. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) # Display the response body, which typically contains the specific data returned by the request. print(resp.http_response.content) if __name__ == "__main__": PutBucketResourcePoolBucketGroup()Configure the bandwidth limit for a specific BucketGroup in the resource pool with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>20</TotalUploadBandwidth> <IntranetUploadBandwidth>-1</IntranetUploadBandwidth> <ExtranetUploadBandwidth>10</ExtranetUploadBandwidth> <TotalDownloadBandwidth>30</TotalDownloadBandwidth> <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth> </QoSConfiguration>Apply the bandwidth configuration to the BucketGroup.
import alibabacloud_oss_v2 as oss def PutResourcePoolBucketGroupQoSInfo(): # Obtain access credentials from environment variables for authentication. credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Set qos_xml_body to an empty string. qos_xml_body = "" # Open and read the qos.xml file and write its content into the qos_xml_body variable. with open('qos.xml', 'r') as qos_file: qos_xml_body = qos_file.read() # Specify input parameters for the PutResourcePoolBucketGroupQoSInfo operation. req = oss.OperationInput( op_name = 'PutResourcePoolBucketGroupQoSInfo', # The name of the operation. method = 'PUT', # The type of the HTTP method type. In this example, PUT is used. parameters = { 'resourcePoolBucketGroupQosInfo': '', # The QoS-related parameters. 'resourcePool': 'example-resource-pool', # The name of the resource pool 'resourcePoolBucketGroup': 'example-group', # The name of the bucket group. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = qos_xml_body, # The request body, which contains the content read from the qos.xml file. bucket = None, # The name of the bucket, which is not required for PUT requests. This operation is not performed on a specific bucket. ) # Use the invoke_operation method of the client to execute the request and obtain the response. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) # Display the response body, which typically contains the specific data returned by the request. print(resp.http_response.content) if __name__ == "__main__": PutResourcePoolBucketGroupQoSInfo()
API
Call the PutResourcePoolBucketGroupQoSInfo operation with the following request body to limit the bandwidth of a BucketGroup.
<QoSConfiguration>
<TotalUploadBandwidth>20</TotalUploadBandwidth>
<IntranetUploadBandwidth>-1</IntranetUploadBandwidth>
<ExtranetUploadBandwidth>10</ExtranetUploadBandwidth>
<TotalDownloadBandwidth>30</TotalDownloadBandwidth>
<IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>
<ExtranetDownloadBandwidth>20</ExtranetDownloadBandwidth>
</QoSConfiguration>Resource pool requester bandwidth limit
When multiple RAM users access different buckets in the same resource pool, you can set individual bandwidth limits to prevent any single user from monopolizing the pool's bandwidth.
Console
Obtain the RAM user ID or RAM role ID.
On the Resource Pool QoS page, click the name of the target resource pool. On the Requesters tab, click Modify Throttling Configurations to the right of the target RAM user or RAM role and set the required requester bandwidth.
ossutil
Before you begin, install ossutil.
Configure the bandwidth limit for a RAM user or RAM role accessing the resource pool with a local XML file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>50</IntranetUploadBandwidth> <ExtranetUploadBandwidth>50</ExtranetUploadBandwidth> <TotalDownloadBandwidth>200</TotalDownloadBandwidth> <IntranetDownloadBandwidth>150</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>50</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM user ID or RAM role ID.
Apply the bandwidth configuration to a RAM user. The following command applies the configuration to the RAM user with the UID
266xxxx.ossutil api invoke-operation --op-name put-resource-pool-requester-qos-info --method PUT --parameters resourcePool=examplepool --parameters qosRequester=266xxxx --parameters requesterQosInfo --body=file://qos.xml(Optional) List the bandwidth configurations for all RAM users in the resource pool.
ossutil api invoke-operation --op-name list-resource-pool-requester-qos-infos --method GET --parameters resourcePool=examplePool --parameters requesterQosInfo
SDK
You can limit the bandwidth for a RAM user or RAM role accessing a resource pool using only the Python SDK V2 and Go SDK V2.
Configure the bandwidth limit for a specific RAM user or RAM role accessing the resource pool with a local file named qos.xml.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>50</IntranetUploadBandwidth> <ExtranetUploadBandwidth>50</ExtranetUploadBandwidth> <TotalDownloadBandwidth>200</TotalDownloadBandwidth> <IntranetDownloadBandwidth>150</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>50</ExtranetDownloadBandwidth> </QoSConfiguration>Obtain the RAM user ID or RAM role ID.
Apply the bandwidth configuration to the RAM user or RAM role.
import alibabacloud_oss_v2 as oss def PutResourcePoolRequesterQoSInfo(): # Obtain access credentials from environment variables for authentication. credentials_provider = oss.credentials.EnvironmentVariableCredentialsProvider() # Load default configurations and obtain the configuration file. cfg = oss.config.load_default() # Specify the credential provider. cfg.credentials_provider = credentials_provider # Specify the region in which the bucket is located. For example, if your bucket is located in the China (Hangzhou) region, set the region to cn-hangzhou. cfg.region = "cn-hangzhou" # Initialize the OSSClient instance by using the configuration file. client = oss.Client(cfg) # Initialize qos_xml_body as an empty string qos_xml_body = "" # Open a file named qos.xml and read its content into the qos_xml_body variable. with open('qos.xml', 'r') as qos_file: qos_xml_body = qos_file.read() # Specify input parameters for the PutResourcePoolRequesterQoSInfo operation. req = oss.OperationInput( op_name = 'PutResourcePoolRequesterQoSInfo', # The name of the operation. method = 'PUT', # The type of the HTTP method type. In this example, PUT is used. parameters = { 'requesterQosInfo': '', # The QoS-related parameters. 'resourcePool': 'example-resource-pool', # The name of the resource pool. 'qosRequester': '2598732222222xxxx', # The ID of the requester. }, headers = None, # The request headers. If you do not need to specify additional headers, leave the field empty. body = qos_xml_body, # The request body, which contains the content read from the qos.xml file. bucket = None, # The name of the bucket, which is not required for PUT requests. The operation is not performed on a specific bucket. ) # Use the invoke_operation method of the client to execute the request and obtain the response. resp = client.invoke_operation(req) # Display the returned HTTP status code. print(resp.status_code) # Display the response headers. print(resp.headers) # Display the response body, which typically contains the specific data returned by the request. print(resp.http_response.content) if __name__ == "__main__": PutResourcePoolRequesterQoSInfo()
API
Obtain the RAM user ID or RAM role ID.
Call the PutResourcePoolRequesterQoSInfo operation with the following request body to limit the bandwidth for a RAM user or RAM role accessing a resource pool.
<QoSConfiguration> <TotalUploadBandwidth>100</TotalUploadBandwidth> <IntranetUploadBandwidth>50</IntranetUploadBandwidth> <ExtranetUploadBandwidth>50</ExtranetUploadBandwidth> <TotalDownloadBandwidth>200</TotalDownloadBandwidth> <IntranetDownloadBandwidth>150</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>50</ExtranetDownloadBandwidth> </QoSConfiguration>
Configure priority-based throttling
Use this method to guarantee a minimum bandwidth for core services and prioritize high-priority objects during resource contention.
Configure resource pool priorities
If a resource pool contains multiple buckets, you can configure priorities to ensure that buckets for core services receive sufficient bandwidth, especially during resource contention.
ossutil
Create a priority QoS configuration file named
priority-qos.xml.<PriorityQosConfiguration> <PriorityCount>3</PriorityCount> <DefaultPriorityLevel>1</DefaultPriorityLevel> <DefaultGuaranteedQosConfiguration> <TotalUploadBandwidth>10</TotalUploadBandwidth> <IntranetUploadBandwidth>5</IntranetUploadBandwidth> <ExtranetUploadBandwidth>5</ExtranetUploadBandwidth> <TotalDownloadBandwidth>20</TotalDownloadBandwidth> <IntranetDownloadBandwidth>10</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>10</ExtranetDownloadBandwidth> </DefaultGuaranteedQosConfiguration> <QosPriorityLevelConfiguration> <PriorityLevel>3</PriorityLevel> <GuaranteedQosConfiguration> <TotalUploadBandwidth>50</TotalUploadBandwidth> <TotalDownloadBandwidth>80</TotalDownloadBandwidth> <ExtranetUploadBandwidth>30</ExtranetUploadBandwidth> <IntranetUploadBandwidth>20</IntranetUploadBandwidth> <ExtranetDownloadBandwidth>50</ExtranetDownloadBandwidth> <IntranetDownloadBandwidth>30</IntranetDownloadBandwidth> </GuaranteedQosConfiguration> <Subjects> <Bucket>critical-bucket</Bucket> <BucketGroup>core-group</BucketGroup> </Subjects> </QosPriorityLevelConfiguration> <QosPriorityLevelConfiguration> <PriorityLevel>2</PriorityLevel> <GuaranteedQosConfiguration> <TotalUploadBandwidth>30</TotalUploadBandwidth> <TotalDownloadBandwidth>50</TotalDownloadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <IntranetUploadBandwidth>10</IntranetUploadBandwidth> <ExtranetDownloadBandwidth>30</ExtranetDownloadBandwidth> <IntranetDownloadBandwidth>20</IntranetDownloadBandwidth> </GuaranteedQosConfiguration> <Subjects> <Bucket>important-bucket</Bucket> </Subjects> </QosPriorityLevelConfiguration> </PriorityQosConfiguration>Apply the configuration.
ossutil api invoke-operation --op-name put-resource-pool-priority-qos-configuration --method PUT --parameters resourcePool=hz-rp-03 --parameters priorityQos --body=file://priority-qos.xmlGet and verify the configuration.
ossutil api invoke-operation --op-name get-resource-pool-priority-qos-configuration --method GET --parameters resourcePool=hz-rp-03 --parameters priorityQos
SDK
package main
import (
"bytes"
"context"
"crypto/md5"
"encoding/base64"
"fmt"
"os"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
)
func main() {
// Specify the region where the bucket is located. For example, set the region to cn-hangzhou for China (Hangzhou).
var region = "cn-hangzhou"
// Load the default configurations and set the credential provider and region.
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
// Create an OSS client.
client := oss.NewClient(cfg)
// Define the resource pool name.
resourcePool := "hz-rp-01"
// Read the content of the priority QoS configuration file.
qosConf, err := os.ReadFile("priority-qos.xml")
if err != nil {
// If an error occurs while reading the QoS configuration file, print the error message and exit the program.
fmt.Printf("failed to read qos.xml: %v\n", err)
os.Exit(1)
}
// Calculate the MD5 hash of the input data and convert it to a Base64-encoded string.
calcMd5 := func(input []byte) string {
if len(input) == 0 {
return "1B2M2Y8AsgTpgAmY7PhCfg=="
}
h := md5.New()
h.Write(input)
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
// Create the input parameters for the operation, including the action, method type, and other parameters.
input := &oss.OperationInput{
OpName: "PutResourcePoolPriorityQoSConfiguration", // The action.
Method: "PUT", // The HTTP method.
Parameters: map[string]string{
"priorityQos": "", // Priority QoS-related parameters.
"resourcePool": resourcePool, // The resource pool name.
},
Headers: map[string]string{
"Content-MD5": calcMd5(qosConf), // Set the MD5 hash of the request body for data integrity validation.
},
Body: bytes.NewReader(qosConf), // The request body, which contains the QoS configuration content.
Bucket: nil, // This operation does not apply to a specific bucket.
}
// Execute the operation and receive the response or an error.
res, err := client.InvokeOperation(context.TODO(), input)
if err != nil {
// If an error occurs, print the error message and exit the program.
fmt.Printf("invoke operation got error: %v\n", err)
os.Exit(1)
}
// Print the operation result.
fmt.Println("The result of PutResourcePoolPriorityQoSConfiguration:", res.Status)
}API
Configure resource pool requester priorities
In a multi-tenant SaaS platform, you can assign priorities to requesters of different tiers who access the same resource pool. This guarantees bandwidth for VIP customers, while other customers share the remaining resources.
ossutil
Create a requester priority QoS configuration file named
requester-priority-qos.xml.<PriorityQosConfiguration> <PriorityCount>3</PriorityCount> <DefaultPriorityLevel>1</DefaultPriorityLevel> <DefaultGuaranteedQosConfiguration> <TotalUploadBandwidth>10</TotalUploadBandwidth> <IntranetUploadBandwidth>5</IntranetUploadBandwidth> <ExtranetUploadBandwidth>5</ExtranetUploadBandwidth> <TotalDownloadBandwidth>20</TotalDownloadBandwidth> <IntranetDownloadBandwidth>10</IntranetDownloadBandwidth> <ExtranetDownloadBandwidth>10</ExtranetDownloadBandwidth> </DefaultGuaranteedQosConfiguration> <QosPriorityLevelConfiguration> <PriorityLevel>3</PriorityLevel> <GuaranteedQosConfiguration> <TotalUploadBandwidth>60</TotalUploadBandwidth> <TotalDownloadBandwidth>100</TotalDownloadBandwidth> <ExtranetUploadBandwidth>40</ExtranetUploadBandwidth> <IntranetUploadBandwidth>20</IntranetUploadBandwidth> <ExtranetDownloadBandwidth>60</ExtranetDownloadBandwidth> <IntranetDownloadBandwidth>40</IntranetDownloadBandwidth> </GuaranteedQosConfiguration> <Subjects> <Requester>123456789012****</Requester> <Requester>234567890123****</Requester> </Subjects> </QosPriorityLevelConfiguration> <QosPriorityLevelConfiguration> <PriorityLevel>2</PriorityLevel> <GuaranteedQosConfiguration> <TotalUploadBandwidth>30</TotalUploadBandwidth> <TotalDownloadBandwidth>50</TotalDownloadBandwidth> <ExtranetUploadBandwidth>20</ExtranetUploadBandwidth> <IntranetUploadBandwidth>10</IntranetUploadBandwidth> <ExtranetDownloadBandwidth>30</ExtranetDownloadBandwidth> <IntranetDownloadBandwidth>20</IntranetDownloadBandwidth> </GuaranteedQosConfiguration> <Subjects> <Requester>345678901234****</Requester> </Subjects> </QosPriorityLevelConfiguration> </PriorityQosConfiguration>Apply the configuration.
ossutil api invoke-operation --op-name put-resource-pool-requester-priority-qos-configuration --method PUT --parameters resourcePool=hz-rp-03 --parameters requesterPriorityQos --body=file://requester-priority-qos.xml(Optional) Get and verify the configuration.
ossutil api invoke-operation --op-name get-resource-pool-requester-priority-qos-configuration --method GET --parameters resourcePool=hz-rp-03 --parameters requesterPriorityQos
SDK
package main
import (
"bytes"
"context"
"crypto/md5"
"encoding/base64"
"fmt"
"os"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
)
func main() {
// Specify the region where the bucket is located. For example, set the region to cn-hangzhou for China (Hangzhou).
var region = "cn-hangzhou"
// Load the default configurations and set the credential provider and region.
cfg := oss.LoadDefaultConfig().
WithCredentialsProvider(credentials.NewEnvironmentVariableCredentialsProvider()).
WithRegion(region)
// Create an OSS client.
client := oss.NewClient(cfg)
// Define the resource pool name.
resourcePool := "hz-rp-01"
// Read the content of the requester priority QoS configuration file.
qosConf, err := os.ReadFile("requester-priority-qos.xml")
if err != nil {
// If an error occurs while reading the QoS configuration file, print the error message and exit the program.
fmt.Printf("failed to read qos.xml: %v\n", err)
os.Exit(1)
}
// Calculate the MD5 hash of the input data and convert it to a Base64-encoded string.
calcMd5 := func(input []byte) string {
if len(input) == 0 {
return "1B2M2Y8AsgTpgAmY7PhCfg=="
}
h := md5.New()
h.Write(input)
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
// Create the input parameters for the operation, including the action, method type, and other parameters.
input := &oss.OperationInput{
OpName: "PutResourcePoolRequesterPriorityQoSConfiguration", // The action.
Method: "PUT", // The HTTP method.
Parameters: map[string]string{
"requesterPriorityQos": "", // Requester priority QoS-related parameters.
"resourcePool": resourcePool, // The resource pool name.
},
Headers: map[string]string{
"Content-MD5": calcMd5(qosConf), // Set the MD5 hash of the request body for data integrity validation.
},
Body: bytes.NewReader(qosConf), // The request body, which contains the QoS configuration content.
Bucket: nil, // This operation does not apply to a specific bucket.
}
// Execute the operation and receive the response or an error.
res, err := client.InvokeOperation(context.TODO(), input)
if err != nil {
// If an error occurs, print the error message and exit the program.
fmt.Printf("invoke operation got error: %v\n", err)
os.Exit(1)
}
// Print the operation result.
fmt.Println("The result of PutResourcePoolRequesterPriorityQoSConfiguration:", res.Status)
}API
Monitoring and alerting
Monitor bandwidth usage
Go to the Cloud Monitor-Object Storage Service (OSS) Resource Pool page to monitor the real-time bandwidth usage of critical services in your resource pool. This ensures effective resource allocation and service stability.
Set bandwidth alerts
To maintain the stability of critical services, you can create alert rules in the Cloud Monitor service. Cloud Monitor automatically triggers an alert when bandwidth usage exceeds 80%, enabling you to promptly adjust your bandwidth configuration for peak traffic.
Production deployment
Capacity planning
1. Keep the sum of minimum bandwidth commitments below 50% of the total resource pool bandwidth.
Leaving at least 50% of your bandwidth as flexible space for dynamic scheduling improves the resource pool's overall utilization.
Recommended configuration:
Total resource pool bandwidth: 100 Gbps
Priority 3 minimum bandwidth commitment: 20 Gbps
Priority 2 minimum bandwidth commitment: 20 Gbps
Priority 1 minimum bandwidth commitment: 10 Gbps
Total: 50 Gbps (50 Gbps reserved as flexible space)2. Use 3 to 5 priority levels.
Too many priority levels increase management complexity. We recommend classifying services into 3 to 5 levels based on business criticality:
Core services (priority 4–5)
Important services (priority 3)
Standard services (priority 1–2)
3. Set the threshold-based throttling limit higher than the minimum bandwidth commitment.
This lets high-priority objects use more bandwidth when capacity is available:
Recommended configuration:
Minimum bandwidth commitment: 50 Gbps for Bucket A
Threshold-based throttling limit: 80 Gbps for Bucket A
Effective bandwidth: 50–80 Gbps (guaranteed 50 Gbps, capped at 80 Gbps)Best practices
Use case 1: Video on demand platform
Live streams: Assign priority 3 with a minimum bandwidth commitment of 50 Gbps.
On-demand content: Assign priority 1 with a minimum bandwidth commitment of 20 Gbps.
CDN origin fetch: Apply a threshold-based throttling limit of 100 Gbps.
Use case 2: Multi-tenant SaaS platform
Enterprise customers: Assign priority 3 with a dedicated minimum bandwidth commitment.
Free-tier customers: Assign priority 1 to share the remaining resources.
Per-tenant cap: Use threshold-based throttling to prevent any single tenant from consuming excessive bandwidth.
Use case 3: Data lake analytics
Real-time analytics: Assign priority 2 with a minimum bandwidth commitment of 30 Gbps.
Batch analytics: Assign priority 1 with a minimum bandwidth commitment of 20 Gbps.
Data archiving: Apply a threshold-based throttling limit of 10 Gbps.
Risk mitigation
1. Regularly review quota usage
Use Cloud Monitor to track bandwidth usage trends for all objects and adjust quotas as needed:
If high-priority objects consistently fail to receive their minimum bandwidth commitment (for example, if the fulfillment rate is below 95%), consider increasing their commitment or reducing the commitment for lower-priority objects.
If low-priority objects are frequently starved of bandwidth, consider reducing the minimum bandwidth commitment for high-priority objects or scaling out the resource pool.
2. Set multi-level alerts
Warning level (80%): Use this for early warnings, allowing time to prepare a scale-out plan.
Critical level (90%): Use this to trigger immediate action, such as activating an emergency plan.
3. Avoid configuration conflicts
The sum of all minimum bandwidth commitments cannot exceed the total bandwidth of the resource pool.
The threshold-based throttling limit for an object should be higher than its minimum bandwidth commitment.
If a bucket is part of a BucketGroup, the priority of the BucketGroup takes precedence over the bucket's individual priority setting.
4. Manage changes and rollbacks
Before making significant changes, validate your configuration in a staging environment.
Always back up your current configuration for a quick rollback if needed.
Schedule all changes during off-peak hours to minimize the impact on your services.
Quotas and limits
Item | Quota/limit |
Resource pool | Up to 100 resource pools per region. |
Up to 100 buckets per resource pool. | |
Up to 100 bucket groups per resource pool. | |
A resource pool supports throttling for up to 300 requesters. | |
Bucket group | The name must be 3 to 30 characters long. |
The name can only contain lowercase letters, digits, and hyphens (-). | |
Priority-based throttling | Number of priority levels: 3 to 10. |
Priority level: An integer from 1 to the total number of priority levels. | |
The sum of all minimum bandwidth commitments cannot exceed the total bandwidth of the resource pool. | |
A minimum bandwidth commitment is required for each priority level unless a default is configured. | |
The minimum value for a minimum bandwidth commitment is MIN[5, (threshold of the corresponding item in the parent resource pool) / (2 * number of priority levels)] Gbps. | |
Bandwidth parameter | Positive integer: A specific limit in Gbps. |
-1: Unlimited (shares the resource pool bandwidth). | |
0: Prohibits this type of traffic (use with caution). | |
Time to take effect | Within 5 minutes. |