Understanding maxconn and maxonnrate and delays

No, that’s not about FIN_WAIT. It’s the timeout for half-closed connections. client-fin will default to timeout client and server-fin will default to timeout tunnel, if not configured.

Yes, that’s what I’m recommending.

You first of all have to make sure your maxconn configuration matches the actually available RAM, this will avoid swapping and probably reduce CPU usage. Second of all fixing timeouts will make sure you don’t have tens of thousands of connections idling around, occupying lots of RAM.

maxconnrate and maxsessrate will only slow down new requests, which is the wrong thing to do, because a) you want to fix your 50 second delay problem, right? and b) because when you don’t accept connections the just will pile up in the queue and either get dropped or get delayed.

Also, I still don’t know how maxconn is actually configured across the front and backends. Please provide the actual configuration, as I cannot continue to guess what you configured. For example, share the actual configuration of your busiest frontend and backend please.