# HA Proxy Confg Long Timeout

**URL:** <https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473>\
**Category:** Help!\
**Created:** [July 28, 2017, 11:58am UTC](https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473 "2017-07-28T11:58:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevepe](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@stevepe](https://discourse.haproxy.org/u/stevepe)\
**Post date:** [July 28, 2017, 11:58am UTC](https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473/1 "2017-07-28T11:58:58Z")

</div>

Hi… what are Pro & Con for Long time out?  
defaults  
log global  
timeout server 5s  
timeout connect 5s  
timeout client 5s

Vs.

defaults  
log global  
timeout server 50000s  
timeout connect 5000s  
timeout client 50000s

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [July 30, 2017, 7:24pm UTC](https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473/2 "2017-07-30T19:24:54Z")

</div>

Its pretty much always a bad idea to set high timeouts.

Cons are:

- as more concurrent sessions are used, you need higher maxconn values and therefor more memory
- if set maxconn higher than your box has RAM for it, your kernel will OOM kill haproxy
- if set maxconn too low, you will saturate maxconn and new connections attempts won’t be answered
- whatever maxconn, the higher the timeouts are, the easier it is for an attacker to DDoS your setup

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [July 31, 2017, 8:14am UTC](https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473/3 "2017-07-31T08:14:59Z")

</div>

I would add to Lukas response that there is no good reason to have a long “timeout connect”.  
This value matches the time between a TCP SYN and a SYN/ACK on the network between HAProxy and the server.

---

<div class="post-metadata">

**Author:** ![stevepe](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@stevepe](https://discourse.haproxy.org/u/stevepe)\
**Post date:** [August 27, 2017, 5:43am UTC](https://discourse.haproxy.org/t/ha-proxy-confg-long-timeout/1473/4 "2017-08-27T05:43:11Z")

</div>

Thank you both of you.
