Apache load balancing

Source: Internet
Author: User
Author: the disadvantage of aolinksR-proxy is that when one of the web servers stops running, apache will still forward the request, resulting in a 502 gateway error. 1) configure the polling balancing policy to go to the conf directory of Apache, open the httpd. conf file, and add: Proxy...

Author: aolinks
The disadvantage of R-proxy is that when one of the web servers stops running, apache still forwards the request, resulting in a 502 gateway error.

 

 

1) configure a polling balancing policy

Go to the conf directory of Apache, open the httpd. conf file, and add the following content to the end of the file:
ProxyPass/balancer: // proxy/# note that it ends "/"

BalancerMember http: // 192.168.6.37: 6888/
BalancerMember http: // 192.168.6.38: 6888/


2) weight-based balancing policy configuration

ProxyPass/balancer: // proxy/# note that it ends "/"

BalancerMember http: // 192.168.6.37: 6888/loadfactor = 3
BalancerMember http: // 192.168.6.38: 6888/loadfactor = 1


3) configure the server load balancer policy for responding to weight requests

ProxyPass/balancer: // proxy/lbmethod = bytraffic # note that it ends "/"

BalancerMember http: // 192.168.6.37: 6888/loadfactor = 3
BalancerMember http: // 192.168.6.38: 6888/loadfactor = 1
 


 

2) load balancing is based on the number of requests as the weight, and (3) load balancing is based on the traffic as the weight, which is the biggest difference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.