Hi Paul, Le Mercredi 13 Janvier 2010 22:15:51, Willy Tarreau a écrit : > On Wed, Jan 13, 2010 at 12:31:09PM -0800, Paul Hirose wrote: > > (...) > > So I > > do have trouble with connections of a long duration but where there is > > little actual data. Usually some client application that makes a > > connection once at the start and then goes idle waiting for some input > > from a client of its own. If anyone might know how to keep such an > > idle (but still valid) connection alive (other than a gigantic > > timeout), I'd love suggestions. > > You have no other possibility. What you want is to maintain open a > connection eventhough nothing happens at the application level for > a very long period. That's what the timeout is made for. People > balancing TSE farms or LDAP servers are well aware of the same > requirement :-)
This is the application job, or (better) a connection pool job. Some connection pools allow to periodically check unused connections by sending a small request (like "SELECT 1"), this will maintain alive the connections by sending data on the network : the firewall, if there's one, will be aware to not drop the session and your connection time will be reset to 0 on the mysql server side (will not expire due to a short wait_timeout value). You'll then have to adjust timeouts in your connection pool, in haproxy and in mysql to keep all this things stable. -- Cyril Bonté

