Slow Syncthing Speeds via a Private Relay Server Despite Fast Network Connections

Hello everyone,

I’m encountering slow transfer rates while using Syncthing and would greatly appreciate any advice or solutions.

Setup

I am syncing files between two personal computers with Windows systems, referred to as Computer A and Computer B. I have set up a private relay on my server with Linux system, referred to as Server C.

Issue

Direct file transfers using scp between A to C and B to C are fast, exceeding 2MB/s.

However, synchronizing files between A and B via Syncthing through Server C results in significantly slower speeds, around 0.35MB/s.

Attempts to Resolve

According to Syncthing’s FAQ (FAQ — Syncthing documentation), both A and B show “Address” instead of “Relay”, which suggests a direct connection. See the picture

In GUI settings/connections/sync protocal listen addresses, I have set to only one relay server relay://[My Server IP]/id=…

CPU usage on both A and B is low (around 0.1%).

Basic network configurations have been checked with no obvious issues detected. Originally, the sync speed was about 0.2MB/s, after I set the network connection on both A and B to private, it seems improved to current 0.35MB/s.

The files being synchronized are large and few in number. All Syncthing settings are default as I am relatively new to this tool.

Request

Could anyone suggest what might be causing this slowdown in Syncthing despite having fast direct connections?

Are there any specific settings or configurations in Syncthing that I should look into to improve the synchronization speed?

Any guidance or suggestions would be greatly appreciated.

Thank you in advance for your assistance!

Why are you using a local relay server? There for the most part intended to be used over the internet.

If you have servers that are on different subnets and they don’t see one another by default, you can add the ip of each to the other.

Excuse me but I fail to find where “local relay server” is used. You can see in my screenshot that the IP address does not start by 192.168. Computer A, B and Server C are all in different locations and hence on different subnets. (So I have also set up a global discovery server on C along with the relay server.)

Thank you for the immediate response!

@Jingze

My apologies. I mistook private for local.

Port forwarding might be what you need, if your servers are separated by the Internet. Port Forwarding Docs

Technically, port forwarding is only required on one end to work, however I like to do it on both.

The one caveat is that you must have access to your router and have the ability to set up port forwarding on at least one end.

Firstly, a direct link between your two nodes will always have the best theoretical speed. A relay adds latency and may reduce the maximum upload or download bandwidth because you’re stuck with the lowest value of everyone involved. It’s a stop-gap solution if a direct connection isn’t possible at all.

Also make sure that you’re comparing speed values with the same unit. Syncthings UI defaults to MB/s (Megabytes per second). You can click on the value to switch to Mb/s (Megabit per second) which is more common for network related values.

Lastly, the speed of your disk matters. Make sure that Syncthings database resides on a fast HDD or preferably on a SSD.

1 Like

Thank you for your suggestion! I originally thought that port forwarding might not be feasible in my case as I don’t have a fixed IP address for my two devices (A, B). Their IP addresses are dynamically assigned. But later I realized that I may set port forwarding on C directly. I will try it!

I understand that a direct link between the nodes would be ideal, and that using a relay can introduce additional latency and potential bandwidth limitations. However, I’m still puzzled that the sync speed is far less than the minimum of upload and download bandwidth on [A to C] and [B to C].

I’ve double-checked that the units of speed are consistent and Syncthing’s database is indeed on a fast SSD.

Thank you for your detailed explanation! Any further insights or suggestions would be greatly appreciated!

There’s a small chance that your ISP may be interfering. They may be throttling connections to unfamiliar ports to combat file-sharing traffic.

You could try to use multiple TCP connections:

Actions -> Advanced -> Devices -> Device "Jingze" -> Num Connections

The default is 0 which lets Syncthing choose. At the moment this will result in a single TCP connection. You could test with 4 parallel connections to see if this has any effect.

grafik

Perhaps a bit of a different comment…

I read that you base your expectations of the connection speed between A and B on the SCP speeds reached between A and C and between B and C. But, as it doesn’t sound like C is located on the same network as one of the other devices, this doesn’t inherently mean that the same speeds are expected when going for a direct connection between A and B (besides the obvious differences between how SCP copies stuff and how Syncthing does its job).

In a perfect world this would be the case, but it wouldn’t be the first time that a provider has some vastly inferior peering-connections to specific destinations. I’d make sure that the direct connection between A and B is stable and decent.

Some Syncthing-tuning is also possible, but 2 MB/s should honestly be doable using default configurations when using somewhat OK machines (and non-recent Androids), based on my experience.

Thank you for your suggestion! But it didn’t work for me. The Syncthing process terminated after I modified the NumConnections to 4 in GUI. It cannot be launched even after rebooting my computer. (Don’t worry, I’ve fixed it by directly modifying the config.xml file)

I totally agree with you that the speed between A and B should be further checked before I switch Syncthing to direct connection, and that 2MB/s should be doable. I’m thinking of running some more tests later.

If C has a fixed address, pointing A & B to C with port forwarding should do the trick.

Have you tried that yet?

I’ll provide you feedback once I’ve had time to try it out.

I also use my router’s DNS service to get a stable node name which I use within syncthing.

And I do connect directly using the local IP address when both devices are on my local network. That can look something like

tcp4://192.168.178.123:myport,tcp://mydnsalias.myfritz.net:myport

Here’s an update: I tried to set up a direct connection using UPnP for port forwarding, but unfortunately, I found out that I don’t have access to the router connected to my server.

However, when I tested the connection, I noticed an improvement in speed, achieving the expected 10MB/s. I haven’t made any changes to the settings, so this enhancement might be due to recent network updates carried out by the router’s administrator.

So, one insight we may gain from the discussions in this forum is that a direct connection may be more reliable than a relay server.

Thank you all for your assistance!

By the way, for those who have ssh access but unstable network on tcp connection, try SSH tunneling SSH Tunneling — Syncthing documentation

1 Like

Or better: QUIC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.