From nobody Fri Aug 11 11:21:33 2023 X-Original-To: freebsd-hackers@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 4RMhFk1Qdgz4pwdT for ; Fri, 11 Aug 2023 11:21:46 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:7400:8808:123::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4RMhFh5zGcz3ZtP for ; Fri, 11 Aug 2023 11:21:44 +0000 (UTC) (envelope-from jamie@catflap.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jamie@catflap.org designates 2001:19f0:7400:8808:123::1 as permitted sender) smtp.mailfrom=jamie@catflap.org; dmarc=pass (policy=none) header.from=catflap.org X-Catflap-Envelope-From: X-Catflap-Envelope-To: freebsd-hackers@FreeBSD.org Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [209.250.224.51]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id 37BBLXqD064264; Fri, 11 Aug 2023 12:21:33 +0100 (BST) (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id 37BBLX0J064263; Fri, 11 Aug 2023 12:21:33 +0100 (BST) (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <202308111121.37BBLX0J064263@donotpassgo.dyslexicfish.net> Date: Fri, 11 Aug 2023 12:21:33 +0100 Organization: Dyslexic Fish To: void@f-m.fm, freebsd-hackers@FreeBSD.org Subject: Re: can sftp be made multi-threaded? References: In-Reply-To: User-Agent: Heirloom mailx 12.4 7/29/08 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [209.250.224.51]); Fri, 11 Aug 2023 12:21:33 +0100 (BST) X-Spamd-Result: default: False [-0.33 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_SPAM_SHORT(0.94)[0.942]; NEURAL_HAM_MEDIUM(-0.81)[-0.806]; NEURAL_HAM_LONG(-0.77)[-0.767]; DMARC_POLICY_ALLOW(-0.50)[catflap.org,none]; R_SPF_ALLOW(-0.20)[+mx:dyslexicfish.net]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_TO(0.00)[f-m.fm,FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:7400::/38, country:US]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-hackers@FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_DKIM_NA(0.00)[]; FREEFALL_USER(0.00)[jamie]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Spamd-Bar: / X-Rspamd-Queue-Id: 4RMhFh5zGcz3ZtP void wrote: > Hello hackers@ > > Can sftp be made multi-threaded? Would rsync-over-ssh accomplish the same thing? > > The issue I'm having is with large backups taking ages to transfer > even with both source and destination being on gigabit fibre. > > It looks like sftp is single-threaded and the bandwidth per thread is > something like 5-50 Mbps and it's nowhere near saturating the bandwidth. > Would multi-threaded sftp (if it were possible) > or rsync-over-ssh work multi-threaded on a single huge backup file? > > In my example, the ssh systems are both OpenSSH_9.3p1, OpenSSL 3.0.9 30 May 2023 rsync just spawns an ssh command, so would probably behave similarly. Another thing, scp transfers from my test Rpi2 are much slower than the network can handle due to the CPU use, which hits 100% on one cpu whilst it's running. So, check that CPU isn't the bottleneck too. As for the speed, I just tested sftp to transfer a file of random data, 2 GB in size from one FreeBSD box in London to another in France: The final result was: 100% 2000MB 43.5MB/s 00:46 (Note, that's MegaBYTES/s) That is WITHOUT HPN. I have compiled ssh both sides with HPN, but in this case, at least, enabling it makes no difference. The London box is pretty old, and is a virtual host scheduled to be decomissioned. It is running an old openssl 1.X, openssh 8.8 and is a single core 2.4Ghz amd64 box. The France box is a 4 core bare metal 3.1Ghz and64 running openssh 9.2 and openssl 1.1.1 Anything more I can tell you that may help? Cheers, Jamie