From nobody Thu Feb 23 03:28:55 2023 X-Original-To: freebsd-fs@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 4PMdmD0Mmkz3ssNc for ; Thu, 23 Feb 2023 03:29:00 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Received: from wilbur.contactoffice.com (wilbur.contactoffice.com [212.3.242.68]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMdmC52d6z4LS5 for ; Thu, 23 Feb 2023 03:28:59 +0000 (UTC) (envelope-from sysadmin.lists@mailfence.com) Authentication-Results: mx1.freebsd.org; none Received: from ichabod.co-bxl (ichabod.co-bxl [10.2.0.36]) by wilbur.contactoffice.com (Postfix) with ESMTP id A08852994; Thu, 23 Feb 2023 04:28:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1677122937; s=20210208-e7xh; d=mailfence.com; i=sysadmin.lists@mailfence.com; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type; l=7317; bh=Thvl5cftda4IBZ9l07SrlzL9+ZFlmWFRRy6MxH1inbE=; b=Qnkla9+UNpdCGokf9sWPXm9JQfNuVvMrElkWVPLdfRZMP9PyH5YNRMrWzESaHCIb wVJCCoSeMy1SOxYWz3orwT7PfsHkFEowCF2X1vKM2xOodtITnz40zGj/bpMrGhENjTl JuF4JjzexLee0grcuYGpsLAdyWiyU6b1+dY4wNKw+a2ezXCfhFu2tN81+55qUzOaVeh y6vTCMkKfiYRMrdrWB8m12n6HmlS7Ci42kC03AgTotLkiCtkYOfRXFMjM1vt8Vc6Xja tILSeQ3FBYtNLn6T3dZN4rO2FZbhyYc4vHwAvYi9d+u7Howas01Vcmr0Kfw7B30JwO1 w+GD77peKA== Date: Thu, 23 Feb 2023 04:28:55 +0100 (CET) From: Sysadmin Lists To: freebsd-fs Cc: Miroslav Lachman <000.fbsd@quip.cz>, Freddie Cash Message-ID: <741387429.91447.1677122934622@ichabod.co-bxl> In-Reply-To: References: <866d6937-a4e8-bec3-d61b-07df3065fca9@sentex.net> <1031e2b0-b245-1dc6-a499-8f4da3796543@quip.cz> <46455168-d7f1-6ca9-ad2f-9bcd3359e0f3@sentex.net> <78c78aec-a34b-f188-ef96-8ced9a1eda35@quip.cz> Subject: Re: speeding up zfs send | recv (update) List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_91444_1729784993.1677122934622" X-Mailer: ContactOffice Mail X-ContactOffice-Account: com:312482426 X-Rspamd-Queue-Id: 4PMdmC52d6z4LS5 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:10753, ipnet:212.3.242.64/26, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N ------=_Part_91444_1729784993.1677122934622 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Feb 22, 2023 at 1:43 PM, Freddie Cash wrote: [Sorry for top part, GMail sucks for replies.] If this is a LAN or private WAN where you trust the network, piping the sen= d stream through netcat will remove ssh from the equation. That's what we switched to using once it became almost impossible to get th= e "none" cipher working with ssh on FreeBSD. We use ssh to connect to the remote server and enable a netcat listener on = port X, then pipe the send through netcat to the remote system on port X. T= hat way it's logged and uses ssh for authentication. We easily saturate gigabit links between our ZFS systems using netcat. Cheers, Freddie Typos due to smartphone keyboard. On Wed., Feb. 22, 2023, 1:31 p.m. Miroslav Lachman, <000.fbsd@quip.cz> wrot= e: On 22/02/2023 22:08, mike tancsa wrote: > On 2/22/2023 4:03 PM, Miroslav Lachman wrote: >> Interresting numbers. I think I am the only one who get best speed=20 >> with chacha20-poly1305@openssh.com >> >> >> It seems the speed of SSH is limited by single core performance which=20 >> is very poor on this machine (Intel(R) Pentium(R) Dual=C2=A0 CPU E2160).= =20 >> Even if CPU has 50% idle, ssh runs on 99.8% of single core. >=20 > The CPU I have has > aesni0: on motherboard >=20 > which probably helps. That explains it aesni0: No AES or SHA support. >> I know there were some HPN patches to ssh, beside that is there any=20 >> option I can try to use less CPU? >> >> I will play with cpuset to pin ssh on one core and everything else on=20 >> the other core. >=20 > It looks like you are running into a CPU bottleneck TBH Yes. Pinning on cores with cpuset helps a bit (about +3MiB/s) but=20 without some tweaks on ssh I will not gain more speed :( Thank you for your help! Miroslav Lachman You could pipe the stream through an encrypting program before piping to netcat, then decrypt on the recieving end. $ zfs send | crypt | netcat ipaddr 2222 $ netcat -vl 2222 | crypt | zfs recv I don't know if zfs can handle that, but worth a try. $ man crypt =C2=A0 =C2=A0 The enigma utility, also known as crypt is a very simple encr= yption =C2=A0 =C2=A0 =C2=A0program, working on a =E2=80=9Csecret-key=E2=80=9D basi= s.=C2=A0 It operates as a filter, i.e., =C2=A0 =C2=A0 =C2=A0it encrypts or decrypts a stream of data from standard = input, and writes =C2=A0 =C2=A0 =C2=A0the result to standard output.=C2=A0 Since its operatio= n is fully symmetrical, =C2=A0 =C2=A0 =C2=A0feeding the encrypted data stream again through the eng= ine (using the =C2=A0 =C2=A0 =C2=A0same secret key) will decrypt it. -- Sent with https://mailfence.com Secure and private email ------=_Part_91444_1729784993.1677122934622 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=
On Feb 22, 2023 at 1:43 PM, Freddie Cash <fjwcash@gmail.com>= wrote:
">
[Sorry for top part, = GMail sucks for replies.]

If t= his is a LAN or private WAN where you trust the network, piping the send st= ream through netcat will remove ssh from the equation.
That's what we switched to using once it became al= most impossible to get the "none" cipher working with ssh on FreeBSD.
=

We use ssh to connect to the = remote server and enable a netcat listener on port X, then pipe the send th= rough netcat to the remote system on port X. That way it's logged and uses = ssh for authentication.

= We easily saturate gigabit links between our ZFS systems using netcat.
<= /div>



Cheers,
Freddie

Typos due to= smartphone keyboard.

On Wed., Feb. 22, 2023, 1:31 p.m. Miroslav Lachman, <= ;000.fbsd@quip.cz> wrote:
On 22/02/2023 22:08, mike tancsa wrote:
> On 2/22/2023 4:03 PM, Miroslav Lachman wrote:
>> Interresting numbers. I think I am the only one who get best speed=
>> with chacha20-poly1305@openssh.com
>>
>>
>> It seems the speed of SSH is limited by single core performance wh= ich
>> is very poor on this machine (Intel(R) Pentium(R) Dual  CPU E= 2160).
>> Even if CPU has 50% idle, ssh runs on 99.8% of single core.
>
> The CPU I have has
> aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS> on motherboard=
>
> which probably helps.

That explains it
aesni0: No AES or SHA support.

>> I know there were some HPN patches to ssh, beside that is there an= y
>> option I can try to use less CPU?
>>
>> I will play with cpuset to pin ssh on one core and everything else= on
>> the other core.
>
> It looks like you are running into a CPU bottleneck TBH

Yes. Pinning on cores with cpuset helps a bit (about +3MiB/s) but
without some tweaks on ssh I will not gain more speed :(

Thank you for your help!

Miroslav Lachman



You could pipe= the stream through an encrypting program before piping to
netcat= , then decrypt on the recieving end.

$ zfs send | = crypt | netcat ipaddr 2222
$ netcat -vl 2222 | crypt | zfs recv

I don't know if zfs can handle that, but worth a tr= y.

$ man crypt
    = The enigma utility, also known as crypt is a very simple encryption
     program, working on a =E2=80=9Csecret-key=E2=80=9D b= asis.  It operates as a filter, i.e.,
     it= encrypts or decrypts a stream of data from standard input, and writes
     the result to standard output.  Since its op= eration is fully symmetrical,
     feeding the enc= rypted data stream again through the engine (using the
  &nb= sp;  same secret key) will decrypt it.

=
--=20 Sent with https://mailfence.com =20 Secure and private email ------=_Part_91444_1729784993.1677122934622--