Can I limit bandwidth (download / upload)?
Short answer
Yes. The total traffic of the vService going to the clients is limited with Details → Bandwidth → Total limit; this field exists in HTTP and L7 TCP vServices and covers only the download direction. If separate limits for download and upload, or per-user or condition-based limiting, are needed, the Bandwidth Limitation action is used on the HTTP vService. Limiting by country or network type is done in the Country Control card of L7 DDoS Protection, and limiting by bot policy is done in AGS Bot Protection Policies. When the limit is exceeded, the traffic is not blocked; it is slowed down.
Problem: A Service or User Consumes All of the Bandwidth
When large file downloads, backup traffic or the heavy usage of a single user fill the entire line, the other services and users slow down. The traffic is wanted to be limited on a vService, user or request type basis.
Solution: Five Methods
| Your situation | Suitable method |
|---|---|
| The total download traffic of the vService | Method 1: Details → Bandwidth → Total limit |
| Download and upload, per user or condition-based | Method 2: Bandwidth limitation action |
| By country or network type (L7 DDoS protection) | Method 3: L7 DDoS Protection → Bandwidth limit |
| By bot policy on an AGS-enabled vService | Method 4: AGS Bot Protection Policies → Bandwidth Limit |
| From the command line | Method 5: WEB-CLI |
Method 1: Details → Bandwidth → Total Limit Recommended
- How it works All the clients of the vService share a single download limit.
- Where it is openedLoad Balancer → Load Balancer vService List → vService → Edit → Details → Bandwidth
- Requirement None
- vService type HTTP · L7 TCP
Step-by-Step Configuration
On the Load Balancer → Load Balancer vService List screen, the vService is selected and Edit is clicked.
A value is written in the Total Limit field and the unit (Kbps, Mbps, Gbps) is selected; the range is 1 Kbps – 32 Gbps.
Save is clicked. The change is applied without dropping open connections. In a cluster, it is also sent to the peer device with the default auto-sync; if Manual Sync Mode is on, it is sent with Synchronize.
Verification
The download speed is measured with curl -o /dev/null -w '%{speed_download}\n' https://www.example.com/buyuk-dosya (the result is in bytes/second).
Speed around the limitThe limit is seen in the Resources section of the Load Balancer Management tab of the vService; the Frontend Bandwidth chart on the dashboard flattens at the limit.
The defined Total limitMethod 2: Bandwidth Limitation Action
- How it works Separate limits are applied for download and upload; in the Dynamic type, requests with the same key (e.g. the client IP) share the limit, and in the Stream type, each stream gets a separate limit.
- Where it is openedLoad Balancer → Actions → Add → Bandwidth Limitation
- Requirement If TR7 is behind a CDN or proxy, the real IP must be resolved before the client IP is made the key
- vService type HTTP
Step-by-Step Configuration
Load Balancer → Actions → Add is clicked (how to add); the Action Name is entered, and Action Type = Bandwidth Limitation is selected.
Download Limit and/or Upload Limit is entered; at least one of them is required.
Limit Type = Dynamic (default) or Stream is selected. In Dynamic, the grouping Smart Variable (e.g. the client IP) is selected with fx in the Key field.
If only certain paths will be limited, a condition is selected in the Conditions field; if the condition is empty, the action is applied to all the traffic of the vService.
Add is clicked.
On the Load Balancer → Load Balancer vService List screen, the HTTP vService is selected and Edit is clicked.
The action is selected in the Details → Actions field.
Save is clicked. The change is applied without dropping open connections; in a cluster, it is also sent to the peer device with the default auto-sync.
Verification
The download speed is measured with curl -o /dev/null -w '%{speed_download}\n' https://www.example.com/buyuk-dosya.
Speed around the Download limitMethod 3: L7 DDoS Protection → Bandwidth limit
- How it works A bandwidth limit is applied to the traffic that matches the country or network type rules of the L7 DDoS protection.
- Where it is openedLeft Monitor Panel → Bot/DDoS Protected vServices → vService → Bot/DDoS Management → L7 DDoS Protection
- Requirement L7 DDoS & Threat Protection must be on in the vService and DDoS protection must be Active
- vService type HTTP · L7 TCP
Step-by-Step Configuration
If the protection is not on in the vService, the vService is edited, and the L7 DDoS & Threat Protection box under Details is checked and saved; for more than one vService, Enable is used in the protected vService list in the Bot/DDoS menu (two ways). When the protection is turned on, IP Reputation Protection starts in Active mode (starting modes).
The Left Monitor Panel → Bot/DDoS Protected vServices → vService → Bot/DDoS Management tab is opened (accessing the screen).
With the Edit link of the L7 DDoS Protection card, DDoS Protection = Active is selected; in the default Monitor, actions are only recorded and the traffic is not limited.
The window is opened with the pencil icon of the Country Control block, and a rule row is added with Rules → + Add (Country Control Edit screen). For limiting by network type, the same operation is done in the Network Type Group Control block.
Match and the countries are selected.
Action = Bandwidth limit is selected and Bandwidth limit (Mbit/s) is entered (default 10).
The window is saved.
Verification
The DDoS bandwidth limiting chart on the Bot/DDoS dashboard is checked.
The limited traffic appearsMethod 4: AGS Bot Protection Policies → Bandwidth Limit
- How it works On an AGS-enabled vService, the bot policy applies a download and upload limit to the matching clients.
- Where it is openedAGS → Protection Policies → Bot Protection Policies
- Requirement AGS-enabled vService
- vService type HTTP
Step-by-Step Configuration
If AGS is not on in the vService, it is turned on with Enable in the enabled vService list in the AGS menu or from the Details list of the vService form (two ways). When AGS is turned on, users do not reach the Backend Service until the default login flow is edited.
AGS → Protection Policies → Bot Protection Policies → Add is clicked (how to add); the Bot Protection Policy Name is entered and the Trigger Type is selected.
Action = Bandwidth Limit is selected; Download Limit (kbps) and Upload limit (kbps) are entered.
Add is clicked.
In the AGS Management tab of the vService, the Edit link of the Protection section is clicked; the Edit / Protection window opens.
The policy is selected in the Bot Protection Policies field.
The window is saved.
Verification
The download speed is measured with curl -o /dev/null -w '%{speed_download}\n' https://www.example.com/buyuk-dosya from a client for which the policy is triggered.
Speed around the Download limitMethod 5: WEB-CLI
- How it works The total download limit of the vService (Method 1) is turned on from the command line.
- Where it is opened TR7 WEB-CLI →
lb service update - Requirement WEB-CLI access; the value is an integer in Kbps (1 Mbps = 1024 Kbps, at most 33554432)
- vService type HTTP · L7 TCP
Step-by-Step Configuration
For 100 Mbps (protection and processing switches):
lb service update id <vService> --bw true --downloadBwPool 102400Verification
The download speed is measured with curl -o /dev/null -w '%{speed_download}\n' https://www.example.com/buyuk-dosya.
Speed around the limitCommon Mistakes
- Expecting a speed-up from Bandwidth. These features limit the traffic; for acceleration, caching and compression are used.
- Thinking that Total limit also limits the upload. Details → Bandwidth covers only the direction going to the client; for upload, the Upload limit field of the Bandwidth limitation action is used.
- Selecting the client IP as the Key behind a proxy. If TR7 is behind a CDN or proxy, all users share the same IP; first, the real client IP is resolved (There is a CDN such as Cloudflare / Akamai in front of TR7; how do I get the Real client IP (trusted proxy)?).
- Mistaking the notification threshold for a limit. The bandwidth value in the Notification profile is a warning threshold; it does not limit the traffic.
- Adding the action without a condition. If the condition is empty, the limit is applied to all the traffic of the vService.
How it is done in the documentation
