Using mod_rewrite load balanced
APACHE mode_rewrite reading documents, referred to rewrite a number of methods used to achieve a balanced load method, recorded.
Load balanced
- Description:
How to balance
www.foo.comload towww[0-5].foo.com(a total of 6 servers)?- Program:
This issue there are many possible solutions, in this, we discussed commonly known as "Based on DNS (DNS-based) of" programs, and special use
mod_rewriteprogram:- DNS cycle (DNS Round-Robin)
The easiest way is to use
BINDcyclical nature of the DNS, as long as the customary set upwww[0-9].foo.comthe DNS of the A (address) records, such as:www0 IN A 1.2.3.1 www1 IN A 1.2.3.2 www2 IN A 1.2.3.3 www3 IN A 1.2.3.4 www4 IN A 1.2.3.5 www5 IN A 1.2.3.6
Then, increase the following:
www IN CNAME www0.foo.com. IN CNAME www1.foo.com. IN CNAME www2.foo.com. IN CNAME www3.foo.com. IN CNAME www4.foo.com. IN CNAME www5.foo.com. IN CNAME www6.foo.com.
Note that the above may seem wrong, but in fact, it is indeed a
BINDa desired characteristics, but also can be used. In any case, nowwww.foo.comhas been analytical,BINDcan be givenwww0-www6- although each time there will be minor in order replacement / cycle, the client's request can be distributed to each server. However, this is not a good load-balancing program, because, DNS analytical information can be other name server network buffer, and oncewww.foo.combe resolved forwwwN.foo.comwhile its follow-up request will be sent towww.foo.comBut the final result is correct, because the total amount of the request was indeed distributed to each server
- DNS cycle (DNS Round-Robin)











































