I. haproxy
HaproxyProvides high availability, Server Load balancer, and proxy Based on TCP and HTTP applications, and supports Virtual Hosts. It 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. Haproxy runs on the current hardware and supports tens of thousands of concurrent connections. In addition, its running mode enables it to be easily and securely integrated into your current architecture, while protecting your web servers from being exposed to the network.
Haproxy implements an event-driven, single-process model that supports a large number of concurrent connections. Multi-process or multi-thread models are limited by memory, system schedulers, and ubiquitous lock limits, and are rarely able to process thousands of concurrent connections. Because the event-driven model implements all these tasks on a user-space with better resource and time management, there is no such problem. The disadvantage of this model is that in multi-core systems, these programs are generally less scalable. This is why they must be optimized to make every CPU time slice (cycle) do more work. ----- Baidu encyclopedia
Ii. haproxy static and dynamic Separation
1) test Topology
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/EB/wKioL1Qe9MugkP_MAADGosqwg_k327.jpg "Title =" haproxy.png "alt =" wkiol1qe9mugkp_maadgosqwg_k327.jpg "/>
2) test environment preparation
S1 and S2 and haproxy servers are in the same network segment. Select vment3.
1) Modify S1 [[email protected] ~] # Ifconfig eth1 192.168.16.1/24 up # configure the IP address for eth1 [email protected] ~] # Ifconfigeth0 link encap: Ethernet hwaddr 00: 0C: 29: B2: ad: BA Inet ADDR: 172.16.16.2 bcast: 172.16.255 mask: 255.255.0.0 inet6 ADDR: fe80: 20c: 29ff: feb2: adba/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 11122303 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 1193136 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 1000 RX Bytes: 697850934 (665.5 MIB) TX B Ytes: 74549101 (71.0 MIB) eth1 link encap: Ethernet hwaddr 00: 0C: 29: B2: AD: C4 Inet ADDR: 192.168.1.1 bcast: 192.168.27.255 mask: 255.255.0 inet6 ADDR: fe80 :: 20c: 29ff: feb2: adc4/64 scope: link up broadcast running Multicast MTU: 1500 Metric: 1 RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 6 errors: 0 dropped: 0 overruns: 0 carrier: 0 Collisions: 0 txqueuelen: 1000 RX Bytes: 0 (0.0 B) TX Bytes: 468 (468.0 B) 2) Modify S2 [[email protected] ~] # Ifconfig eth0 192.168.1.2/24 up configure the relevant configuration in S1, select the same communication channel of vmnet3 on the Virtual Machine and eth1 on haproxy, and then configure the IP address and default gateway interface, then provide different pages for testing. [[email protected] ~] # Route add defaulte GW 192.168.27.18 # The eth1 address of the gateway pointing to the haproxy host [[email protected] ~] # Ping 192.168.27.10 # ping the haproxy node to see if it can be pinged [[email protected] ~] # Vim/var/www/html/index.html
3. Start haproxy for testing.
1) Service haproxy start
2) log on to our configuration page
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/E9/wKiom1Qe82SRegStAAKnvedzjrE266.jpg "Title =" 2.png" alt = "wkiom1qe82sregstaaknvedzjre266.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/EB/wKioL1Qe86_TO9EbAAQwRkFPhAU039.jpg "Title =" 3.png" alt = "wkiol1qe86_to9ebaaqwrkfphau039.jpg"/>
3) test whether the dynamic and static Web pages are separated
Access static Web pages
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/E9/wKiom1Qe882TNb0nAAC3664rqNs593.jpg "Title =" 5.png" alt = "wkiom1qe882tnb0naac3664rqns593.jpg"/>
View the www.helloword.com
4) Access dynamic web pages
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/EB/wKioL1Qe9CzDwQ41AAHwhv7vWL8240.jpg "Title =" 4.png" alt = "wkiol1qe9czdwq41aahwhv7vwl00000.jpg"/>
View the hello word server set for us on the dynamic web page
OK. Our static and dynamic separation has been implemented.
This article is from the Slayer blog, please be sure to keep this source http://slayer.blog.51cto.com/4845839/1556783
Haproxy static and dynamic Separation