QoS Rule Examples
Use the following examples to help design your own QoS rules.
Basic rate limiting
The following QoS rule sets a rate limit of 50 s3.PutObject requests per second with a burst of 10.
The rule applies to all objects in the bucket and has the highest priority.
version: "v1"
rules:
- id: "limit-put-operations"
label: "Rate limit for PUT operations"
priority: 1
objectPrefix: ""
api: "s3.PutObject"
rate: 50
burst: 10
limit: "rps"
Prefix-specific limits
The following rules set different kinds of limit for different prefixes.
The first rule operates on the logs/ prefix and sets a rate limit of 200 s3.PutObject requests per second, with a burst of 50.
The second rule operates on the media prefix and sets a concurrency limit of 10 uploads at the same time.
version: "v1"
rules:
- id: "logs-upload-limit"
label: "Rate limit for log uploads"
priority: 1
objectPrefix: "logs/"
api: "s3.PutObject"
rate: 200
burst: 50
limit: "rps"
- id: "media-upload-limit"
label: "Concurrency limit for media uploads"
priority: 2
objectPrefix: "media/"
api: "s3.PutObject"
rate: 10
limit: "concurrency"
Wildcard API matching
The following rule sets a rate limit of 500 s3.GET* requests per second with a burst of 100.
The rule applies to all objects in the bucket and has the highest priority.
version: "v1"
rules:
- id: "all-get-operations"
label: "Rate limit for all GET operations"
priority: 1
objectPrefix: ""
api: "s3.GET*"
rate: 500
burst: 100
limit: "rps"
Complex multi-rule configuration
The following rules enforce different kinds of limit for different prefixes and for different levels of granularity.
The first rule operates on the critical/ prefix and sets a concurrency limit of 5 uploads at the same time.
This rule has the highest priority.
The second rule operates on the archive/ prefix and sets a rate limit of 20 s3.PutObject requests per second with a burst of 5.
The third rule operates on the uploads/ prefix and sets a rate limit of 100 s3.PUT* requests per second with a burst of 30.
The fourth rule operates on all prefixes in the bucket and sets a rate limit of 50 s3.LIST* requests per second with a burst of 20.
The last rule, with the lowest priority, operates on all prefixes in the bucket and sets a rate limit of 30 sftp.PUT requests per second with a burst of 10.
version: "v1"
rules:
# Highest priority - Critical data operations
- id: "critical-data-concurrency"
label: "Concurrency limit for critical data"
priority: 1
objectPrefix: "critical/"
api: "s3.PUT*"
rate: 5
limit: "concurrency"
# High priority - Archive operations
- id: "archive-rate-limit"
label: "Rate limit for archive operations"
priority: 2
objectPrefix: "archive/"
api: "s3.PutObject"
rate: 20
burst: 5
limit: "rps"
# Medium priority - General uploads
- id: "general-upload-limit"
label: "General upload rate limit"
priority: 3
objectPrefix: "uploads/"
api: "s3.PUT*"
rate: 100
burst: 30
limit: "rps"
# Lower priority - List operations
- id: "list-operations-limit"
label: "Rate limit for list operations"
priority: 4
objectPrefix: ""
api: "s3.LIST*"
rate: 50
burst: 20
limit: "rps"
# Lowest priority - SFTP operations
- id: "sftp-operations-limit"
label: "Rate limit for SFTP operations"
priority: 5
objectPrefix: ""
api: "sftp.PUT"
rate: 30
burst: 10
limit: "rps"
Multipart upload controls
The following rules set different kinds of limit for for different APIs for multipart uploads.
The first rule operates on the logs/ prefix and sets a rate limit of 200 s3.PutObject requests per second, with a burst of 50.
The second rule operates on the media prefix and sets a concurrency limit of 10 uploads at the same time.
version: "v1"
rules:
- id: "multipart-init-limit"
label: "Limit multipart upload initiations"
priority: 1
objectPrefix: "large-files/"
api: "s3.NewMultipartUpload"
rate: 10
limit: "concurrency"
- id: "multipart-part-limit"
label: "Rate limit for multipart part uploads"
priority: 2
objectPrefix: "large-files/"
api: "s3.UploadPart"
rate: 200
burst: 50
limit: "rps"
Priority examples
The following rules set different priorities for prefixes and API operations based on how important they are.
The first rule operates on the critical/important/ prefix and sets a rate limit of 10 s3.PutObject requests per second, with a burst of 2, and the highest priority.
The second rule operates on the critical/ prefix and sets a rate limit of 50 s3.PUT* requests per second, with a burst of 10.
The third rule operates on all prefixes in the bucket and sets a rate limit of 100 s3.PUT* requests per second, with a burst of 25.
version: "v1"
rules:
# Priority 1: Most specific rule (wins over lower priority)
- id: "specific-critical-limit"
priority: 1
objectPrefix: "critical/important/"
api: "s3.PutObject"
rate: 10
burst: 2
limit: "rps"
# Priority 2: Less specific rule
- id: "general-critical-limit"
priority: 2
objectPrefix: "critical/"
api: "s3.PUT*"
rate: 50
burst: 10
limit: "rps"
# Priority 3: Catch-all rule
- id: "default-limit"
priority: 3
objectPrefix: ""
api: "s3.PUT*"
rate: 100
burst: 25
limit: "rps"