From nobody Tue Jan 31 02:13:52 2023 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P5TBd0Vlfz3c6fl for ; Tue, 31 Jan 2023 02:14:17 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5TBc4skDz3Fw7 for ; Tue, 31 Jan 2023 02:14:16 +0000 (UTC) (envelope-from eugen@grosbein.net) Authentication-Results: mx1.freebsd.org; none Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.16.1/8.16.1) with ESMTPS id 30V2ECmf049192 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Jan 2023 02:14:13 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: paul@gromit.dlib.vt.edu Received: from [10.58.0.11] (dadvw [10.58.0.11] (may be forged)) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 30V2ECc8079979 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 31 Jan 2023 09:14:12 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Slow WAN traffic to FreeBSD hosts but not to Linux hosts---how to debug/fix? To: Paul Mather , FreeBSD-STABLE Mailing List References: <95EDCFCA-7E3F-458F-85A6-856D606B9D98@gromit.dlib.vt.edu> From: Eugene Grosbein Message-ID: <150b0a33-5695-6d12-d86c-0fba0b40d265@grosbein.net> Date: Tue, 31 Jan 2023 09:13:52 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 In-Reply-To: <95EDCFCA-7E3F-458F-85A6-856D606B9D98@gromit.dlib.vt.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.6 X-Spam-Report: * -0.0 SHORTCIRCUIT No description available. * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hz.grosbein.net X-Rspamd-Queue-Id: 4P5TBc4skDz3Fw7 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N 31.01.2023 4:17, Paul Mather wrote: > TL;DR: When working from home, I can max out my residential 200 Mbit network connection when downloading from remote Linux hosts at $JOB but only manage about 20% of my max residential connection speed when downloading from remote FreeBSD hosts at $JOB. When at $JOB, both FreeBSD and Linux hosts have no problem saturating their GbE connections transferring between each other. Why is this and how can I debug and fix it? > > I have a 200 Mbit residential cable connection (Xfinity, 200 Mbit down/~10 Mbit up). I've noticed recently that I can easily get 10--20 MB/s download speeds when transferring data from Linux hosts at work but when I try to download that same data from the FreeBSD hosts I use the speed usually tops out at 3--4 MB/s. These are Linux and FreeBSD hosts that are on the same subnet at work. Transfers from the FreeBSD hosts at work (within-subnet and within-site) are fine and match those of the Linux hosts---often 112 MB/s. So, it just appears to be the traffic over the WAN to my home that is affected. The WAN path from home to this subnet is typically 15 hops with a typical average ping latency of about 23 ms. > > The FreeBSD hosts are a mixture of -CURRENT, 13-STABLE, and 13.1-RELEASE. I had done some TCP tuning based upon the calomel.org tuning document (https://calomel.org/freebsd_network_tuning.html), but removed those tuning settings when I noticed the problem but the problem still persists. The only remaining customisation is that the 13-STABLE has "net.inet.tcp.cc.algorithm=cubic". (I notice that -CURRENT now has this as default so wanted to try that on 13-STABLE, too.) The FreeBSD systems are using either igb or em NICs. The Linux systems are using similar hardware. None has a problem maintaining local GbE transfer speeds---it's only the slower/longer WAN connections that have problems for the FreeBSD hosts. > > It seems that Linux hosts cope with the WAN path to my home better than the FreeBSD systems. Has anyone else noticed this? Does anyone have any idea as to what is obviously going wrong here and how I might debug/fix the FreeBSD hosts to yield faster speeds? My workaround at the moment is to favour using the remote Linux hosts for bulk data transfers. (I don't like this workaround.) > > Any help/insight is gratefully appreciated. I bet speedy traffic does not cross any NAT boxes but perhaps you employ NAT at your own place. Both pfnat and ipfw nat are not compatible with TSO, also sometimes RX/TX checksum offload for NIC produce broken checksums, and all that creates excessive retransmissions and timeouts greatly reducing traffic speed. You may want to inspect traffic with Wireshark, as it shows retransmissions and generally anomalies with colors, or just go ahead and disable TSO and rxcsum/txcsum for external interface.