WAN1 1MBit, WAN2 6MBit, optimise load balancing with round robin & failover



  • Hello all,

    I managed to set up 1.2 Beta test-snapshot 6.6.2007 with LAN, WAN and OPT1 interfaces.

    Load Balancing and failover work really well, except one small upcoming "Situation".

    We use two different ADSL-Lines, one 1024 / 128, the other 6144 / 512.

    With round robin, they are equally used, so if the 1024 is at 100% load, the 6144 is below 20 % of max speed.

    As I need to use failover, i don't use policy based LB, because i don't have any clue what happens to my policies concerning the interface which is going down (For example, sending pop/smtp over WAN, when WAN is going down (no connection), there will be no Mail for anyone,i suppose!?!)

    So, this leads me to the hope, that there might be a possibility to tell the round robin code, not to do a 1:1, but a 2:1 or 6:1 load balance, hence send every 2nd or 5th or 6th or whatever new connection down the second interface, matching the different speeds.

    I don't know if thats a setting somewhere in a .conf or .xhtml file, or if this behavior is hardcoded, but if it isn't, I would be glad to learn where to change that.

    If it is hardcoded, perhaps some of the Developers may be able and willingly to think about implementation of this feature??

    Thanks in advance,

    Schnulch



  • @Schnulch:

    As I need to use failover, i don't use policy based LB, because i don't have any clue what happens to my policies concerning the interface which is going down (For example, sending pop/smtp over WAN, when WAN is going down (no connection), there will be no Mail for anyone,i suppose!?!)

    For this, you can create multiple failover pools. EG- you have a T1 and Cable. You create three pools:

    1. Balance both connections
    2. T1 failover to Cable
    3. Cable failover to T1

    Then you can use policy based routing with failover, such as route http over pool 3, smtp over pool 2, default traffic pool 1, etc.



  • dotdash,

    perhaps I don't fully understand what's happening with loadbalance pools:

    I have the three pools you mentioned already set up and running, so if i cut any of my two internet connections, all traffic up and down uses the one active interface. I actually just use round robin LB, but will use policy based LB if failover can be achieved with it too.
    So far no problems at all. The Web-GUI shows the online- and offline- status of the interfaces / pools correctly, everything workes.

    But if I now use your example config and set smtp to pool 2 (T1 failover to Cable) policy base routing, this means, to me, just use LB pool 2 for smtp. Pool 2 will use Cable, because T1 has (probably) failed and Cable is the first Interface in the LB pool.
    If in the above case T1 is alive, but Cable has died, I don't see how my smtp traffic will be served, as the pool specified for smtp would use Cable, but Cable is down.

    Or did I misunderstand the meaning of this pool, and it will use the first Interface for traffic as long as it is up, and if it fails it will switch to the second interface (not LB pool, I mean the Interface inside this pool) if the second IF is up?

    In this case, will this pool be used, even if the third pool is active, because the first internet line in the second pool is down?

    Perhaps i don't get the whole picture here, I'm pretty new to load balancing internet connectivity.
    If you, or somebody else could clarify this for me, I would be very appreciative!

    Thanks in advance,

    Schnulch



  • The first pool would be round-robin and the other two would be failover.
    So let's assume I had a firewall rule matching http sending to gateway(pool) 3, a rule matching smtp using gateway 2, and the default rule using gateway 1.
    Web browsing would use the cable connection unless the cable was down, then it would use the T1.
    Mail would send out the T1 unless it was down and in that case use the cable.
    Other traffic would use either line round robin.
    Of course, to get mail, you would need a second MX pointing to a VIP off the cable, and a port-forward to match.



  • Thank you very much, I think I get it finally! I was mislead to the point that only the first interface of a failover pool would work, what, if I think about it again, doesn't make a lot of sense!  ???

    Well, then it's policy based LB, i guess!

    Thanks again!



  • Weighted round robin would be a nice feature tho. I saw one of the Linksys boxes has drop-downs for the upload/download speed that it uses for weighting. I'm not sure how well it works and you only have a half-dozen or so choices on the menu. Even a cheap hack that would duplicate the faster WAN in the round-robin pool if the bandwith was 2x the other would be helpful in some situations.



  • Told you so! ;)

    For the "not that experienced" users (don't you dare to think that includes me!)  ;D this would be a nice and easy way to get LB with failover working with different speed lines.

    And yes, your idea seems easy to adopt, just create the entry for the faster line as many times as it is faster than the slower one in the round robin table, and there you go.

    But I actually don't have any idea, if there really is some kind of "table", and if there is one, where to look for it (or it's generation, because that would be the place to change "things", i guess!)

    Does anybody have an idea (or two….) ;)



  • @dotdash:

    Weighted round robin would be a nice feature tho. I saw one of the Linksys boxes has drop-downs for the upload/download speed that it uses for weighting. I'm not sure how well it works and you only have a half-dozen or so choices on the menu. Even a cheap hack that would duplicate the faster WAN in the round-robin pool if the bandwith was 2x the other would be helpful in some situations.

    I have an Edimax Load Balancing Router that offers this. You can use an arbitrary weighted round robin, you can use session routing, you can specify the speeds of your connections and balance based on those. It's great. Except that FTP doesn't work on it… period. So wrong. That's why I'm using pfSense :)



  • well, you can guess why i chose to take a closer look at pfsense twice, but you'll only gonna need one!

    I tried one of those "loadbalancing soho routers" from Allnet - not my best choice yet, not to say ugly things about it…..

    Then I tried Netgear (about 250 US$), not cheap, but if it works well, why not - ok, not so well, in fact, massive probs with https-sessions broken (used both wan-ports for single onlinebanking session - not so good then...) and sometimes DNS-Querys just got lost, so no answer to browser, except "server not found".

    My next choice would have been a small, tiny Cisco Loadbalancer, not exactly the price of a new car - even a japanese one (by the way, i own a Honda Civic! - so no hard feelings - ok?)- but a nice Homecinema Flatscreen TV would fit much better in the plans of the wife than this "little gray box".
    So I have to investigate open source software if anything there could be my salvation. And now it looks like I've found, what I'm looking for (unlike Bono).

    So I consider this "Bounty" thing for adjustable round robin Load Balancing. Perhaps, if there are some others, we could join for a bounty and make the developers or advanced users help us on this one? I don't know how much work it would be, but I would not wonder if it could be resolved quite fast (and cheap ;) )


Log in to reply