diff --git a/Makefile b/Makefile index b248acccfa..8148371339 100644 --- a/Makefile +++ b/Makefile @@ -955,7 +955,7 @@ OBJS += src/mux_h2.o src/mux_fcgi.o src/mux_h1.o src/tcpcheck.o \ src/base64.o src/auth.o src/uri_auth.o src/time.o src/ebistree.o \ src/dynbuf.o src/wdt.o src/pipe.o src/init.o src/http_acl.o \ src/hpack-huff.o src/hpack-enc.o src/dict.o src/freq_ctr.o \ - src/ebtree.o src/hash.o src/dgram.o src/version.o + src/ebtree.o src/hash.o src/dgram.o src/version.o src/flt_bwlim.o ifneq ($(TRACE),) OBJS += src/calltrace.o diff --git a/doc/configuration.txt b/doc/configuration.txt index 183710c357..7efefea303 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -120,6 +120,7 @@ Summary 9.4. Cache 9.5. fcgi-app 9.6. OpenTracing +9.7. Bandwidth limitation 10. FastCGI applications 10.1. Setup @@ -6322,6 +6323,7 @@ http-request [options...] [ { if | unless } ] - sc-inc-gpc1() - sc-set-gpt(,) { | } - sc-set-gpt0() { | } + - set-bandwidth-limit [limit ] [period ] - set-dst - set-dst-port - set-header @@ -6991,6 +6993,33 @@ http-request send-spoe-group The SPOE group name as specified in the engine configuration. +http-request set-bandwidth-limit [limit ] [period ] [ { if | unless } ] + + This action is used to enable the bandwidth limitation filter , either + on the upload or download direction depending on the filter type. Custom + limit and period may be defined, if and only if references a + per-stream bandwidth limitation filter. When a set-bandwidth-limit rule is + executed, it first resets all settings of the filter to their defaults prior + to enabling it. As a consequence, if several "set-bandwidth-limit" actions + are executed for the same filter, only the last one is considered. Several + bandwidth limitation filters can be enabled on the same stream. + + Note that this action cannot be used in a defaults section because bandwidth + limitation filters cannot be defined in defaults sections. In addition, only + the HTTP payload transfer is limited. The HTTP headers are not considered. + + Arguments: + Is a standard HAProxy expression formed by a sample-fetch followed + by some converters. The result is converted to an integer. It is + interpreted as a size in bytes for the "limit" parameter and as a + duration in milliseconds for the "period" parameter. + + Example: + http-request set-bandwidth-limit global-limit + http-request set-bandwidth-limit my-limit limit 1m period 10s + + See section 9.7 about bandwidth limitation filter setup. + http-request set-dst [ { if | unless } ] This is used to set the destination IP address to the value of specified @@ -7462,6 +7491,7 @@ http-response [ { if | unless } ] - sc-set-gpt(,) { | } - sc-set-gpt0() { | } - send-spoe-group + - set-bandwidth-limit [limit ] [period ] - set-header - set-log-level - set-map() @@ -7659,6 +7689,12 @@ http-response send-spoe-group This action is used to trigger sending of a group of SPOE messages. Please refer to "http-request send-spoe-group" for a complete description. +http-response set-bandwidth-limit [limit ] [period ] [ { if | unless } ] + + This action is used to enable the bandwidth limitation filter , either + on the upload or download direction depending on the filter type. Please + refer to "http-request set-bandwidth-limit" for a complete description. + http-response set-header [ { if | unless } ] This does the same as "http-response add-header" except that the header name @@ -12587,6 +12623,7 @@ tcp-request content [{if | unless} ] - sc-set-gpt(,) { | } - sc-set-gpt0() { | } - send-spoe-group + - set-bandwidth-limit [limit ] [period ] - set-dst - set-dst-port - set-log-level @@ -12780,6 +12817,13 @@ tcp-request content send-spoe-group Thaction is is used to trigger sending of a group of SPOE messages. Please refer to "http-request send-spoe-group" for a complete description. +tcp-request content set-bandwidth-limit [limit ] [period ] + [ { if | unless } ] + + This action is used to enable the bandwidth limitation filter , either + on the upload or download direction depending on the filter type. Please + refer to "http-request set-bandwidth-limit" for a complete description. + tcp-request content set-dst [ { if | unless } ] tcp-request content set-dst-port [ { if | unless } ] @@ -13147,6 +13191,7 @@ tcp-response content [{if | unless} ] - sc-set-gpt(,) { | } - sc-set-gpt0() { | } - send-spoe-group + - set-bandwidth-limit [limit ] [period ] - set-log-level - set-mark - set-nice @@ -13224,6 +13269,14 @@ tcp-response content send-spoe-group Thaction is is used to trigger sending of a group of SPOE messages. Please refer to "http-request send-spoe-group" for a complete description. + +tcp-response content set-bandwidth-limit [limit ] [period ] + [ { if | unless } ] + + This action is used to enable the bandwidth limitation filter , either + on the upload or download direction depending on the filter type. Please + refer to "http-request set-bandwidth-limit" for a complete description. + tcp-response content set-log-level [ { if | unless } ] This action is used to set the log level of the current session. Please refer @@ -23023,6 +23076,129 @@ filter opentracing [id ] config More detailed documentation related to the operation, configuration and use of the filter can be found in the addons/ot directory. +9.7. Bandwidth limitation +-------------------------- + +filter bwlim-in default-limit default-period