当前位置:网站首页>Using Tengine to solve the session problem of load balancing
Using Tengine to solve the session problem of load balancing
2022-07-03 15:06:00 【Brother Xing plays with the clouds】
It happened like this ~~, I've seen a lot of Baidu nginx Load balancing session The way the problem is , I chose to study url_hash The way . After some configuration , I feel more and more that the post found by Baidu is too old , Go to http://wiki.nginx.org/ Find this module on
, stay github I saw such a passage on the download location :
NOTE: This module is obsolete as of Nginx 1.7.2, which includes the hashdirective. This repository remains for historical interest only. My understanding is that this version is absolutely used nginx1,7,2, This library is only for historical references , Baidu translation is that this module is outdated , I can't understand .
At a time of confusion , I saw the tengine, This is Taobao right nginx An extended optimization of . Then I turned to this ~~, Found in tengine One of them is called ngx_http_upstream_session_sticky_module Module , It fits my purpose very well , He uses users cookie To keep right session Support for . The specific principle remains to be studied , In short, I have to try ~~
Please refer to this for the installation process :http://www.linuxidc.com/Linux/2015-09/123050.htm .( Point out the problem of this article , In the installation nginx When you use ./configure --prefix=/opt/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-openssl=/usr/local/src/openssl-1.0.1h --with-zlib=/usr/local/src/zlib-1.2.8 --with-pcre=/usr/local/src/pcre-8.35 --with-jemalloc=/usr/local/jemalloc-3.6.0 This command )
After various stepping pits , It's done :( This interface is also respectful nginx, Still so simple . - - !)
Then let's try that magical module , The configuration is as follows :
upstream rock{ server 127.0.0.1:8081; server 127.0.0.1:8082; session_sticky; }
server { server_name www.linuxidc.com rockcoding.com; listen 80; index index.html index.htm index.jsp; location / { proxy_pass http://rock; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # access_log /data/log/rockman/www.linuxidc.com main; # Log files } }
Colleagues in the company , For the Internet ip Are all the same , As long as you visit two different platforms The server And continuous refresh will not change session It won't fail ( In fact, I won't jump to another one The server ), Then it's a success . Two computers access , Or visit different browsers , Modular based cookie To determine the ~
Um. , Than ip_hash Much better , But to compile so many things , I always feel that I need to further study , It is convenient to use this tengine Well ~
边栏推荐
- [attention mechanism] [first vit] Detr, end to end object detection with transformers the main components of the network are CNN and transformer
- Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
- Yolov5系列(一)——网络可视化工具netron
- Pytoch deep learning and target detection practice notes
- NOI OPENJUDGE 1.6(09)
- The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%
- Simulation of LS -al command in C language
- [graphics] hair simulation in tressfx
- How does vs+qt set the software version copyright, obtain the software version and display the version number?
- 开启 Chrome 和 Edge 浏览器多线程下载
猜你喜欢

零拷贝底层剖析
![[ue4] HISM large scale vegetation rendering solution](/img/a2/2ff2462207e3c3e8364a092765040c.jpg)
[ue4] HISM large scale vegetation rendering solution

Functional modules and application scenarios covered by the productization of user portraits
![[ue4] Niagara's indirect draw](/img/8a/576022b5d19e1d6422ff0135c50c93.jpg)
[ue4] Niagara's indirect draw

Zero copy underlying analysis
![[transform] [NLP] first proposed transformer. The 2017 paper](/img/33/f639ab527d5adedfdc39f8d8117c3e.png)
[transform] [NLP] first proposed transformer. The 2017 paper "attention is all you need" by Google brain team
![[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018](/img/2b/b23aeab584f89be6678c0fe059d4b6.png)
[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018

Pytorch深度学习和目标检测实战笔记

cpu飙升排查方法

4-24--4-28
随机推荐
Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
Fundamentals of PHP deserialization
5.4-5.5
Finally, someone explained the financial risk management clearly
Pytoch deep learning and target detection practice notes
XWiki安装使用技巧
Qt development - scrolling digital selector commonly used in embedded system
SQL server安装位置改不了
2022/02/14
Qt—绘制其他东西
什么是Label encoding?one-hot encoding ,label encoding两种编码该如何区分和使用?
Unity hierarchical bounding box AABB tree
Class part2
Global and Chinese markets for sterile packaging 2022-2028: Research Report on technology, participants, trends, market size and share
The method of parameter estimation of user-defined function in MATLAB
[ue4] material and shader permutation
.NET六大设计原则个人白话理解,有误请大神指正
Troubleshooting method of CPU surge
[pytorch learning notes] datasets and dataloaders
[engine development] rendering architecture and advanced graphics programming