From owner-freebsd-questions@FreeBSD.ORG Wed Jun 30 18:13:33 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB7DD16A4CE for ; Wed, 30 Jun 2004 18:13:33 +0000 (GMT) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.86]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FEF043D3F for ; Wed, 30 Jun 2004 18:13:33 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id i5UIDWrT009948; Wed, 30 Jun 2004 11:13:32 -0700 (PDT) Received: from [10.1.1.193] (nfw2.codefab.com [199.103.21.225] (may be forged)) (authenticated bits=0)i5UIDVTv002831; Wed, 30 Jun 2004 11:13:32 -0700 (PDT) In-Reply-To: <20040629230817.0f6d230e.wmoran@potentialtech.com> References: <20040629140231.7b57dedf.wmoran@potentialtech.com> <1187B403-C9FC-11D8-99F8-003065ABFD92@mac.com> <20040629153855.300b3888.wmoran@potentialtech.com> <1133CD52-CA07-11D8-99F8-003065ABFD92@mac.com> <20040629230817.0f6d230e.wmoran@potentialtech.com> Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <31116F58-CAC1-11D8-9B33-003065ABFD92@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Wed, 30 Jun 2004 14:13:30 -0400 To: Bill Moran X-Mailer: Apple Mail (2.618) cc: questions@freebsd.org Subject: Re: REPOST: Performance problems with FTP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2004 18:13:33 -0000 On Jun 29, 2004, at 11:08 PM, Bill Moran wrote: > Charles Swiger wrote: >> Well, that does tend to rule out a bunch of issues. Have you tried >> changing the MTU of the FreeBSD box down to 1400 or so (or even 512), >> just to see whether that does anything? > > OK. I've had a bit of success here ... > > By setting the MTU down to ~650, I get the best performance I've seen > with this setup (about 27k/sec ... which isn't too bad) I set > "SocketOptions maxseg 650" in the proftpd.conf file for now, which > seems > to help a good bit. Bingo, found something! All should be easy from here on out... :-) > But I'm really confused. Why does reducing the MTU improve > performance? > I would have thought it would hurt performance by increasing the # of > packets, thus increasing overhead. Using a smaller MTU normally does hurt performance, as you have to send more packets (as you've said) and because the overhead (ratio of packet header size to data size) becomes larger. However, using an MTU which is too big means packets have to be fragmented and reassembled, which slows things down a lot, too. Anyway, it is likely that one of the networks involved in the connection has a smaller MTU than normal, which means large data packets get fragmented, resulting in delays. FTP data connections tend to show this more than scp does, as the latter seems to vary the packet size more: perhaps a result of using compression/encryption within the SSH protocol. > I did some captures using Ethereal, and I'm seeing a weird pause (with > the MTU at the default) where the client will send three packets, > there'll > be a pause, then the ack comes back, then three packets, pause, ack ... That rings a bell. Are you using path MTU discovery? Is some firewall in place that might be blocking ICMP_UNREACH_NEEDFRAG messages (ICMP type 3, subtype 4)? You should try doing a traceroute which can do pMTU testing; I'm not sure whether the stock FreeBSD traceroute can do this, but a search ought to dig up something. -- -Chuck