Hey all, does anyone have some tips for accelerating syncthing over lan? Right now I’m getting ~60Mbps at peak but I can get ~400Mbps with SMB. I have already turned off relays, disabled compression and compiled the source code and I am using the new “receive only” mode. Neither of my devices is mobile and here’s the benchmark for the slower one (receiver):
Usually something is the bottleneck, so start by checking if you’re maxing out CPU, disk I/O on one of the sides. Syncthing is not SMB, neither in how it transfers things over the network nor in how it uses disk I/O.
Yes I understand very much that they are not the same, but I expect the performance to be something closer than this (~200Mbps when transferring large files would be good). Looking at htop, iotop and iftop, I think the bottleneck might be IO since Syncthing seems to be constantly read/write different files (probably the ldb files) in multiple threads. And my HDDs aren’t very good at random accessing files. I have turned off rescan for all directories. Is there anything else I can do?
Probably not, unfortunately. Syncthing does have a very random I/O pattern which is the opposite of for example SMB. This is, in general, better for large clusters and worse for initially transferring a single thing between two points - and can be painful on HDDs.
If your files are large, enabling large blocks support might help a little.
Yes and no. Reads and writes are cached as best the database layer can, but with periodical disk flushes. Synced files are also forced to be flushed to disk before we commit the change to the database. Synchronous writes are slow on spinning disks and forces things to wait for them to complete.
No; it’ll flush every two seconds or one thousand updates. Are you sure that’s the thing though, and not just normal disk writes to files being synced?
It’s probably every one thousand updates. Right now I have 575,684 files and 93,270 directories (~410 GiB), and ~/.config/syncthing is >1 GiB in size lol.
To be honest I’m not sure. iotop shows that syncthing is using >250% of IO (I have 3 HDDs as a RAID 0 as I’ve mentioned). sysdig -c topfiles_bytes shows 6 different ldb files are being written (I suppose?) simultaneously at 30-40KB/s each (sometimes up to 200KB/s) every second. Is there any other tools I can use to check out my IO usage?
I don’t understand how that would explain the low transfer rate when transferring large files. Anyway here’s iostat when it’s transferring a large file at only 3.5MiB/s.
Iowait of 20% is quite high. You can run with -X 1 option which if memory serves me right gives you periodic dumps. It could be that block shuffling is causing a lot of seeking that slows down disk access.
Audrius means for iostat. Database writes also do not explain slow transfer of large files - they only happen when a file is completed. Blocks are however processed in random order, giving you a seek penalty on spinning disks.