Re: change accept() behaviour under maxconn

2022-11-02 Thread Christopher Faulet

Le 10/20/22 à 07:47, William Dauchy a écrit :

Hello,

I was looking at maxconn behaviour on frontend side. I understood we
don't trigger accept() once maxconn is reached
https://git.haproxy.org/?p=haproxy.git;a=blob;f=src/listener.c;h=412af94a160662aa11802dd58512c6410c9b56da;hb=HEAD#l920
I wondered whether it would be an acceptable patch to add an option in
order to accept() and close() the connection right after during such
event. The context would be to "fail fast" on some environment where
it is preferable to let know the client as soon as possible we can't
accept the connection. In an environment where the haproxy instance is
the second level of proxies, we want to fail fast instead of waiting
for the end of tcp timeout to connect.

Thanks,


Hi William,

Sorry for the delay ! It is probably not so handy to configure but you may use a 
"tcp-request connection reject" with an ACL based on fe_conn sample fetch (or 
any other sample).


--
Christopher Faulet




change accept() behaviour under maxconn

2022-10-19 Thread William Dauchy
Hello,

I was looking at maxconn behaviour on frontend side. I understood we
don't trigger accept() once maxconn is reached
https://git.haproxy.org/?p=haproxy.git;a=blob;f=src/listener.c;h=412af94a160662aa11802dd58512c6410c9b56da;hb=HEAD#l920
I wondered whether it would be an acceptable patch to add an option in
order to accept() and close() the connection right after during such
event. The context would be to "fail fast" on some environment where
it is preferable to let know the client as soon as possible we can't
accept the connection. In an environment where the haproxy instance is
the second level of proxies, we want to fail fast instead of waiting
for the end of tcp timeout to connect.

Thanks,
-- 
William