Skip to content

Why we need load balance mode

yuchting edited this page May 17, 2020 · 6 revisions

The simplest answer of this title question is it's hard to get good bandwidth just in ONE host(IP).

After resolving The former high latency problem , now I need to resolve this bandwidth problem.

As we know if you have a lot of money you can buy a high bandwidth network road from your ISP, but it's too expensive, cannot afford for personal, so that as a personal, you just buy a single small bandwidth from a VPS service provider, in order to guarantee service quality of all their users, most VPS providers need to limit the single IP bandwidth.

How can we use many hosts to merge their bandwidth?

Actually, this is not new idea in IT industry, it's called "load balance", using multi-hosts to resolve some resources problems, okay, we can use this kind of idea to resolve bandwidth problem.

I use 2 of VPS to test, let me call them "vpn" and "vpn1", one of their is limited into 50mbps, but sometime it can be up to 200mbps, the other one, the provider doesn't say limitation but I used it for many years, it hasn't reached 200mbps.

These two hosts are in same location, ping value between them is lower than 5 ms, it's important for bandwidth load balance, because I use nat router as a host running trojan, it also proxy DNS udp protocol, if their distance it too far, the one of them proxy DNS resolves IP, and the other connect that IP, it might very very slow.

Before I use new load balance feature, my bandwidth shows as following:

iftop shows the progress when speedtest.net is testing:

you can see one of IP is up to 160mbps+, the other one is not used.

then I start a load balance, my bandwidth:

iftop shows two of IP is used for transferring:

the bandwidth is near 400mbps, cool!

Let me show you how it realized and how config it: How to realize load balance and configure it