1. ip_hash: ip_hash uses a source address hash algorithm to always send requests from the same client to the same backend server unless the server is unavailable. ip_hash syntax: upstream backend { ip_hash; server backend1.example.com; server backend2.example.com; server backend3.example.com down; server backend4.example.com; } ip_hash is simple and easy to use, but it has the following problems:
2. sticky_cookie_insert: Use sticky_cookie_insert to enable session affinity, which causes requests from the same client to be delivered to the same server for a group of servers. The difference from ip_hash is that it does not judge the client based on the IP, but based on the cookie. Therefore, the situation in which the client and the front-end proxy from the same LAN in the above ip_hash cause load imbalance can be avoided. grammar: upstream backend { server backend1.example.com; server backend2.example.com; sticky_cookie_insert srv_id expires=1h domain=toxingwang.com path=/; } illustrate:
In addition, you can also use the backend server itself to keep the session synchronized through related mechanisms, which will be described in detail later! The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to solve the problem of Chinese garbled characters when inserting table data into MySQL
>>: A brief discussion on how to learn JS step by step
Table of contents Preface Method 1: High contrast...
Three functions: 1. Automatic vertical centering o...
Table of contents Achieve results Available plugi...
The preparation for the final exams in the past h...
This article introduces the import and export of ...
Arial Arial is a sans-serif TrueType font distribu...
Due to your company standards, you may only allow...
Inserting Data insert into table name (column nam...
Without further ado, let's take a look at the...
1. The difference between forward proxy and rever...
1. Element time selection submission format conve...
This article shares with you the installation tut...
Table of contents How to display SQL log? ? Descr...
Recently, the project switched the environment an...
<br />The author used to be a novice in web ...