|
| 1 | +numConnections |
| 2 | +============== |
| 3 | + |
| 4 | +.. versionadded:: 1.25.0 |
| 5 | + |
| 6 | +``numConnections`` is a device setting that affects connection handling. A |
| 7 | +zero value means to use the Syncthing default. As of version 1.25.0 the |
| 8 | +default is to use one connection, like earlier versions of Syncthing. This |
| 9 | +may change in the future. |
| 10 | + |
| 11 | +Multiple connections will be maintained to the device if you set this to a |
| 12 | +value greater than one. Multiple connections can yield improved performance |
| 13 | +by load-balancing traffic over multiple physical links or in other |
| 14 | +scenarios. |
| 15 | + |
| 16 | +A simple form of negotiation is used to decide how many connections to use |
| 17 | +between a device pair. It goes like this: |
| 18 | + |
| 19 | +- If either side is configured to use a single connection, then a single |
| 20 | + connection is used. Since the default is to use a single connection this |
| 21 | + means that to use more than one connection both sides must be configured |
| 22 | + to do so. |
| 23 | +- If both sides are configured to use multiple connections, then the larger |
| 24 | + of the two values is used. That is, if one side is configured to use three |
| 25 | + connections and the other is set to use eight connections, eight |
| 26 | + connections will be used. |
| 27 | +- A maximum of 128 connections will be used under all circumstances. It is |
| 28 | + likely that the "return on investment" in further connections is |
| 29 | + negligible above about 10 to 20 connections, so this limit should be |
| 30 | + sufficient for all realistic use cases. |
| 31 | + |
| 32 | +.. note:: |
| 33 | + |
| 34 | + Additional connections are established over time, roughly at the rate of |
| 35 | + one per minute when Syncthing is in a steady state, so you may not see |
| 36 | + the expected number of connections immediately after changing this |
| 37 | + setting. |
| 38 | + |
| 39 | +Load Balancing |
| 40 | +-------------- |
| 41 | + |
| 42 | +When there are multiple connections between two devices, one connection is |
| 43 | +dedicated to metadata transmission: index updates, changes to folder pause |
| 44 | +status, etc. Requests and responses are sent over the other connections |
| 45 | +randomly. The number of connections in the GUI is represented as `1 + n` for |
| 46 | +this reason, e.g. if you configure four connections, the GUI will show `1 + |
| 47 | +3` to indicate one metadata connection and three data connections. |
| 48 | + |
| 49 | +Rate Limiting |
| 50 | +------------- |
| 51 | + |
| 52 | +Device rate limiting applies to the sum of traffic on all connections, |
| 53 | +regardless of the number of connections. The limit is not per connection. |
| 54 | + |
| 55 | +Connection Types |
| 56 | +---------------- |
| 57 | + |
| 58 | +Both TCP and QUIC connections are supported for multiple connections. |
| 59 | +Syncthing will, however, only keep connections with the best priority; by |
| 60 | +default, TCP has better priority than QUIC, so establishing a TCP connection |
| 61 | +will cause existing QUIC connections to be closed. Connection priorities can |
| 62 | +be configured. |
| 63 | + |
| 64 | +Multiple connections cannot be established over relays. |
0 commit comments