file transfer quirks

Lecar_red on 2005-06-03T20:48:38

Over the the last week, we have had issues with a newly deployed web based file transfer system written in Perl/mod_perl/Mason. To cluster/load balance the web servers we need to run a magic middleware system the receives incoming files with ftp. (Basically web uploads are turned into ftp transfers to central middleware). We run proftpd on the MW and use Net::FTP inside the web app. For the last couple of days we have begun to see data connections start to stall causing the transfers to stop working. Strangely, it seems to happen for only one webserver and the same file will transfer in the next submission is fine. And of course, I cannot replicated it with many sends from my desktop. After pulling hair and not finding anything suspect, in the code, proftp or the network (according to the Ops folk there is nothing in between but a switch no firewall, not extra network problem generator...). Today we switched over to using passive mode to transfer the files and so far so good. I don't really know why this would happen unless there was something about having inbound connections come into a process running as part of apache but I would expect this to cause rejections not stalled sockets after some amount of data transfer. The one thing I really like about this whole deal was to have Net::FTP use passive mode all it took was adding the following line to the apache configuration (No Code Changes, Yeah!)

SetEnv FTP_PASSIVE 1

Then we danced and drank beer. Well... there really wasn't any dancing in public.