Like LVS, HAProxy is a load balancing software; In terms of efficiency, HAProxy has a better load balancing speed than Nginx, and is better than Nginx in concurrent processing. At the same time, it can complement some shortcomings of Nginx, such as support Session persistence, Cookie guidance; It can also detect the status of the back-end server by obtaining the specified URL.

The HAProxy practice document shared today includes 6 chapters and 51 pages. The Web architecture, HAProxy scheduling algorithm, static and static separation and client source IP transparent transmission, ACL usage and message modification, server dynamic offline are explained in detail. I believe you will have a deeper understanding of HAProxy after reading it!

Chapter 1 Web Architecture introduction

Web Services Architecture Design – Haproxy Four Layer reverse load:

  1. HAProxy is used as a reverse proxy to implement layer 4 load balancing

  2. Multiple scheduling algorithms can be configured

  3. Support for back-end server status monitoring

  4. Saving Public IP Addresses

  5. Hiding the internal Server

Chapter 2 Introduction to Load balancing

Load Balance (LB) is a highly available reverse proxy technology implemented by services or hardware devices. Load balancing allocates specific services (such as Web services and network traffic) to one or more specific servers or devices on the specified back-end. Thus, the concurrent processing capacity of the company’s business is improved, the high availability of business is guaranteed, and the horizontal dynamic expansion of business is convenient.

Chapter 3 HAProxy installation and basic configuration

The HAProxy configuration file haproxy. CFG consists of two major parts, namely, the Global configuration and proxy configuration.

Chapter 4 HAProxy scheduling algorithm

HAProxy uses the fixed parameter balance to specify the scheduling algorithm for back-end servers. This parameter can be configured in listen or Backend.

Scheduling algorithm

HAProxy scheduling algorithms are divided into static and dynamic scheduling algorithms, but some algorithms can be converted into static and dynamic algorithms according to parameters.

IP passthrough

The web server needs to record the real IP addresses of clients for access statistics, security defense, behavior analysis, and region ranking.

Chapter 5 Advanced Functions and Configurations

This chapter describes the advanced configuration and practical cases of HAProxy.

Modify the message

In HTTP mode, the request and response packets of the client are modified based on actual requirements. Reqadd and Reqdel are used to add and delete fields in the request packets, and rspadd and rspidel are used to add and delete fields in the response packets.

ACL

Access ControlLists (ACL) is an Access control technology based on packet filtering. It can filter the packets transmitted through the server according to the set conditions (conditional matching), that is, the received packets are matched and filtered. Matches the packet based on the source file, source port, destination address, destination port, request method, URL, and file suffix in the request header and performs further operations, such as allowing the packet to pass or discarding the packet.

HAProxy layer 4 load

Layer-4 load balancing is to advertise layer-3 IP addresses (VIPs) and add layer-4 port numbers to determine which traffic needs load balancing.

Chapter six highlights

This chapter is the distillation of the key knowledge of HAProxy, which will not be repeated here.

This [HAProxy actual combat document] document content is too much, here is no longer one redundant, need can be taken. iiv.h5.xeknow.com/s/4kUrLU