F5 session persistence
In recent projects, F5 needs to be used for load balancing and relevant information should be recorded.
The following is a description of the relevant parameters in the F5 change application. Let's take a look at them. Let's pick several important parameters to learn.
|
Actual server address and port |
The Real Server IP address and port used to provide services. |
External Service address and port |
The IP address and port used by the F5 device to provide services. This option can be applied to the network. |
Load Balancing Algorithm |
The distribution method by which the F5 device sends requests to the server. By default, the F5 device is polling. (for example, if there are two real servers providing services, F5 will allocate two requests to Server 1 and Server 2 respectively) |
Session persistence type |
Session persistence can place a customer's continuous request on a server. Common session persistence types include cookie and source address. By default, F5 devices have no session persistence. |
Session persistence time |
You can customize the duration of the session to be maintained, or create only one session based on the browser. |
Persistent connection |
Maintain the validity of a connection. The customer first establishes a communication connection to the real server that provides services. After the connection is established, it is not disconnected (whether the connection is disconnected depends on the duration of the long connection), and then transmits packets. |
Long connection time |
How long can a connection be idle? The default value of the F5 device is 5 minutes, that is, the F5 device will not interrupt the connection within 5 minutes. |
Mutual access |
Whether there is mutual access between the server that provides the service. |
Passthrough Source Address |
Whether the business layer needs to understand the customer's real address. If necessary, the F5 device will configure to transparently transmit the customer's source address information to the backend server that provides the service. |
Test Type |
Which type of server health check is required for the F5 device? (health check is synonymous with the real server that provides the service ). HTTP and TELNET are commonly used in a row. (For example, after F5 is configured with the Telnet type, the F5 device periodically sends a telnet test packet to the Real Server that provides the service, if F5 is not returned within the defined time, F5 Stops providing services to the Real Server. However, F5 will always send the Telnet test package to the server according to the regulations until the Server gives a correct response, F5 will restore the server .) |
Check Conditions |
Fill in the check condition based on the type defined in the check type. (For example, "Check type" is set to ICMP, and "Check condition" should be set to 192.168.1.1) |
Successful return value |
If the check type is set to HTTP or another custom type, you should enter the correct information returned to F5 by the real server in the successful return value. F5 indicates that the server is available. |
Probe package sending Interval |
The interval between the first and second probes. The default interval of the F5 device is 5 seconds. That is, the F5 device sends a test packet to the Real Server every five seconds to detect whether the Real Server is normal. |
Number of times of retransmission of probe packets |
Number of consecutive Server Detection times. The default number of F5 devices is three. That is, the F5 device detects the status of the Real Server every five seconds. If the system does not return the correct information to F5 three times in a row, f5 removes the real server from the service group that provides the service until it becomes an available server and puts it back in the service group that provides the service. |
Maximum Server Response Time |
If the real server that provides the service does not send a correct Detection Response to F5 after it is stopped, F5 can remove the server from the service group that provides the service. The default value of F5 device is: interval × retransmission times + 1 = maximum response time. (For example, if the default sending interval of the F5 device is 5 seconds and the retransmission frequency is 3 times, the maximum response time should be 5 × 3 + 1 = 16 seconds) |
I. Server Load balancer Algorithms
Random (Random)-- Random Distribution
Round Robin)-- Requests are sequentially and cyclically distributed to the server, starting from 1 to N and then restarting. This balancing algorithm is suitable for the situation where all servers in the server group have the same hardware and software configurations and the average service requests are relatively balanced.
Weight (Weighted Round Robin)-- Assign different weights to each server based on different processing capabilities of the server so that it can accept service requests with corresponding weights .. This balancing algorithm ensures higher utilization of high-performance servers and avoids overload of Low-performance servers.
Dynamic ratio (Dynamic Round Robin)-- Similar to the weight, but the weight value changes with the continuous monitoring of the server. This is a dynamic load balancing algorithm based on real-time analysis of server performance, such as the number of connections or response time.
Fastest)-- Pass the connection to the servers with the fastest response speed. This algorithm may be particularly useful when the server is in a different Logical Network. The balancer records the response time of each server and selects the fastest one. This is very straightforward, but may cause congestion, because the current response time is not necessarily 1 s or 2 s.
Least Connections (Least Connections))-- The least connections balancer algorithm records the number of connections that are being processed by the server. When a new service connection request exists, the current request will be allocated to the server with the least connections, so that the Server Load balancer is more in line with the actual situation and the load is more balanced. This balanced algorithm is suitable for long-time request services, such as FTP.
Observed)-- Select a server for the new request based on the best balance between the number of connections and response time.
Predictive)-- The prediction mode uses the same selection method as the observation mode, except that BIGIP uses the collected server's current performance indicators (number of connections and response time) for Prediction and Analysis, when a server is selected in the next time slice, its performance will reach the optimal server to respond to user requests. The prediction mode tries to fix a problem in the observation mode. If the server's response time has begun to decline, it is unlikely to accept the next request.
Ii. Session persistence
Distribute subsequent connections of the same session to the same server.
1. Simple session persistence (source address-based session persistence ). The server Load balancer performs Load Balancing Based on the source address of the access request as the basis for determining the connected session. All access requests from the same IP address are kept on the same server during load balancing.
Easy to implement.
Problem: load imbalance may easily occur.
A. When multiple customers access the server through proxy or address translation, the load imbalance between servers will be caused because all clients are allocated to the same server.
B. The number of clients is small, but each client generates multiple concurrent accesses. For these mandatory accesses, the Server Load balancer must be allocated to multiple servers, in this case, the session persistence Method Based on the client source address will also cause the server Load balancer to fail.
2. Cookie-based session persistence