From nobody Fri Aug 11 16:51:25 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 4RMqZL6JK4z4m8Zv for ; Fri, 11 Aug 2023 16:51:38 +0000 (UTC) (envelope-from joesuf4@gmail.com) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RMqZL0zSpz3C0w for ; Fri, 11 Aug 2023 16:51:38 +0000 (UTC) (envelope-from joesuf4@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=Z+bMggWQ; spf=pass (mx1.freebsd.org: domain of joesuf4@gmail.com designates 2a00:1450:4864:20::32d as permitted sender) smtp.mailfrom=joesuf4@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fe426b86a8so19937265e9.3 for ; Fri, 11 Aug 2023 09:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691772696; x=1692377496; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=l5yJe3bSSbRcrRv2T077YrLUW645NSzNNh+S2vPX7X4=; b=Z+bMggWQl0NryNIOPbNkpKijKtwyN2SPScMbuYBDkmyCE+MpyO8n0vf2gm39+Z4qw5 IG+EAE7vWP3WjfmwsuZyN7R5iOQJ+wIBpcKV9RVPndnwa9bwkd5F0A7teLlXII7JbEeg joDGJg7Lwzq/9JUlPvlvVfsP+7TL6p+JlU5GdxMNHrIbF9DPkqCyeYseFBdFIbqwUcVc JMhQtuOQ9aRsVaDjy0Fhh8FL3nwqS8HgZyhX8262w9ZG0//xYc6yUqNwDxfHtYodaWjJ ig9fo2m5M2zmYa+9KJtBn7XyJCzW1Uw4DHc7vSyokPRZG34pfYSwul3XVgTAcoteby9u 7egA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691772696; x=1692377496; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l5yJe3bSSbRcrRv2T077YrLUW645NSzNNh+S2vPX7X4=; b=ixxi31lj68gw7LdAW3hkEmyG+JVnhZwyNgyPeD/Slv56ttYJTcKLpfgn+NzWAIZnzI bqQ0fvyGaAdswDR0rI/4WC81W7IHeMlnZBH6vZuNqLTbqkBeaFkL/lkI3UI0RGbKOAuy dbwaxyFgD336FSyQseKqvBcRocRbBNltFyUSWZ5racL+zQI3PItRIlZiJ0I7rdeIMDPE yPA6g7nTEPQOunDhxnRdF7pCqP2vNqf2Jr1bOaNCIHyEAjRMgJIMi9NUm2+tEazUmZ6x ypMvvde5VXO4cfkJFofOBwuOaMKFmjZ51WI90ugVg4/hX5WZsVdC0IRQS4OdmGxCRK5C syjg== X-Gm-Message-State: AOJu0YwhsPKaalNr7Cl2wTkaubvlY2PCwpMqZTaW/fNGtsI8AaoQe7d0 kpXEmuXSPlP6GXwX1UuODH2/SWuhnS6llQ6ws4aDnth8 X-Google-Smtp-Source: AGHT+IHVD3zQZFDwEl5gTVFMfyWMAjEMhWeXTSrpvjVEmVTeBVG2XHa486KRMcW/RukzjWC9F0VgCjfG1CI7AVK7w3Q= X-Received: by 2002:a05:600c:2301:b0:3fe:1f98:deb7 with SMTP id 1-20020a05600c230100b003fe1f98deb7mr2074223wmo.35.1691772696599; Fri, 11 Aug 2023 09:51:36 -0700 (PDT) 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 References: <202308111121.37BBLX0J064263@donotpassgo.dyslexicfish.net> In-Reply-To: From: Joe Schaefer Date: Fri, 11 Aug 2023 12:51:25 -0400 Message-ID: Subject: Re: can sftp be made multi-threaded? To: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009f218f0602a8864c" X-Spamd-Result: default: False [-2.95 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.997]; NEURAL_HAM_MEDIUM(-0.98)[-0.983]; NEURAL_HAM_LONG(-0.97)[-0.972]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::32d:from]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_NONE(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org] X-Spamd-Bar: -- X-Rspamd-Queue-Id: 4RMqZL0zSpz3C0w --0000000000009f218f0602a8864c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable % split -n $(nproc) foo.pdf; ls x* | xargs -P 0 -J % scp % user@bar.example.com:%; rm x*; ssh user@bar.example.com sh -c =E2=80=9Ccat= x* > foo.pdf; rm x*=E2=80=9D On Fri, Aug 11, 2023 at 12:27 PM Joe Schaefer wrote: > If it=E2=80=99s just a single file, split it into chunks. > > On Fri, Aug 11, 2023 at 12:25 PM Joe Schaefer wrote: > >> Why don=E2=80=99t you just use xargs -P until you=E2=80=99ve exhausted y= our CPU capacity? >> >> On Fri, Aug 11, 2023 at 10:10 AM void wrote: >> >>> On Fri, Aug 11, 2023 at 12:21:33PM +0100, Jamie Landeg-Jones wrote: >>> >>> >rsync just spawns an ssh command, so would probably behave similarly. >>> >>> I'm hoping that rsync will spawn many ssh. Need to look at max sessions >>> on both ends of the connection. >>> >>> Since encountering the described problem, the person at the other >>> end is away for the week so have not been able to test thoroughly. >>> What I have been able to test shows that there is spiky latency >>> in the connection, as well as slow speed, single-threaded. >>> >>> >Another thing, scp transfers from my test Rpi2 are much slower than th= e >>> 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. >>> >>> Yup. That won't be happening here. Dual xenon with 56 cores at remote >>> end and same (but with 32 cores) at this end >>> >>> >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) >>> >>> I ran a similar test. >>> Sending system is on synchronous gigabit fibre on US east coast, >>> receiving system is near London on 110/21 fibre (so, gigabit in the >>> sending >>> direction): >>> >>> 100% 2000MB 7.2MB/s 04:36 >>> >>> using rsync -azP : 2,097,152,000 100% 6.81MB/s 0:04:53 (xfr#1, >>> to-chk=3D0/1) >>> >>> the speed fluctulates a lot. Both systems are quiet in a network and OS >>> sense >>> for the duration of the test. >>> >>> >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 >>> >>> both ends here are running very recent -current, so ssl/ssh is >>> OpenSSH_9.3p1, OpenSSL 3.0.9 30 May 2023 >>> >>> >Anything more I can tell you that may help? >>> >>> Thanks very much for your input. I'm certain it's not a freebsd problem= . >>> >>> -- >>> >>> --0000000000009f218f0602a8864c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
% split -n $(nproc) foo.pdf; ls x* | xargs -P 0 -J % scp = % =C2=A0user@bar.example.com:%; rm x*; ssh user@bar.example.com sh -c =E2=80=9Ccat x* > foo.pdf; rm x*= =E2=80=9D

On Fri, Aug 11, 2023 at 12:27 PM Joe Schaefer <joesuf4@gmail.com> wrote:
If it=E2=80=99s just a single file, split i= t into chunks.

On Fri, Aug 11, 2023 at 12:25 PM Joe Schaefer <joesuf4@gmail.com> = wrote:
Why don=E2=80=99t you ju= st use xargs -P until you=E2=80=99ve exhausted your CPU capacity?

On Fri, Aug 11, 2023 at 10:10 AM void <void@f-m.fm> wrote:
On Fri, Aug 11, 2023 at 12:21:33PM +0100, Jamie Landeg-Jones w= rote:

>rsync just spawns an ssh command, so would probably behave similarly.
I'm hoping that rsync will spawn many ssh. Need to look at max sessions=
on both ends of the connection.

Since encountering the described problem, the person at the other
end is away for the week so have not been able to test thoroughly.
What I have been able to test shows that there is spiky latency
in the connection, as well as slow speed, single-threaded.

>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.

Yup. That won't be happening here. Dual xenon with 56 cores at remote end and same (but with 32 cores) at this end

>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=C2=A0 43.5MB/s=C2=A0 =C2=A000:46=C2=A0 (Note, that's M= egaBYTES/s)

I ran a similar test.
Sending system is on synchronous gigabit fibre on US east coast,
receiving system is near London on 110/21 fibre (so, gigabit in the sending=
direction):

100% 2000MB=C2=A0 =C2=A07.2MB/s=C2=A0 =C2=A004:36

using rsync -azP : 2,097,152,000 100%=C2=A0 =C2=A0 6.81MB/s=C2=A0 =C2=A0 0:= 04:53 (xfr#1, to-chk=3D0/1)

the speed fluctulates a lot. Both systems are quiet in a network and OS sen= se
for the duration of the test.

>The London box is pretty old, and is a virtual host scheduled to be dec= omissioned.
>It is running an old openssl 1.X, openssh 8.8 and is a single core 2.4G= hz amd64 box.
>
>The France box is a 4 core bare metal 3.1Ghz and64 running openssh 9.2 = and openssl 1.1.1

both ends here are running very recent -current, so ssl/ssh is
OpenSSH_9.3p1, OpenSSL 3.0.9 30 May 2023

>Anything more I can tell you that may help?

Thanks very much for your input. I'm certain it's not a freebsd pro= blem.

--

--0000000000009f218f0602a8864c--