Date: Thu, 23 Feb 2023 15:28:08 -0500 From: Charles Sprickman <spork@bway.net> To: Chris Watson <bsdunix44@gmail.com> Cc: Sysadmin Lists <sysadmin.lists@mailfence.com>, Freddie Cash <fjwcash@gmail.com>, freebsd-fs <freebsd-fs@freebsd.org> Subject: Re: speeding up zfs send | recv (update) Message-ID: <E9E879F2-5A55-4AED-8EE8-F1698CA721F5@bway.net> In-Reply-To: <CAHnbxSScPFD5_JyeL0=nBA-jjRzBsWZYZ_T%2BQf3gY7_nnvaWbA@mail.gmail.com> References: <866d6937-a4e8-bec3-d61b-07df3065fca9@sentex.net> <CAOtMX2gifUmgqwSKpRGcfzCm_=BX_szNF1AF8WTMfAmbrJ5UWA@mail.gmail.com> <f6ea3387-faf8-4c63-d1e7-906fa397b00b@sentex.net> <a38578c6-b633-249d-90f0-0652377d76c0@quip.cz> <c229a502-fb76-ec6a-a56b-934d3b56e474@sentex.net> <1031e2b0-b245-1dc6-a499-8f4da3796543@quip.cz> <46455168-d7f1-6ca9-ad2f-9bcd3359e0f3@sentex.net> <78c78aec-a34b-f188-ef96-8ced9a1eda35@quip.cz> <CAOjFWZ7k7ANwcGyNCoYMg%2BLUBzAz2VyNfxQo5rKcrYj8XFgG3Q@mail.gmail.com> <741387429.91447.1677122934622@ichabod.co-bxl> <CAHnbxSScPFD5_JyeL0=nBA-jjRzBsWZYZ_T%2BQf3gY7_nnvaWbA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] > On Feb 23, 2023, at 2:15 PM, Chris Watson <bsdunix44@gmail.com> wrote: > > [Sorry miroslav, I hit send without checking the To: this was meant to be public] > > I’m a bit late, but I mentioned this to someone on this thread privately, I’m curious why ‘spiped’ hasn’t been mentioned in this thread. I’ve seen everything from VPN’s to nc. VPNs would be, imo, grossly unwarranted/massively overly complex/hard to secure just to simply have a secure pipe for doing ZFS send|recv. > > Simply configuring an spiped PtP pipe between A and B seems the simplest, most secure, performant option here. At least considering all the other options tossed out in this thread. Does it scale across multiple cores? Charles > > No one’s using spiped? O.o > > Thoughts? > > Has anyone compared ssh to spiped regarding overhead and throughput in this scenario? > > Chris > > On Wed, Feb 22, 2023 at 9:29 PM Sysadmin Lists <sysadmin.lists@mailfence.com <mailto:sysadmin.lists@mailfence.com>> wrote: > > On Feb 22, 2023 at 1:43 PM, Freddie Cash <fjwcash@gmail.com <mailto:fjwcash@gmail.com>> wrote: >> >> [Sorry for top part, GMail sucks for replies.] >> >> If this is a LAN or private WAN where you trust the network, piping the send stream through netcat will remove ssh from the equation. >> >> That's what we switched to using once it became almost 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 through 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. >> >> >> >> Cheers, >> Freddie >> >> Typos due to smartphone keyboard. >> >> On Wed., Feb. 22, 2023, 1:31 p.m. Miroslav Lachman, <000.fbsd@quip.cz <mailto: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 <mailto:chacha20-poly1305@openssh.com> >> >> >> >> >> >> It seems the speed of SSH is limited by single core performance which >> >> is very poor on this machine (Intel(R) Pentium(R) Dual CPU E2160). >> >> 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 any >> >> 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 try. > > $ man crypt > The enigma utility, also known as crypt is a very simple encryption > program, working on a “secret-key” basis. 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 operation is fully symmetrical, > feeding the encrypted data stream again through the engine (using the > same secret key) will decrypt it. > > > -- Sent with https://mailfence.com <https://mailfence.com/> Secure and private email [-- Attachment #2 --] <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 23, 2023, at 2:15 PM, Chris Watson <<a href="mailto:bsdunix44@gmail.com" class="">bsdunix44@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">[Sorry miroslav, I hit send without checking the To: this was meant to be public] </div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">I’m a bit late, but I mentioned this to someone on this thread privately, I’m curious why ‘spiped’ hasn’t been mentioned in this thread. I’ve seen everything from VPN’s to nc. VPNs would be, imo, grossly unwarranted/massively overly complex/hard to secure just to simply have a secure pipe for doing ZFS send|recv. </div><div dir="auto" style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">Simply configuring an spiped PtP pipe between A and B seems the simplest, most secure, performant option here. At least considering all the other options tossed out in this thread. </div></div></div></blockquote><div><br class=""></div><div>Does it scale across multiple cores?</div><div><br class=""></div><div>Charles</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div dir="auto" style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">No one’s using spiped? O.o</div><div dir="auto" style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">Thoughts? </div><div dir="auto" style="word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">Has anyone compared ssh to spiped regarding overhead and throughput in this scenario?</div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class=""><br class=""></div><div dir="auto" style="font-size:1rem;word-spacing:1px;border-color:rgb(49,49,49);color:rgb(49,49,49)" class="">Chris</div></div><div class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 22, 2023 at 9:29 PM Sysadmin Lists <<a href="mailto:sysadmin.lists@mailfence.com" class="">sysadmin.lists@mailfence.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div style="font-family: "Times New Roman"; font-size: 18px;" class=""><br class=""><div style="font-family:"Times New Roman"" class=""></div></div><div style="font-family: "Times New Roman"; font-size: 18px;" class=""><div style="font-family:"Times New Roman"" class="">On Feb 22, 2023 at 1:43 PM, Freddie Cash <<a href="mailto:fjwcash@gmail.com" target="_blank" style="font-family:"Times New Roman"" class="">fjwcash@gmail.com</a>> wrote:<blockquote type="cite" style="font-family:"Times New Roman"" class=""><div dir="auto" style="font-family:"Times New Roman"" class="">[Sorry for top part, GMail sucks for replies.]<div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class="">If this is a LAN or private WAN where you trust the network, piping the send stream through netcat will remove ssh from the equation.<div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class="">That's what we switched to using once it became almost impossible to get the "none" cipher working with ssh on FreeBSD.</div><div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class="">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. That way it's logged and uses ssh for authentication.</div><div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class="">We easily saturate gigabit links between our ZFS systems using netcat.<br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""></div><div dir="auto" style="font-family:"Times New Roman"" class=""><br class=""><br class=""><div data-smartmail="gmail_signature" dir="auto" style="font-family:"Times New Roman"" class="">Cheers,<br class="">Freddie<br class=""><br class="">Typos due to smartphone keyboard.</div></div></div></div><br class=""><div style="font-family:"Times New Roman"" class=""><div dir="ltr" style="font-family:"Times New Roman"" class="">On Wed., Feb. 22, 2023, 1:31 p.m. Miroslav Lachman, <<a href="mailto:000.fbsd@quip.cz" target="_blank" style="font-family:"Times New Roman"" class="">000.fbsd@quip.cz</a>> wrote:<br class=""></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;font-family:"Times New Roman";border-left-color:rgb(204,204,204)" class="">On 22/02/2023 22:08, mike tancsa wrote:<br class=""> > On 2/22/2023 4:03 PM, Miroslav Lachman wrote:<br class=""> >> Interresting numbers. I think I am the only one who get best speed <br class=""> >> with <a href="mailto:chacha20-poly1305@openssh.com" rel="noreferrer" target="_blank" style="font-family:"Times New Roman"" class="">chacha20-poly1305@openssh.com</a><br class=""> >><br class=""> >><br class=""> >> It seems the speed of SSH is limited by single core performance which <br class=""> >> is very poor on this machine (Intel(R) Pentium(R) Dual CPU E2160). <br class=""> >> Even if CPU has 50% idle, ssh runs on 99.8% of single core.<br class=""> > <br class=""> > The CPU I have has<br class=""> > aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS> on motherboard<br class=""> > <br class=""> > which probably helps.<br class=""> <br class=""> That explains it<br class=""> aesni0: No AES or SHA support.<br class=""> <br class=""> >> I know there were some HPN patches to ssh, beside that is there any <br class=""> >> option I can try to use less CPU?<br class=""> >><br class=""> >> I will play with cpuset to pin ssh on one core and everything else on <br class=""> >> the other core.<br class=""> > <br class=""> > It looks like you are running into a CPU bottleneck TBH<br class=""> <br class=""> Yes. Pinning on cores with cpuset helps a bit (about +3MiB/s) but <br class=""> without some tweaks on ssh I will not gain more speed :(<br class=""> <br class=""> Thank you for your help!<br class=""> <br class=""> Miroslav Lachman<br class=""> <br class=""> <br class=""></blockquote></div></blockquote><div style="font-family:"Times New Roman"" class=""><br class=""></div></div></div><div style="font-family: "Times New Roman"; font-size: 18px;" class=""><div style="font-family:"Times New Roman"" class=""><div style="font-family:"Times New Roman"" class=""><div style="font-family:"Times New Roman"" class="">You could pipe the stream through an encrypting program before piping to</div><div style="font-family:"Times New Roman"" class="">netcat, then decrypt on the recieving end.</div><div style="font-family:"Times New Roman"" class=""><br class=""></div><div style="font-family:"Times New Roman"" class="">$ zfs send | crypt | netcat ipaddr 2222</div><div style="font-family:"Times New Roman"" class="">$ netcat -vl 2222 | crypt | zfs recv</div><div style="font-family:"Times New Roman"" class=""><br class=""></div><div style="font-family:"Times New Roman"" class="">I don't know if zfs can handle that, but worth a try.</div></div><div style="font-family:"Times New Roman"" class=""><br class=""></div><div style="font-family:"Times New Roman"" class="">$ man crypt</div><div style="font-family:"Times New Roman"" class=""><div style="font-family:"Times New Roman"" class=""> The enigma utility, also known as crypt is a very simple encryption</div><div style="font-family:"Times New Roman"" class=""> program, working on a “secret-key” basis. It operates as a filter, i.e.,</div><div style="font-family:"Times New Roman"" class=""> it encrypts or decrypts a stream of data from standard input, and writes</div><div style="font-family:"Times New Roman"" class=""> the result to standard output. Since its operation is fully symmetrical,</div><div style="font-family:"Times New Roman"" class=""> feeding the encrypted data stream again through the engine (using the</div><div style="font-family:"Times New Roman"" class=""> same secret key) will decrypt it.</div></div><div style="font-family:"Times New Roman"" class=""><br class=""></div><div style="font-family:"Times New Roman"" class=""><br class=""></div></div></div> -- Sent with <a href="https://mailfence.com/" target="_blank" class="">https://mailfence.com</a> Secure and private email </blockquote></div></div> </div></blockquote></div><br class=""></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E9E879F2-5A55-4AED-8EE8-F1698CA721F5>
