Hello,

Can somebody the http_req_rate counter still counts requests with the
following configuration even after all the traffic starts coming through
"error" backend only?

frontend all-requests 0.0.0.0:80
        tcp-request content track-sc0 fe_id() table es_backend
        use_backend error_429 if { sc_http_req_rate(0) gt 9 }
backend es_backend
        stick-table size 1 expire 10s type integer store http_req_rate(10s)
backend error_429
    mode http
    errorfile 429 /etc/haproxy/errors/429rate.http

I expect http_req_rate to be decreased once the traffic goes to another
backend (error_429 in my case). Am I missing something and how it can be
achieved?

Any advice appreciated.

Kind regards,

On Sat, Aug 13, 2016 at 9:56 PM, Artem Lalaiants <[email protected]>
wrote:

> Hi Lukas,
>
> The thing is I need to return a custom error page with a certain http
> code if the rate is exceeded. However, limiting maxconn value
> doesn't allow me to operate on http level obviously.
>
> The way it works is pretty much what I need if only the counter could be
> dropped every 10 seconds.
>
>
> On Friday, 12 August 2016, Lukas Tribus <[email protected]> wrote:
>
>> Hello,
>>
>>
>> Am 12.08.2016 um 17:01 schrieb Artem Lalaiants:
>>
>>> Hello,
>>>
>>> I'm trying to limit traffic based on the amount of http requests load
>>> balancer handles at the moment.
>>>
>>
>> The way to do this is to use maxconn on the various parts of haproxy
>> (backend, frontend, servers etc). This also includes a global maxconn
>> value. Haproxy is engineered to handle "maxconn" load, and will do the
>> right thing if that value is exceeded.
>>
>> I don't think doing this manually is a good idea.
>>
>>
>>
>> Lukas
>>
>>
>
> --
> Artem Lalaiants
> Infrastructure Engineer, GeoComply
> skype: artem.kharkov
> www.geocomply.com
>
>


-- 
Artem Lalaiants
Infrastructure Engineer, GeoComply
skype: artem.kharkov
www.geocomply.com

-- 
 

*CONFIDENTIALITY NOTICE: The information contained in this email message is 
intended only for use of the intended recipient. If the reader of this 
message is not the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please 
immediately delete it from your system and notify the sender by replying to 
this email.*

Reply via email to