From owner-freebsd-net@FreeBSD.ORG Wed Jan 25 07:25:59 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40046106566B for ; Wed, 25 Jan 2012 07:25:59 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C82818FC13 for ; Wed, 25 Jan 2012 07:25:58 +0000 (UTC) Received: by werg1 with SMTP id g1so5749687wer.13 for ; Tue, 24 Jan 2012 23:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=psmRduNMyl+F3+zGcHdNvIhlc22qivJn2beBMyPXG2w=; b=R1fSQisQgC3Q1nwlVPio0YSpJSBCO4sO6mipRnXhc0tK9aip4m/xIycZRvM2IP58Dg f205sjt0oYcOXjS5AQI2f73l+JL/+oO4PGFPgyN1FxTBlh9QT3r4YtxhxFnM/8CS7uG4 22ZYtY4iviIdC4B6PPOJb3x0oe/W0clt1T1xs= MIME-Version: 1.0 Received: by 10.216.132.211 with SMTP id o61mr2261016wei.58.1327474461208; Tue, 24 Jan 2012 22:54:21 -0800 (PST) Received: by 10.223.101.196 with HTTP; Tue, 24 Jan 2012 22:54:21 -0800 (PST) In-Reply-To: <4F1F92DE.9060200@zhegan.in> References: <4F1F92DE.9060200@zhegan.in> Date: Tue, 24 Jan 2012 22:54:21 -0800 Message-ID: From: Kevin Oberman To: "Eugene M. Zheganin" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org Subject: Re: low network speed 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: Wed, 25 Jan 2012 07:25:59 -0000 On Tue, Jan 24, 2012 at 9:27 PM, Eugene M. Zheganin wrote: > Hi. > > I'm suffering from low network performance on one of my FreeBSDs. > I have an i386 8.2-RELEASE machine with an fxp(4) adapter. It's connected > though a bunch of catalysts 2950 to another 8.2. While other machines in > this server room using the same sequence of switches and the same target > source server (which, btw, is equipped with an em(4) and a gigabit link bia > catalyst 3750) show sufficient speed, this particular machine while using > scp starts with a speed of 200 Kbytes/sec and while copying the file shows > speed about 600-800 Kbytes/sec. > > I've added this tweak to the sysctl: > > net.local.stream.recvspace=196605 > net.local.stream.sendspace=196605 > net.inet.tcp.sendspace=196605 > net.inet.tcp.recvspace=196605 > net.inet.udp.recvspace=196605 > kern.ipc.maxsockbuf=2621440 > kern.ipc.somaxconn=4096 > net.inet.tcp.sendbuf_max=524288 > net.inet.tcp.recvbuf_max=524288 > > With these settings the copying starts at 9.5 Mbytes/sec speed, but then, as > file is copying, drops down to 3.5 Megs/sec in about two-three minutes. > > Is there some way to maintain 9.5 Mbytes/sec (I like this speed more) ? > > > Thanks. > Eugene. > > P.S. This machine also runs zfs, I don't know if it's important but I > decided to mention it. 9.5 MBytes? That's 76 Mbps which is reasonable. 28 Mbps is not, but it's too good to make be think it's a duplex mis-match, but it's probably worth checking. Look at the output of 'sysctl dev.fxp.0.stats'. See if you are getting framing and CRC errors. If this does not point at something, a packet capture of header and tcptrace may show the cause of the problem, but the output is not easy to understand. tcptrace is in ports. You could also look at the capture with wireshark. It won't tell as much, but will flag errors and "unusual" activity. Both tools are in ports. -- R. Kevin Oberman, Network Engineer E-mail: kob6558@gmail.com