Forum Discussion
Camille_13254
Nimbostratus
Jun 01, 2009Implementing customized Rate Shape with iRules
Hello,
I need to find a strategy to implement a customized Rate Shape.
For example:
Total Bandwidth: 40MB/s
Rate Shaping for HTTP: 30MB/s
Rate Shaping for FTP : 10MB/s
If I only have HTTP traffic on their network I want to give all available bandwidth (40 MB/s) if needed. But if I have FTP traffic than I will limit the HTTP traffic to 30MB/s and for FTP I will limit to 10MB/s.
The same case. If I have FTP traffic (20MB/s) on my network. So if it exceeds 10MB/s there is no problem because we may have only 3MB/s for example to HTTP. In this case it can take more bandwidth for FTP, but if HTTP reaches 30MB/s so the FTP traffic will have to enforce it's limit (10MB/s).
This would be a more dynamic kind of QoS. Is it possible to make this with iRules?
Thanks in advance!
6 Replies
- JRahm
Admin
The rate shaping module is made specifically for this. Can tie in iRules with the rateclass command. - Colin_Walker_12Historic F5 AccountSo what you'd do is go through and configure your default rate classes, then assign different VIPS to those rate classes, meaning your FTP VIP to the FTP rateclass, etc. Then, as Elah said, if you want further granularity, you can bring iRules into the picture.
Colin - hoolio
Cirrostratus
Hi Dafa,
If you have separate virtual servers for HTTP and FTP, couldn't you just add the rate classes to each virtual server?
Aaron - Hamish
Cirrocumulus
Hi Defra.
What you want is 3 rate classes for this (If you're doing it statically).
1. global_rate. With 40Mbps (Assuming they meant Mbps and not MBps here...)
2. http_rate, a child of global_rate, with 30Mbps limit, but a burst of 40Mbps, no limit on the burst.
3. ftp_rate, a child of global_rate, with 10Mbps limit, (No burst allowed)
Then also set a minimum of 30Mbps and 10Mbps respectively on the http and ftp rate classes...
So what you should get here is http_rate able to burst to 40Mbps unless ftp_rate wants it. Because ftp_rate gets a guaranteed 10Mbps, the rate that http can get will be reduced by 10Mbps from the burstable 40Mbps down to the target 30Mbps. ftp has no burst so cant' go above 10Mbps, and http then gets the 30Mbps that is required.
Again, as hoolio suggested attach each rate to the respective VS's... More granularity requires more rate classes and an iRule to decide which of the rate classes the connection should be associated with. But if granularity is not required, then you don't need any iRules.
H - Danardono1
Nimbostratus
Hi Hamish and Hoolio,
For the granularity can we use irule like below?
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 80} {
rateclass rateshape_http
}
elseif { [TCP::local_port] == 21 } {
rateclass rateshape_ftp
}
else {
rateclass rateshape_other
}
}
Can we use this rateshaping on Linkcontroller to manage bandwidth for outgoing traffic? because Linkcontroller have 2 link ISP
Thanks in advance - hoolio
Cirrostratus
I'd suggest creating separate virtual servers for each protocol. HTTP, FTP and other protocols should have different TCP profiles with idle times and other customisations like persistence. Using a single virtual servers for all of them makes it a lot more complicated to do this. With separate virtual servers you'd be able to add a single rate class to each one without an iRule.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
