haproxy and mysql : hints about timeout configuration?

From: Florian Iragne <florian.iragne#viewsurf.com>
Date: Mon, 29 Aug 2011 10:12:23 +0200


Hi,

i've setup haproxy to balance mysql connections to my backend servers. The setup i fairly simple : 2 servers in master-master replication, one is the default server, the second is declared as backup in haproxy.

It runs quite smoothly for my php apps (90% of my apps). However, i does not work correctly for a java app i have (i tells me that there's a communication failure). I suspect a problem with persistent connections through haproxy. Are there any specific timeouts values to adjust for such a use case (i.e., haproxy with mysql). I didn't find anything specific when i first search over the web

here is my current config :

global

   log 127.0.0.1 local0 warning
   maxconn 32000
   ulimit-n 65536
   user haproxy
   group haproxy
   spread-checks 3

defaults

   log global
   mode http
   option httplog
   option dontlognull
   option logasap
   retries 3
   option redispatch
   timeout connect 5s
   timeout client 10s
   timeout server 60s
   timeout http-request 30s
   timeout queue 60s

listen sqlfarm-1 10.0.100.2:3306

   mode tcp

         timeout server 600s
         timeout check 10s
         option tcplog

   default_backend mysql

backend mysql

   mode tcp
   option tcpka
   option httpchk
   server app0_1 10.0.1.17 maxconn 500 check port 9200 inter 5s fall 10 rise 1

   server app0_2 10.0.0.17 maxconn 500 check port 9200 inter 5s fall 10 rise 1 backup

thanks for your help

Florian Received on 2011/08/29 10:12

This archive was generated by hypermail 2.2.0 : 2011/08/29 10:15 CEST