Set a bandwidth limit for uploads
You can limit the network bandwidth used when receiving data from a client. This limit is applied per stream and not at the connection level, meaning that for multiplexed protocols like HTTP/2, where a single connection can simultaneously transfer multiple requests and responses, each of those streams will have its own limit. The limit is expressed in bytes per second.
Use cases for this configuration include:
Limiting the bandwidth used when a client uploads a large file.
To set an upload speed limit:
frontendsection where you would like to enable the limit, add a
filter bwlim-indirective that sets
default-limitparameter sets the number of bytes that can be transferred during the interval defined by
The value 625000, which represents bytes, equals 5Mbps (0.625 megabytes per second = 5 megabits per second).
frontend myfrontend mode http bind :80 filter bwlim-in mylimit default-limit 625000 default-period 1s
http-request set-bandwidth-limitdirective, which enables the filter.
frontend myfrontend mode http bind :80 filter bwlim-in mylimit default-limit 625000 default-period 1s http-request set-bandwidth-limit mylimit
Optional: Edit the
http-request set-bandwidth-limitdirective or add another one to override the bandwidth limit when a given condition is true.
This example overrides the bandwidth limit if the URL path begins with
frontend myfrontend mode http bind :80 # Sets the normal bandwidth limit for uploads to 5 Mbps filter bwlim-in mylimit default-limit 625000 default-period 1s http-response set-bandwidth-limit mylimit # Overrides the upload bandwidth limit to be 10 Mbps # for any URL path that begins with /gaming acl is-gaming path_beg
/gaminghttp-request set-bandwidth-limit mylimit limit int(1250000) if is-gaming
Next upSet a bandwidth limit per backend