"dynamic" pairing vs explicit ip

I have a server S with static IP with open port 22000. It’s generally very responsive, for example if I ssh to it from my laptop L, I don’t wait more than 1s.

I hoped that if I configure L to use static IP instead of “dynamic” when connecting with S, then L would pair with S within, say, less than 10seconds. But this is not the case - in fact sometimes it takes more time than when it’s configured with “dynamic”, in the ballpark of few minutes, not few seconds.

Any suggestions how could I improve pairing times between L and S?

Reduce the reconnect interval in settings, and make sure that static IP’s are before the dynamic entry, as the dynamic entry can take seconds to respond.

Also, syncthing starts connecting roughly 10s after it started, as we try to get UPnP port mappings and all sort of other magic.

I’ve decreased the reconnect interval to 10s and this seems to help so far. Are there any disadvantages to such a short interval?

Also, when you write to make sure that static IP’s are before the dynamic entry: is it about the order of peers in the gui? Because in fact my server with static IP is the last one, and before it there are other devices with dynamic ip’s, but I don’t know how to change this order.

He probably means the order of the entries in the address field for each peer.

Each peer can have multiple addresses. So if you were doing it through the web GUI, you’d put the following in the address box:

example.com, dynamic

In the XML config file, that comes out as two entries like this:

 <device id=[...]>
        <address>example.com</address>
        <address>dynamic</address>
 </device>

Can xml files have order like that? I thought xml was unordered.

No, it’s ordered1. But even so, I don’t think this should be necessary. The lookups don’t take that long, and static addresses usually connect immediately for me. The obligatory debug trace, with STTRACE=net would be good to see the actual connect attempts. Perhaps the dynamic discovery is returning an address that we’re trying to connect to but that takes a long time to time out.

Theoretically we could do connects in parallell - connect to all addresses at the same time, perhaps staggered with a few hundred milliseconds, and use the first one to succeed.

1) Consider, for example, the XHTML <div><p>Hello</p><p>Goodbye</p></div>. It’d be weird if the <p>-s were unordered.

I ran syncthing with STTRACE=net. As it turned out, my firewall configuration was at fault.

Apparently there is some institutional firewall between my laptop L and my Server S (despite that S has a public IP), and it filters all ports except 22, 53,80, 1720 and few others (sadly not 22000). Now I run syncthing on S on 1720, and connections to S are super fast.

Thanks for help!

1 Like

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