The general use of load balancing is to use different technologies depending on the stage of the site's ascent. Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV less than 10 million, with Nginx can be completely; if there are many machines, you can use DNS polling, LVS consumes more machines or more, large web sites or important services, and the server is relatively long, You can consider using LVS. One is through the ha
Ps:nginx/lvs/haproxy is currently the most widely used three load balancing software, I have been implemented in a number of projects, reference to some information, combined with some of their own experience, summed up.The general use of load balancing is to use different technologies depending on the stage of the site's ascent. Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV
Ps:nginx/lvs/haproxy is currently the most widely used three load balancing software, I have been implemented in a number of projects, reference to some information, combined with some of their own experience, summed up.The general use of load balancing is to use different technologies depending on the stage of the site's ascent. Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV
. Therefore, it is not required for small network services for the time being; in addition, it is similar to Nginx/LVS/HAProxy's Linux-based open-source free server load balancer software, which is implemented at the software level, so the cost is very low.
Currently, the website architecture is generally reasonable and popular: the Web front-end uses Nginx/HAProxy + Keepalived as the load balancer, and the
The general use of load balancing is to use different technologies depending on the stage of the site's ascent. Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV less than 10 million, with Nginx can be completely; if there are many machines, you can use DNS polling, LVS consumes more machines or more, large web sites or important services, and the server is relatively long, You can consider using LVS.One is through the hard
PS: nginx/LVS/haproxy is currently the most widely used three load balancing software. I have implemented these software in multiple projects. I have referenced some materials and combined some of my experience in using it, to sum up.
Generally, Server Load balancer uses different technologies at different stages as the website scale increases. Specific Application requirements have to be analyzed. For small and medium-sized web applications, such a
and find out if there are 2 ways to resolve in the configuration
1 set Minconn to a larger parameter
2 directly set to Minconn and Maxconn, completely remove the minimum limit, for the concurrency volume according to maxconn configuration.
For the 2nd case, you can see in the code
That is, if the two are the same size, Max returns to S->maxconn. There's no problem with that.
5 Mail exchange with Haproxy authors
Since it is open source software,
Specific application needs to be specific analysis, if it is small and medium-sized Web applications, such as the daily PV less than 10 million, with Nginx can be completely; if there are many machines, you can use DNS polling, LVS consumes more machines or more, large web sites or important services, and the server is relatively long, You can consider using LVS. One is through the hardware to carry out, the common hardware has more expensive F5 and array and other commercial load balancer, its
Haproxy is currently a popular cluster scheduling tool, similar cluster scheduling tool has many, such as LVS and Nginx, compared to the best performance of LVS, but the construction of relatively complex, Nginx upstream module support cluster function, but the cluster node health Check function is not strong, Performance is not hapr oxy good. The official website of Haproxy is http://
I. Preparation 1. prepare the server to establish the MySQLCLuster system with two nodes, and use six servers to establish Haproxy43; mysqlcluster (MySQL Cluster) system node configuration description the IP address and port of the node Haproxy server load balancer (1) centos I. preparations
1. prepare the server
Establish a MySQL CLuster system with two nodes and build a Haproxy + mysql cluster (MySQL CLu
. pid
Ults
Log global
Mode http
# Option httplog
Option dontlognull
Retries 3
Option redispatch
Maxconn 8000
Contimeout 3000
Clitimeout 30000
Srvtimeout 30000
Listen mysql
Bind 0.0.0.0: 3306 # proxy Port
Mode tcp # mode TCP
Option mysql-check # user root # mysql health check root is the mysql login Username
Balance roundrobin # Scheduling Algorithm
Server mysql1 1.1.1.21: 3306 check port 3306 # weight 1 check inter 1 s rise 2 fall 2 # health check plus check
Server mysql2 1.1.1.22: 3306 check p
Tags: mysql cluster haproxyFirst, prepare1. Prepare the serverBuild a MySQL cluster system with 2 nodes and build haproxy+mysql cluster (MySQL cluster) system using 6 servers
node Configuration Instructions
Node
The corresponding IP and port
Haproxy Load Balancer (1) CentOS 6.3
1.1.1.11
Management node (1) CentOS 6.3
1.1.1.30
SQ
Objective Software load Balancing is generally implemented in two ways: operating system-based soft load implementation and soft load balancing based on third-party applications. LVS is a kind of soft load based on Linux operating system, while Haproxy is a soft load based on third party application. Haproxy compared to the use of LVS is much simpler, but like LV
option Dontlognull contimeout theClitimeout50000Srvtimeout50000frontend localnodes Bind*:1002 #HAProxy listening on port 1002 mode http default_backend Swift-Cluster Maxconn -option Forwardforbackend Swift-cluster mode http balance roundrobin #使用轮询策略option Httpchk HEAD/healthcheck http/1.0option forwardfor # when mode is "http", the forwardfor is set so that the original source IP address is saved via the x-forward-for headerServer Proxy19.115.251.23
Web schemaDescribe the purpose of each server:1, Haproxy to achieve the back-end Web server load Balancing2, keepalived to achieve the high availability of haproxy3, Apache static page access to implement4. Dynamic page access for Aoache dynamicsWhat is keepalived?Keepalived is a routing software written in C. The main goal of this project are to provide simple and robust facilities (capability) for loadbalancing and high-availability to Li Nux system
access log, you can modify the script implementation.
#!/bin/bash #
Author:koumm #
desc:
# date:2013-01-31
# version:v1.0 #
Modify:
# Cut Haproxy Log
Mv/var/log/haproxy.log/var/log/haproxy.log.bak
if [-e/var/log/haproxy.log.bak]; then
Logrotate-f/etc/logrotate.conf
chown nobody:nobody/var/log/haproxy.log
chmod +x/var/log/haproxy.log
fi sleep
1
if [-e/var/log/haproxy.log]; then
rm-rf/var/log/haproxy.log.bak
fi
(3)
balancer in the network is divided into two types: one is carried out through hardware, common Hardware includes expensive NetScaler, F5, Radware, Array, and other commercial load balancers, and Linux-based open-source load balancing policies similar to LVS, Nginx, and HAproxy,
In commercial Server Load balancer, NetScaler is more efficient than F5. For Server Load balancer, the commercial Server Load bala
permission is displayed, you can set it:
1: chmod 755 /var/run/stunnel/
-------------------------------------------------------------------------------About SSL certificates
Use your own certificate:
1: openssl req -new -x509 -days 365 -nodes -out stunnel.pem -keyout stunnel.pem
If the existing certificate is imported into pfx and Ca (the corresponding cafile parameter is set in the configuration file ):
1: openssl
2: // convert CER to PEM
3: openssl>x509 -in cacert.cer -out c
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.