pf Load Balancing Question - BSD

This is a discussion on pf Load Balancing Question - BSD ; I would like to use pf for handling load balancing for a Ruby on Rails web application. We have a number of servers (e.g., 192.168.1.1, 192.168.1.2, etc.) in a cluster. Each server runs a number of Mongrel web servers on ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: pf Load Balancing Question

  1. pf Load Balancing Question

    I would like to use pf for handling load balancing for a Ruby on Rails web
    application. We have a number of servers (e.g., 192.168.1.1, 192.168.1.2,
    etc.) in a cluster. Each server runs a number of Mongrel web servers on
    different ports (e.g., 3001, 3002, etc.). We have one public IP
    address (e.g., 10.0.0.1). I want to redirect 10.0.0.1:80 to my pool of
    Mongrel servers.

    Is it is possible for pf to pick from a pool that looks like this?

    192.168.1.1:3000 192.168.1.2:3000 192.168.1.3:3000 ...
    192.168.1.1:3001 192.168.1.2:3001 192.168.1.3:3001 ...
    192.168.1.1:3002 192.168.1.2:3002 192.168.1.3:3002 ...
    .... ... ... ...

    I know it's possible for pf to go from 10.0.0.1:80 to 192.168.1.1:80,
    192.168.1.2:80, etc., but is it possible to use a range of ports at the
    destination?

    Thank you.

  2. Re: pf Load Balancing Question


    > I know it's possible for pf to go from 10.0.0.1:80 to 192.168.1.1:80,
    > 192.168.1.2:80, etc., but is it possible to use a range of ports at the
    > destination?



    Look at "relayd".

    Cheers,

    --
    Micha³


  3. Re: pf Load Balancing Question

    On Sun, 3 Aug 2008 22:45:53 +0200, Micha? Kurowski wrote:
    >
    >> I know it's possible for pf to go from 10.0.0.1:80 to 192.168.1.1:80,
    >> 192.168.1.2:80, etc., but is it possible to use a range of ports at the
    >> destination?

    >
    > Look at "relayd".


    Thanks, but I don't think you can specify a range of target ports in
    relayd. The man pages only reference "port _port_", never "port "
    or "port { _port_, _port_ }" or something similar. If relayd does support
    ranges, I can't figure out the syntax. relayd -n certainly doesn't like
    "port { 3000, 3001 }" or even "table { 3000, 3001 }".

    Am I missing something?

+ Reply to Thread