HAPROXY timeout client timeout server and Mysql net_read_timeout net_write_timeout
I read in https://severalnines.com/resources/tutorials/mysql-load-balancing-haproxy-tutorial
- connect_timeout - Default is 10s
- deadlock_timeout_long - Default is 50000000s
- deadlock_timeout_short - Default is 10000s
- delayed_insert_timeout - Default is 300s
- innodb_lock_wait_timeout - Default is 50s
- interactive_timeout - Default is 28800s
- lock_wait_timeout - Default is 31536000s
- net_read_timeout - Default is 30s
- net_write_timeout - Default is 60s
- slave_net_timeout - Default is 3600s
- thread_pool_idle_timeout - Default is 60s
- wait_timeout - 28800s
Our recommendation is to configure the net_read_timeout and net_write_timeout value with the same value as for timeout client and timeout server in HAProxy configuration file.
HAProxy in S9 Cluster control is however set with these values:
timeout client 10800s
timeout server 10800s
if I understand the documentation, mysql values should then be
- net_read_timeout = 10800s
- net_write_timeout = 10800s
may anybody confirm that ?
Yes, that's precisely what the recommendation is.
To make it clear, the idea is to keep timeouts the same on both ends as otherwise it may be annoying to debug issues - you will look at the timeouts in MySQL and scratch your head while issue is triggered by HAProxy settings (or the other way around). You can as well make a change in the HAProxy, if that suits you better.
Please keep in mind that there's no magic number which is the best setting for given variable. In one case longer timeouts may work better, in other case you would prefer shorter ones. This is up to you to decide what is the best setting for your environment, application and workload. It doesn't have to me 10800 seconds. It may be 30, 60, 3600 or anything else.
Please sign in to leave a comment.