Why transfer speed is so slow ? I get an average of 5 MB/s on a gigabit connection. The same behavior using freefilesync from an external Windows machine runs at 70~100 MB/s. I know this is not the only thread to talk about this subject. But my situation is quite far away of all I have read in all threads.
I did configure syncthing on 2 Synology NASes (amd64), both on the same LAN in gigabit. Both NASes handle full speed transfers on SMB is up to 110 MB/s, with an average of far above 50 MB/s in SMB. Most files are some big video files of 1GB or more each, with a total of 10TB. Syncthing is configured for 1-way syncing (RO -> RW).
I’ve checked all what was suggested in other threads, and other points:
CPU - < 10% on each NAS
RAM - < 20% on each NAS (src: 1/8G, dst: 1/4G)
load - < 2 on the source (4 cores), ~4 on the destination (4 cores) - the destination has higher I/O idle (SMB brings the load up to 8, with very good transfer speed)
scanning / hashing - not related - hashing was finished more than 2 weeks ago
crypting / hashing because of slow CPUs - not related, both can handle much more than 5 MB/s
** source: Single thread SHA256 performance is 99 MB/s using minio/sha256-simd (73 MB/s using crypto/sha256)
** destination: Single thread SHA256 performance is 76 MB/s using minio/sha256-simd (64 MB/s using crypto/sha256)
disk bandwidth - not related, the worst this RAID-5 can handle is over 100 MB/s
LAN issues - on the same LAN and SMB transfers have an average of 10x faster (on big files)
network latency - < 1ms between machines
network load - around nothing, except syncthing
STTRACE=model/all - nothing relevant
GUI open / closed in a browser - absolutely no difference (stuck around 5MB/s)
syncthing version - both are up to date (0.14.20)
At this point, I’m copying the files manually. Even with scanning, it will be 10x faster than letting syncthing do the job by itself. Except the fact I like the concept syncthing (and I use it for other cases, but with few files), it is quite unusable for syncing a multimedia library.
I suspect Syncthing will always perform poorly on network storage as the overhead and latency for the small writes that we do will be the bottleneck, I suspect thats where your IO wait is comming from and is potentially the cause.
4.6 MB/s is about 4.6 * 1024 / 128 = 36.8 blocks/s. That then expands into about 150 IOPS due to RAID-5. If those disks are slow spinning drives like WD Green (common in NASes), expect something like 50 IOPS per drive.
If that’s a three drive RAID-5 it’s maxed out at 3*50 = 150 IOPS and we are exactly where we expect. This is with the generous assumption that the fs and RAID layer can actually handle each 128 KiB block as one operation, which may absolutely not be the case. There is also overhead due to fs metadata and so on. All in all, I’m not surprised. Spinning disks suck, RAID-5 sucks, the combination is quite horrible for random writes unfortunately.
Measuring random write performance on the NAS, and checking iostat on it while sync is happening, would confirm.
The most important point in those is the last column of the last two tables - “%util”. It indicates how much of the time the disk (or array) in question is busy servicing a request. For the individual disks in the syncthing only case it’s about 45%. That’s ok, the disks seem to have more to give. But checking the line for md2 it’s at 99% - the RAID array is maxed out. I’m guessing the “lost” performance between that is in waiting. Given that RAID5 needs to both read and write both old data and parity for each write, there will be some time where we’ve done one disk but not yet the the other.
The “IOPS” I’m talking about - I/O operations per second - is what you see in the r/s and w/s columns. The disks are each servicing about 58 + 6 requests, which is consistent with what we expect they should be able to do, being a little bit better than my WD Green guess.
Why so much reading and comparatively little writing? Not sure, maybe this is in the copy phase of syncing?
Regarding the reads, I cannot tell. I cannot install atop on the NAS, which could give me better details. But I’ve tried with htop and sort by disk reads. The only read consumer is syncthing, with an average of 2~10 MB/s.
I did connect to the GUI (climed to 900r/s - 50 MB/s), and the status is clearly “syncing” (only one share, no scan running). After closing the GUI, syncthing still consumes the value above (2~10 MB/s - ~150 r/s).