Skip to content

Enhancement: Network Load Balancing #4202

Closed

Description

@jebeld17

Please add support for Network Load Balancing/Multihoming into Syncthing.

Adding such support will help in situations where the user has more than one network card or interface on his or her machine - as only one card or interface is currently supported by Syncthing.

Activity

  1. AudriusButkevicius commented on Jun 7, 2017

    @AudriusButkevicius
    Member

    This is the job of the OS, the OS can do bonding if it wishes.

  2. jebeld17 commented on Jun 7, 2017

    @jebeld17
    Author

    What if the OS doesn't officially support it?
    Can a feature be implemented into Syncthing that allows one card to do one task and another card perform another task? (such as in/out or folder a/b?)

  3. AudriusButkevicius commented on Jun 7, 2017

    @AudriusButkevicius
    Member

    If the OS does not support it, you should change your OS to use full potential of your hardware.

    Sure, we can fit a rocket engine to syncthing and fly it to the moon, but why would we?

  4. Ferroin commented on Jun 9, 2017

    @Ferroin

    Bonding/Etherchannel/802.3ad/Teaming/<insert your OS's name here> is the job of the OS. It's also not the only method of network load balancing, and has significant issues for most regular users (namely, everything has to be set up exactly right otherwise things break (especially with actual 802.3ad)). A suggestion to change your OS if it doesn't support it is somewhat ridiculous also, considering that only the server editions of Windows and OS X actually support it, and you shouldn't (or can't) run those on client nodes, and most people don't have the patience to learn to use a different OS.

    Multi-homing though (having multiple networks with their own addressing connecting 2 or more nodes) requires application support, not OS support. It's not an OS feature (unless you're using SCTP or the non-standard extension for TCP, but those do still require some degree of support in the application), but something the application itself needs to be involved in. It also provides means of both failover and load-balancing, and it's implemented in layer 4 or higher (whereas bonding and friends are all layer 2), which means you can do it cross-platform. I personally don't agree that it's out of scope, but I will say that it's probably way more effort than it's worth, since getting it working correctly and reliably without using SCTP or the TCP extensions is hard, while most people probably aren't going to see any benefit.

  5. calmh commented on Jun 9, 2017

    @calmh
    Member

    Is there some prior art on other applications in our solution space doing this?

  6. Ferroin commented on Jun 9, 2017

    @Ferroin

    Not that I know of. Like I said, it's not a situation that will benefit a majority of users, as multi-homing is largely used in failover setups for WAN connections (especially ATM or X.25 networks because you can't do bonding there since it requires Ethernet as the underlying layer 2 protocol as implemented in every OS I know of which supports it). That said, improving file transfer efficiency by running over multiple networks is one of the possibilities for more widespread usage that's talked about somewhat regularly.

    FWIW, now that I think about it, implementing this could be as simple as just doing local discovery on all interfaces and making one connection over each without eliminating duplicates (so, if device A and device B are both connected via Ethernet and WiFi, establish connections between them across both networks, not just one like we do currently). The way in which Syncthing itself works already handles most of what's involved in the load balancing, so the only issue should be converting the 1:1 mapping of connections to devices to N:1.

  7. calmh commented on Jun 9, 2017

    @calmh
    Member

    I'd like to see at least one practical scenario where this would make an appreciable difference, for something like at least 1% of users, for it not to be clearly out of scope.

    Keeping in mind that in my experience, Syncthing is almost never limited by the (local) network speed. The usual bottlenecks are CPU, disk I/O and network latency.

  8. Ferroin commented on Jun 9, 2017

    @Ferroin

    Like I had said in one of my earlier posts, I don't think it's out of scope in the sense of functionality that's better handled elsewhere, but I will agree that it's probably not worth the effort of implementing given the minimal benefit for most users.

    The primary situations I see where this could help are:

    1. Two devices on multiple local networks (most likely WiFi plus some other network link). This situation could also be improved by having some more intelligent performance detection in Syncthing itself to be entirely honest (for example, I have a VPN configured on my laptop and home server, and when they're on the same network, Syncthing will just as often run over that VPN instead of the local network link).
    2. Two devices that have to use relays where the relays have lower throughput than the devices themselves. This would be just as much about load balanced routing through the relays however, and would likely be much harder to implement.

    I'd be willing to bet that case 2 is actually pretty common, but it would need some for of limiting so that one person with a couple of 10G uplinks can't swamp all the relays. Case 1, as I mentioned there, could largely be improved by simply checking bandwidth on each possible connection path to a node and automatically selecting the highest bandwidth link.

  9. calmh commented on Jun 9, 2017

    @calmh
    Member
  10. Ferroin commented on Jun 9, 2017

    @Ferroin

    There is a legitimate case for having some sort of detection so that the faster link is preferred (by interface link speed, bandwidth detection, routing preference, or whatever). Apart from that, like I said, I think this is almost never the bottleneck. I have relatively fast computers and semi modern WiFi, and Syncthing almost never saturates the WiFi. (Single threaded connection crypto is always my bottleneck.)

    Same here, although I do still get noticeably higher bandwidth when using a direct connection than using WiFi, and the difference for the specific case I have (default-on VPN between two systems that may or may not be on the same network) is close to a factor of 10-20 in terms of performance.

    Also questionable if we want to. The relays are intentionally a last resort form of communication, and usually have draconian bandwidth limits. Trying to circumvent those limits by opening more connections or connecting to multiple relays seems like a form of abuse, to me.

    Agreed, I was only listing it out of the interest of completeness.

  11. jebeld17 commented on Jun 10, 2017

    @jebeld17
    Author

    Well - regardless if multihoming will be brought as a user-defined feature to Synching, I must say it's at least good we are having this discussion! :-)

  12. added
    frozen-due-to-age
    on Jun 8, 2018
  13. locked and limited conversation to collaborators on Jun 8, 2018
  14. marclaporte commented on Jun 18, 2023

    @marclaporte
    Member

    Will be addressed soon: #8918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions