Load Balancing

The host rule for a single proxy instance can include a list of multiple destination servers that reverse proxy will use to distribute transfer sessions. If a destination does not respond, reverse proxy marks it as faulty, logs this information, and tries the next destination in the list. While the server is marked as faulty, reverse proxy will not forward transfers to it. After two minutes, the faulty mark is removed, and the server is returned to the list of available servers.

Enabling Load Balancing

To turn on the balancing feature in the proxy server's aspera.conf, set <balancing> to round_robin (currently the only supported balancing method). Each destination is specified with a <host> tag and the host tags list is defined using <hosts>. Each <host> specifies the destination host's IP address and the SSH port to which it connects. For example:

<rule host_ip="10.20.101.151">
    <balancing>round_robin</balancing>
    <hosts>
        <host>10.20.103.133:33001</host>
        <host>10.20.103.134:33001</host>
        <host>10.20.103.135:33001</host>
    </hosts>
    <keyfile>/home/$(user)/.ssh/id_rsa</keyfile>
</rule>

UDP Port Requirements for Load Balancing

Load balancing requires exposing multiple UDP ports on reverse proxy. Ports are opened based on the value specified by <proxy_port> (33001 if not specified). The formula for port exposure is proxy port base + the number of the host in the load-balance configuration. For example, if the load is to be balanced among three host destinations and the aspera.conf configuration uses the default UDP proxy port value (33001), the three UDP ports for reverse proxy will be 33001, 33002, 33003. In this case, the port numbers used on the destination hosts do not matter.

The reverse proxy server in the above example determines port numbers by incrementing from proxy port 33001, the default port number. However, users may want to expose different port numbers to the outside world. To do this, set <proxy_port> to a different value, and reverse proxy will use this as the starting point for opening the series of consecutive port numbers for load balancing, turning off UDP port reuse, or combinations of both. For example, if <proxy_port> is set to 5555 in the above configuration, the four proxy ports that would be opened are 5555, 5556, 5557, and 5558.

Note: When setting up load balancing, make sure the UDP ports specified by <proxy_port> are allowed on the firewall.

UDP Port Reuse and Load Balancing on Windows

If load balancing is used because the destination hosts are Windows, <udp_port_reuse> must be set to false. In the setup below, concurrent transfers from four clients are being load-balanced between two Windows destinations.