Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Weighted Round Robin - Is it Possible?

    Scheduled Pinned Locked Moved Routing and Multi WAN
    4 Posts 3 Posters 2.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      ang
      last edited by

      I read in other places in this forum that I could force weighted round-robin by putting the same IP into the config multiple times.  I tried it but it didn't actually work, and I was wondering if anyone has been able to do it successfully.

      I found it will let me put it into the config (note 192.168.0.10 is in the pool twice):

      [2.0-RC3-IPv6][admin@vm-pfs-2.0-rc3.localdomain]/root(23): cat /var/etc/relayd.conf
      log updates 
      timeout 1000 
      table <vip1-realservers> { 192.168.0.10, 192.168.0.20, 192.168.0.30, 192.168.0.60, 192.168.0.10 }
      redirect "VIP1" {
        listen on 10.10.1.101 port 80
        forward to <vip1-realservers> port 80 check http '/'  code 200 
      }
      [2.0-RC3-IPv6][admin@vm-pfs-2.0-rc3.localdomain]/root(24): relayctl show summary
      Id      Type            Name                            Avlblty Status
      1       redirect        VIP1                                    down
      1       table           vip1-realservers:80                     active (5 hosts)
      1       host            192.168.0.10                    100.00% up
      2       host            192.168.0.20                    100.00% up
      3       host            192.168.0.30                    100.00% up
      4       host            192.168.0.60                    100.00% up
      5       host            192.168.0.10                    100.00% up</vip1-realservers></vip1-realservers>
      

      And I ran a script which basically wgets VIP1 multiple times, and as you can see even though I put 192.168.0.10 (web1) in the pool twice, it still only gets served 1/4 of the time.

      [root@centos ang]# ./refresh.sh 
      web1
      web2
      web3
      web6
      web1
      web2
      web3
      web6
      web1
      web2
      web3
      web6
      web1
      web2
      web3
      web6
      web1
      web2
      web3
      

      I'm just curious if anyone was able to tweak their load-balancing.

      1 Reply Last reply Reply Quote 0
      • X
        XIII
        last edited by

        There is an example in the book, so I know it can be done.

        I would post it but then that defeats the purpose of buying the book  ;)

        -Chris Stutzman
        Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
        Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
        freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
        Check out the pfSense Wiki

        1 Reply Last reply Reply Quote 0
        • C
          cmb
          last edited by

          The example XIII is referring to is for 1.2.3, which isn't the same load balancer as 2.0. I'm not sure offhand if that works with relayd, you can do some searching on it to find the answer there.

          1 Reply Last reply Reply Quote 0
          • X
            XIII
            last edited by

            Sorry, didnt see the 2.0 reference in your code sample. Several features are implemented differently in 2.0 from 1.2.3, this is one of them.

            -Chris Stutzman
            Sys0:2.0.1: AMD Sempron 140 @2.7 1024M RAM 100GHD
            Sys1:2.0.1: Intel P4 @2.66 1024M RAM 40GHD
            freedns.afraid.org - Free DNS dynamic DNS subdomain and domain hosting.
            Check out the pfSense Wiki

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.