Haproxy provides high availability, Load Balancing and proxies based on TCP and HTTP applications that support Virtual Host , it is a free, fast and reliable solution. Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier processing. Experiment (I.)Experimental purpose: Using Haproxy to do load balancing
use_cpu_affinity=1
use of resources during pressure measurement
Mem:
Latest New Edition: 10G
System with version: 102G, due to insufficient memory, the use of swap,
Cause CPU iowait accounted for a large increase, resulting in CPU idle 0.
CPU Idle:
Latest edition: 35%
System with version: 0%
Conclusions
Under the same pressure, the new version of Haproxy uses a large amount of memory reduction.
Environment construction
Basic InformationWhat is HAProxy?
Haproxy provides high availability, Server Load balancer, and TCP and HTTP application-based proxy. It supports Virtual Hosts and is a free, fast, and reliable solution. Haproxy is especially suitable for websites with extremely high loads, which usually require session persistence or layer-7 processing.
supports Virtual Hosts, but it is easy to configure and has a very good server health check function. When the back-end server of the proxy fails, haproxy will automatically remove the server, and then automatically add the server after the fault is recovered. The new 1.3 introduces frontend, backend, and frontend to match rules based on any HTTP request header content, and then directs the request to the relevant backend.
Ii. Load Balancing using ha
HAProxy introduction, haproxySimple Description
HAProxy provides high availability, Server Load balancer, and TCP and HTTP application-based proxy. It supports Virtual Hosts and is a free, fast, and reliable solution. HAProxy is especially suitable for websites with extremely high loads, which usually require session persistence or layer-7 processing.
A. What is Haproxy
Haproxy provides high availability, load balancing, and proxies based on TCP and HTTP applications to support virtual hosts, a free, fast, and reliable solution. Haproxy is especially useful for Web sites that are heavily loaded, which typically require session maintenance or seven-tier processing. Haproxy
I system RedHat6.4, haproxy version is haproxy-1.3.15.10.tar.gzInstallationinstallation PCRE– [Email protected]~]# yum-y Install pcre pcre-devel Unzip and enter the Haproxy directory– [Email protected]~]# tar xvzf haproxy-1.4.24.tar.gz– [[Email protected]~]# CD
operating system when using Haproxy
2. Installation
Go to haproxy website Download address http://www.haproxy.org/
Official website Current stable version 1.7.8 version download address
Http://www.haproxy.org/download/1.7/src/haproxy-1.7.8.tar.gz
Tar zxvf haproxy-1.7.8.tar.gz
cd
to other IP or other accesses, the request will be dispatched to the two back-end real servers specified by server_www.Testing the failover capabilities of the HaproxyThis assumes that the httpd service of a back-end server 192.168.88.82 The SERVER_WWW group is stopped, and when the site is accessed through a www.tb.com or tb.com domain, the failed node will not be accessed because when the httpd service is stopped, Haproxy through HttpchkThe method
HAProxy Usage Details
HAProxy details
HAProxy is a free, fast, and reliable solution for providing high availability, load balancing, and proxy services for TCP and HTTP-based applications, it is especially suitable for websites with high load and require persistent connections or layer-7 processing mechanisms. HAProxy
, 5xxLoad balancing Common scheduling algorithmRR (Round Robin): Polling ScheduleLC (Least Connections): Minimum number of connectionsSH (source Hashing): Source-based access schedulingCase study: Case environmentComprehensive experiment: Build hproxy Cluster * *1. Experimental topology2, the virtual machine's experimental environmentA haproxy server, two Nginx servers, build two different websites (easy to test the cluster), a client online testing.3
haproxy+keepalived high availability for load balancingFirst, the environment5 virtual machines, respectively:1 sets of test machines (192.168.2.83);2 sets of haproxy/keepalived (192.168.2.230/192.168.2.231);2 Web Servers (192.168.2.232/192.168.2.233);Note: The VIP setting is 192.168.2.228;Second, install the configuration Web ServerBecause the installation and c
use keepalived to check the health status. If one fails, the vip is automatically migrated to the backup host.
650) this. width = 650; "title =" ttt.jpg "alt =" wKiom1LfFkqhcu7-AADg9tgJ_Ho972.jpg "src =" http://www.bkjia.com/uploads/allimg/140207/2156225026-0.jpg "/>
I have to say that before receiving this task, I was completely a linux hacker, and I couldn't even do anything about linux .. So if I have written something wrong in this article, please point it out more.
Well, although I won't
1. Hide back-end server versionsIn our daily work we use haproxy as a load balancer, because the backend application server is more cumbersome to change, so it is decided to implement it in the load balancer.Only need to frondend or listen or backend, addRspidel ^server:.* rspidel ^x-forwarded-for:.* rspidel ^x-powered-by:.* rspidel ^via:.* rspide L ^x-aspnet-version:*The above use can refer to Rspidel.In addition, if you need to confuse some people t
performance is similar to Haproxy;Apache------> Poor functionalityThe Haproxy configuration file is divided into four sections:Global configuration:Global: Configuration SegmentAgent configuration:Default: Defaults configuration-----> All the same content in backend, frontend, Linsten can be defined here;Frontend: Previous Configuration-----> Define front End sockets, accept client requests;Backend: Backen
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.