From owner-freebsd-net@FreeBSD.ORG Fri Jun 1 03:01:00 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22CDD16A400 for ; Fri, 1 Jun 2007 03:01:00 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: from sigma.octantis.com.au (ns2.octantis.com.au [207.44.189.124]) by mx1.freebsd.org (Postfix) with ESMTP id E051D13C44B for ; Fri, 1 Jun 2007 03:00:59 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: (qmail 11562 invoked from network); 1 Jun 2007 12:34:19 +1000 Received: from 203-214-138-113.perm.iinet.net.au (HELO localhost) (203.214.138.113) by sigma.octantis.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 1 Jun 2007 12:34:18 +1000 Date: Fri, 1 Jun 2007 12:34:11 +1000 From: Norberto Meijome To: Pang Message-ID: <20070601123411.2c81f57b@localhost> In-Reply-To: <465F1219.3080004@laws.ms> References: <465ED66F.30902@laws.ms> <37f6bd601e453b39a3f70c0e95be3876@75.126.162.136> <465F1219.3080004@laws.ms> X-Mailer: Claws Mail 2.9.2 (GTK+ 2.10.12; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Download speed and TCPIP window sizing X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 03:01:00 -0000 On Fri, 01 Jun 2007 02:21:13 +0800 Pang wrote: > Thanks for reply. >=20 > Nicolas Gieczewski wrote: > > On Thu, 31 May 2007 22:06:39 +0800, Pang wrote: > > =20 > >> Recently, I have leased a rack in Asianetcom and some bandwidth. > >> However, the speed for my curcuit is substantially slower than my > >> provider's company site. > >> [...] > >> *This server is using FreeBSD 6.2 patch 4 with Apache in the port tree. > >> The kernel is custom built but I haven't made any modification in sysc= tl > >> > >> I have asked many techs in Asianetcom and they blamed on TCPIP window > >> sizing. > >> =20 > > > > I used to have the same problem with my FreeBSD dedicated servers in th= e U.S. when I was living in South America with a latency of ~200 ms. Given = identical hardware and connectivity, I could max out my download speed when= downloading from a server running Linux, but would get no more than 100-15= 0 KB/s when downloading from an otherwise identical FreeBSD box. > > > > The solution was to increase the size of the TCP send window on the Fre= eBSD server to about 128 KB--the default of 32 KB turned out to be way too = small. > > > > # sysctl net.inet.tcp.sendspace=3D131072 > > > > After modifying this value, you need to restart any processes (e.g. Apa= che) that you want to take advantage of the change. > > =20 >=20 > It doesn't work. I am still getting ~10KB/s speed. >=20 hmm in some FBSD (6.0-STABLE) that we have in NL i have that set to 64K . F= rom AU (where I live), 320 ms of ping away, i can almost saturate my meagre DSL link (got up to 2mpbs).=20 There can be several things involved in bad download speeds - from the TCP stack of the OS , the software you use to serve (I'm assuming Apache is configured out of the box - it's not great, but should be better than this.= ), NIC in the server, the network segment where it's located (in the DC, upstream,etc), bandwidth limiting upstream or in apache itself,etc... .I tested that download of yours from different parts of the world, it was pretty bad from everywhere - I've captured the traffic from each download: http://www.meijome.net/files/freebsd/test_hk_dl/fbsd_hk_test_from_au.cap =46rom AU , between 204 and 206 ms ping. http://www.meijome.net/files/freebsd/test_hk_dl/fbsd_hk_from_NL.cap Your file in HK downloaded from NL - ping time to HK =3D 329 ms http://www.meijome.net/files/freebsd/test_hk_dl/fbsd_hk_from_txusa.cap Your file in HK, downloaded from a linux server (RHES 3) in TX, USA. ping t= ime avg 227. http://www.meijome.net/files/freebsd/test_hk_dl/fbsd_NL_test_from_au.cap the same file, which I uploaded to a FBSD in NL (as mentioned above). Ping = time is about 320 ms to this box from home. Probably as fast as I'd expect it to= be. I know I can transfer about up of 8 Mbps between the USA and NL hosts, so that test is not going to prove anything more. I haven't got time right now to review all the captures, but at first sight= it seems there's more packet loss than you'd expect, duped ACKs,etc. The IO , = RTT and throughpouts graphs (i'm using wireshark) definitely show very poor performance, though. I dont see any relation betwen ping times and download speed. BTW, how fast can you download this file from the server you say it's in the same network segment ?=20 Have you got polling enabled? what hardware / nic ?=20 HIH, Beto _________________________ {Beto|Norberto|Numard} Meijome "It's not what you do, it's the love you put into it." Mother Theresa. I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.