Apache Simple Load

Source: Internet
Author: User

ApacheLoad Balancing

In general, load balancing is the client's request to the backend of the various real servers, to achieve load balancing purposes. Another way is to use two servers, one as the primary server (master), the other as a hot Standby, request all the primary server, when the primary server, immediately switch to the backup server to improve the high availability.

This module must be available:

Loadmoduleproxy_module modules/mod_proxy.so

Loadmoduleproxy_balancer_module modules/mod_proxy_balancer.so

1. Normal Load:

Proxyrequestsoff

<Proxybalancer://server3.example.com>

Balancermember http://192.168.88.128:80

Balancermember http://192.168.88.129:80

</Proxy>

Proxypass/test balancer://server3.example.com/

# here access to Server3.example.com/test can be accessed, the reason is to add test, is not with the following access/balancer conflict, otherwise access/balancer is also assigned to Realserver above

# The following is the status Web statistics of the access, the production environment is not added as well

<Location/balancer-manager>

SetHandler Balancer-manager

Order Deny,allow

Allow from all

</Location>

2. weight load:

Proxyrequestsoff

<Proxybalancer://server3.example.com>

Balancermember http://192.168.88.128:80loadfactor=8

Balancermember http://192.168.88.129:80loadfactor=1

</Proxy>

3. Other load algorithms:

Proxyrequestsoff

<Proxybalancer://server3.example.com>

Balancermember http://192.168.88.128:80loadfactor=8

Balancermember http://192.168.88.129:80loadfactor=1

</Proxy>

Proxypass/test balancer://server3.example.com/ lbmethod=bytraffic

Lbmethod the possible values are:
Lbmethod=byrequests by Request number equalization (default)
Lbmethod=bytraffic according to the flow balance
Lbmethod=bybusyness in a busy balance (always assigned to the server with the fewest number of active requests)

4. Hot Standby

the implementation of hot backup is simple, just add status=+h property, you can designate a server as a backup server , Access has been in the 192.168.88.128, only it hangs, only to 129.

<Proxybalancer://server3.example.com>

Balancermember http://192.168.88.128:80loadfactor=8

Balancermember http://192.168.88.129:80loadfactor=1 status=+h

</Proxy>


Apache Simple Load

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.