load balance a file download across two connections - success!

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




First of all, thanks to this group for the awesome documentation on the load balancing and thanks to http://www.ssi.bg/~ja/nano.txt. I'm now balancing a DSL and Cable Modem account (DSL is 1.5/768 and Cable is 3/256). It took some work but I learned a lot along the way.

For a few sites that I tend to download a lot from, I found that I could configure Flashget (http://www.amazesoft.com/) to use its 'multiproxy' in a way that would enable me to split the download. The setting was originally designed to help you make multiple connections to a download site via different proxy servers, thus bypassing a max connection limit. What I did instead was just define fake proxies (actually the real site) with the only difference being the port. This way Flashget breaks up the download into some pieces on 80, some on port 81. Of course, the site you are downloading from must support multiple ports. Many news servers support multiple ports to assist users getting around any firewall restrictions, etc.

After configuring Flashget I made some rules on my linux load balancer saying that port 80 (to the specific ip) goes out the cable modem, port 81 out the DSL. I realized 550KB download speed! Here's a screenshot:
http://www.burnpc.com/images/flashget1file544KB.gif

Here's what I did in my shell script:
echo "balancing easynews..."
EASYNEWS="140.99.99.100"
$IPTABLES -A PREROUTING -i $IFI -t mangle -p tcp --dport 80 -j MARK --set-mark 1
$IPTABLES -A PREROUTING -i $IFI -t mangle -p tcp --dport 81 -j MARK --set-mark 2
# I manually added tables 206 and 207 to rt_tables, but for a one time config you could uncomment

# the two lines below
#echo 206 easynews1.out >> /etc/iproute2/rt_tables
#echo 207 easynews2.out >> /etc/iproute2/rt_tables
ip rule add fwmark 1 table easynews1.out
ip rule add fwmark 2 table easynews2.out
ip route add $EASYNEWS via $GWE1 dev $IFE1 table easynews1.out
ip route add $EASYNEWS via $GWE2 dev $IFE2 table easynews2.out


For my full script you can look here:
http://www.burnpc.com/website.nsf/all/FE5F4F294F508EB786256E600019BC30


HTH,
-Ron

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux