Slow sync speeds, although devices are in the same network

Setup:

  • Router: Sony Xperia 10Ⅶ Android phone, also providing Internet connection by 5G

  • Sender: PC with WSL / Win11pro running Syncthing v2.1.7, Linux (64-bit Intel/AMD)

  • Receiver: Steam Frame with SteamOS running Syncthing v2.1.7, Linux (64-bit ARM)

When I try to sync a file from the PC to the Steam Frame, it can be very slow. What might be the reason?

We need more information, e.g. are the devices connected directly or via a relay? You can check this in the GUI when looking under Remote Devices. Also, are you testing with a single large file, or a large number of small files? Syncing the latter will always be much slower.

It says: TCP WAN

(although both devices are connected to the same WLAN, provided by my Android phone)

Do you know for sure that these devices can communicate with each other via LAN? Is your Android hotspot isolating wireless clients?

Can you ping one machine from the other via the local network IP address?

On the PC, I actually have two Syncthing clients running:

  • felix-x1t3-11 (Windows 11 Pro): If I connect this one to frame, the Steam Frame, then the connection type is TCP LAN. But this is not the one I tested.

  • wsl-linux (Arch Linux VM running in WSL under Windows 11 Pro): This is the one I did the tests with. From the VM, I can ping frame or SSH into it. But in the other direction I obviously can’t, because the VM accesses the Internet through NAT.

I conclude, NAT is the problem.

Is there any way to make Syncthing connect wsl-linux and frame by LAN?

Otherwise, I think I’ll just sync from Windows directly. My rationale of using the Linux VM for this sync was that both sides use Linux. And it is nice to not run into issues with permissions or case sensitivity. But I think for the files I generally use, this is not really relevant.

AFAIK one-way direction is fine, if the shielded device dials the direct connection. Did you try adding the peers explicity via they internal dns name or IP? so on the device behind the virtual NAT (wsl-linux) add frame using its explicit tcp address (I don’t have the current syntax, look at the docs). You may also want to disable relay discovery for testing.

If there is interest for debugging purposes, I can try setting the IP. But eventually that is not a stable solution. I use the devices with different hotspots. Local IPs are always changing.

The interest has to be yours. If you want to try to understand the cause then you can try it and see what’s the result.

Our LAN detection is rather simple. If the IP of the remote device isn’t part of the subnets the local device is directly connected to, it’s considered WAN. The fact that your remote device is listed with a private range IP address is a good sign that the whole network path stays within your LAN.

tl;dr: the speed is most likely limited by disk or the internal Syncthing database

Hello,

I also have very slow transfert speed in local network, from main PC to Nas Goal is to sync my /home/user folder, with some ignore, it takes 570Gb.

At 20 KiB/s, it will take forever.

I have tried to redo the all config, in case I missed something.. but still the same.. Speed is between 1 to 100 KiB/s

What is the strategy when we hav e to sync big folder ? is performing an initial rsync recommended ? So syncthing “just” has to maintain it ?

Or maybe I should use an another solution for syncing / backup my home folder.

Thank you for your advices. BR

Syncing a large number of small files is going to be slow. If want to “speed up” the initial sync, please check https://docs.syncthing.net/users/faq.html#can-i-help-initial-sync-by-copying-files-manually.

Thanks for your reply!

My desktop and my NAS are connected to the same local network, with a 1 Gbps connection. Not sur that qualify as a "not so fast network. Anyway, I will try what is recommended.

Thank you !

Thanks, this explains it, but I am still a bit confused. See below.

My two endpoints are:

  • wsl-linux, a Linux VM behind NAT under Windows:

    • IP of the VM (Linux): 172.17.186.251

    • IP of the host (Windows): 10.67.231.65

  • frame, Steam Frame running Linux:

    • IP: 10.67.231.14

What happens:

Does that mean syncing from wsl-linux to frame is going via the Internet (slow), and from frame to wsl-linux it goes directly from device to device?

The double NAT causes the LAN detection to fail on the WSL node. It doesn’t see the subnet of the host, which throws off our logic. It’s still a LAN conection as properly reported from the other node.

Thanks for the explanation, but why double? I am aware of only one NAT:

[frame:10.67.231.14]----[router:10.67.231.48]----[Windows:10.67.231.65-NAT-172.17.176.1]----[wsl-linux:172.17.186.251]

(Yes, 172.17.176.1 communicates with 172.17.186.251. The netmask of that network is 255.255.240.0.)

I’m referring to how the WSL node is connected to the internet. You have one NAT at the Windows host and the other at your ISP router. Hence double NAT.

Hi all,

@feklee

In your windows home dir edit or create .wslconfig

Add this line or change nat to mirrored.

networkingMode=mirrored

What this will do is, instead of your Windows Subsystem for Linux (WSL) having a nat address, it will share the IP address of your Windows computer so the IP address of Windows and Linux will be the same. No more network address translation problem.

Use this cmd in wsl to confirm

wslinfo --networking-mode

Should return mirrored mode.

Try this first. It should work for you. If it doesn’t you can always use Tailscale.

I really doubt that network is the culprit here

From the perspective of a device on the Internet, it’s even triple NAT. The router is my phone, connected to the Internet by 4G. My mobile provider (3HK) does carrier grade NAT.

However, from the perspective of frame, wsl-linux should only be behind a single NAT layer. And that can be removed:

I already looked into that some days ago. But switching to mirrored mode broke other things, and it will take me some time to fix these.

Hi,

Have you ever heard of or have you tried running a performance bandwidth throughput testing tool called iPerf3?

It runs on Windows, Linux, android, and Mac. I don’t know about iOS. You run it in server mode on one end and client mode on the other end and it will let you know what kind of throughput and bandwidth you have available to you. You’ll know whether or not something should or shouldn’t be doing what it is you see it doing. If the performance test numbers are poor, that will corroborate your findings with syncthing.

You can also run iperf2 so long as you use all of one or all of the other.

If the thought is that things are slowing down because SyncThing thinks that you have a WAN even though you may not there is the possibility of introducing a peer-to-peer VPN called Tailscale. It is free to use and it will create, when you set up your account, a private encrypted tunnel subnet that goes from each of your devices that are running SyncThing. They’ll all be on the same TCP/IP subnet so SyncThing will think that they’re all on the same subnet and they really will be on the same subnet. Perhaps that can help. I’m just throwing out some ideas.

I know you can run iPerf in WSL because I’ve done it. I also run SyncThing in WSL and I know enough about Linux and WSL to know that the Linux subsystem in Windows is essentially a virtual machine with a NAT IP address. It does not broadcast or see peer-to-peer. Other computers running SyncThing will not be on the same subnet. That is the primary reason why I suggested using mirroring because it’ll put SyncThing on the same subnet as your other devices. Alternatively Tailscale will do the same thing.

In a nutshell if iPerf numbers are poor then you have some kind of a networking issue that has got nothing to do with SyncThing. If the iPerf numbers are good and SyncThing is bad then you want to look more closely at SyncThing.