Slow rsync performance moving files from one zpool to another with SSH (unraid)

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

acquacow

Well-Known Member
Feb 15, 2017
787
439
63
42
You can also specify your ssh cipher, enable sparse, and disable compression. Different ciphers will have different CPU overhead and can get you better transfer rates.

rsync -vr --sparse -e "ssh -T -c aes256-gcm@openssh.com -o Compression=no -x" --progress * root@192.168.0.206:/data/
 

CyklonDX

Well-Known Member
Nov 8, 2022
846
279
63
size 196274
sadly I don't know what that means, lol
This is how much ram is assigned to your zfs pool
It prints col1 that is "size" and col3 divided by 1048576 to show you in MB

For best performance I would recommend setting up to 70% of your ram as limit.
(tho i recommend half the ram on the system.)

How much ram does your system have? (also how much does it have while its transferring the files?)
 
  • Like
Reactions: piranha32

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
This is how much ram is assigned to your zfs pool
It prints col1 that is "size" and col3 divided by 1048576 to show you in MB

For best performance I would recommend setting up to 70% of your ram as limit.
(tho i recommend half the ram on the system.)

How much ram does your system have? (also how much does it have while its transferring the files?)
Ahh I should have deduced that. I have 256GB in each system so I was going to let Plex and the rest of the dockers I have running have access to ~56GB of ram. I may reduce it a little bit though.
 

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
I finally got a second to try zfs send and I get around 300MB/s which is certainly better but not amazing by any stretch of the imagination. I may try netcat instead, but I have to read up on that, lol.
 

mrpasc

Well-Known Member
Jan 8, 2022
487
259
63
Munich, Germany
I still think you are expecting to much I/O from your RAID-Z2 pool which receives the data.
Rsync is heavy on I/O and metadata writes. So you can’t expect much more I/O then 1 of your disk can offer.
See here: Six Metrics for Measuring ZFS Pool Performance Part 2
You can try to get better rsync performance by adding a special vDev for metadata (and very small files if you want to). But be cautious: the metadata vDev needs at least same redundancy than your pool. Loose the special vDev means loos the whole pool!!!
 

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
I still think you are expecting to much I/O from your RAID-Z2 pool which receives the data.
Rsync is heavy on I/O and metadata writes. So you can’t expect much more I/O then 1 of your disk can offer.
See here: Six Metrics for Measuring ZFS Pool Performance Part 2
You can try to get better rsync performance by adding a special vDev for metadata (and very small files if you want to). But be cautious: the metadata vDev needs at least same redundancy than your pool. Loose the special vDev means loos the whole pool!!!
I'd actually been looking into special metadata via Wendell's video on youtube, but that's because my steam folder has millions of small files (sadly more than my small 118GB optane drives can hold). It looks like zfs send is a better way to go, perhaps with less I/O overhead, but may be the limit for SSH. I'll take a look at that article when I have a free few minutes, I appreciate it.

I do appreciate everyone's help so far, it's a fun journey.
 

unwind-protect

Active Member
Mar 7, 2016
416
156
43
Boston
I finally got a second to try zfs send and I get around 300MB/s which is certainly better but not amazing by any stretch of the imagination. I may try netcat instead, but I have to read up on that, lol.
Yeah, this really sounds like your ssh throughput limit, and you measured that at 300 MB/sec on the previous page. A different cipher might bring you 10 or 20% more, so not great. You should also be able to observe 100% CPU for the ssh process on one of the machines.

If you want quick and dirty you could try rsh :) But that authorizes a lot, so netcat would be better.
 
  • Like
Reactions: custom90gt

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
Yeah, this really sounds like your ssh throughput limit, and you measured that at 300 MB/sec on the previous page. A different cipher might bring you 10 or 20% more, so not great. You should also be able to observe 100% CPU for the ssh process on one of the machines.

If you want quick and dirty you could try rsh :) But that authorizes a lot, so netcat would be better.
Yeah makes sense to me, google searches show that people have been having issues getting more than 2-300MB/s with SSH. *on edit* it does seem to peg a single core of the Epyc 7F52 to 90-95% fairly consistently. I was hoping the "frequency" based epyc would be able to keep up.

Netcat and BBCP are interesting to me, but neither are included in Unraid so I'll have to get the packages. Some research shows that the latest versions of bbcp have issues though.
 
Last edited:

unwind-protect

Active Member
Mar 7, 2016
416
156
43
Boston
Try rsh just once to verify that you get better speed without ssh's encryption. There is no guarantee that the rest of the system is much faster, even if ssh is the bottleneck right now.
 

unwind-protect

Active Member
Mar 7, 2016
416
156
43
Boston
sadly RSH isn't baked into unraid either.
Do you have cstream?

It used to be that you could turn all ciphers off for ssh, but not anymore I guess. Found some tips here if you want to try maybe faster ciphers here. They aren't enabled by default, though:

Did you scan that paper I linked back in my first reply?
 

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
Do you have cstream?

It used to be that you could turn all ciphers off for ssh, but not anymore I guess. Found some tips here if you want to try maybe faster ciphers here. They aren't enabled by default, though:

Did you scan that paper I linked back in my first reply?
I do not have cstream either sadly.

I will check out the ciphers for sure. That article is super interesting btw. Rather big differences based on cipher and cpu speed. I guess theoretically the Epyc should be able to saturate 10Gb/s...
 

acquacow

Well-Known Member
Feb 15, 2017
787
439
63
42
so doing -c aes256-gcm@openssh.com as @acquacow suggested I now get a max of 550MB/s!

That's actually a much bigger jump than I anticipated
I don't even think that's the fastest you can go, it's just one of the better performing ones I use at work. If you have full control of client and server, you can allow some weaker ciphers on the server and client side if you are fine with it.
 
  • Like
Reactions: custom90gt

unwind-protect

Active Member
Mar 7, 2016
416
156
43
Boston
I don't even think that's the fastest you can go, it's just one of the better performing ones I use at work. If you have full control of client and server, you can allow some weaker ciphers on the server and client side if you are fine with it.
Does anybody remember whether ssh (still?) has a mode where only auth is encrypted but the stream afterwards is not? I seem to remember that being available. Not pretty but beats netcat.
 

piranha32

Active Member
Mar 4, 2023
240
176
43
Does anybody remember whether ssh (still?) has a mode where only auth is encrypted but the stream afterwards is not? I seem to remember that being available. Not pretty but beats netcat.
Probably depends on what ciphers were enabled at compile time. You can check what is abailable by running
Code:
sshd -T | grep ciphers
 
  • Like
Reactions: custom90gt

custom90gt

Active Member
Nov 17, 2016
225
95
28
39
I don't even think that's the fastest you can go, it's just one of the better performing ones I use at work. If you have full control of client and server, you can allow some weaker ciphers on the server and client side if you are fine with it.
I am totally fine with weaker ciphers, but I'm also pretty happy with 500MB/s too lol