FTP load balancing?

From: Alberto Giménez <lagimenez#gmail.com>
Date: Wed, 21 May 2008 20:58:20 +0200


Hi,

I've found a problem trying to balance FTP servers (well, really just use a FTP server and a backup one through the haproxy box). I'm currently using a kernel patched with cttproxy (2.0.6) to provide transparent proxy support and haproxy 1.3.14.

FTP sessions hang when a data connection must be opened. This is true for active mode, and I guess the problem is because of the FTP protocol itself:

client (control connection) ---> haproxy ----> backend FTP server client (data connection) (port X) -----> haproxy (port 20)

                                                      haproxy (port Y)

-----> backend FTP server (port 20)
haproxy (port Y)
<------ backend FTP server (port 20)

And then haproxy doesn't forward "port Y" to "port X" on the client, so data connection is lost on haproxy box and the client "hangs" waiting for a response.

Using passive mode works, because backend server tells the client directly what port to use (and his real IP, not the balanced one!).

I'm not sure if telling the customers to "force passive mode on their

FTP clients" is a very polite option but... I wonder if anyone had the
same problem and found a solution for it. I have not found anything
about haproxy + ftp balancing on the net. Some references to other
load balancers but no real clue.

Thanks in advance.

--
Alberto Giménez
Received on 2008/05/21 20:58

This archive was generated by hypermail 2.2.0 : 2008/05/21 21:00 CEST