当前位置:网站首页>Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
2022-07-02 22:47:00 【InfoQ】
One 、 Preface
Two 、 Start with a roadside stall
- Her stall rarely has the phenomenon of waiting for dishes for a long time . Because the capacity of tables, chairs and benches in stalls is usually limited , Usually not so many guests , The upper limit of the total demand for food is basically fixed , Relatively good coordination .
- Smooth communication 、 Fast , This order string roars 、 It started over there . When you're ready, yell again , It's served .
- short 、 Easy to turn around . The reason why the couple chose to start from the roadside stall , Because the boat is small and easy to turn around . It's possible to work for a while and find that there are few passengers in this location , You can stop operating immediately or operate in another place .

- The number of requests that can be accepted is limited , First, there are not so many users in terms of demand , Second, the resources of start-ups are limited , Memory of the server 、CPU Configuration is limited .
- View layer of monomer application 、 Control layer 、 The persistence layer is all in one application , Call convenient 、 Fast response . There are no remote calls between services RPC, Respond faster , Specific to a service request, the response result is faster .
- Development of simple 、 Quick start 、 A team of three or five people is easy to manage and use . The boss decided to quit , You can turn around at any time , It doesn't hurt much .
3、 ... and 、 Restaurant opening and load balancing
- Recruit someone ? Chef, of course 、 The cashier's wife can do it by herself , The main reason is that the husband can't live , Yes , Then hire a cook .
- Don't let more guests stand and eat ? Rent a nearby store 、 Add more tables, chairs and benches .
- The little couple arranged three chefs for the restaurant ( Including husband ), That's enough . The wife willOrder NoTo chef Zhang 、Double orderFor chef li , Neither of them can do it , Then give the order to her husband . Anyway, outsiders don't have to pay for it , My family can take a break . She'll give it to whoever she says , She has her own algorithm .This pattern is “ Client load balancing ”, The wife calls... As a client “ The cook ” service , I'll remember how many chefs there are , Then forward the user request to one of the chefs according to its own algorithm . Our common Spring Cloud When each service requests other micro Services , Maintain a list of microservices inside , Then, according to the request target and algorithm, select a service from the micro service for remote service invocation .
- One day the two chefs put forward their opinions : It's too tired to do this. There's no free time , Or the husband does more , Or get a raise . The couple are not very strong now , It's better for the husband to do more . Then the wife doesn't have to remember “ The single and even numbers of the order ” 了 , Just use one app Enter customer order , The app It can realize the balanced distribution of orders to chefs .“ This pattern is “ Server side load balancing ””. For software architecture, this app Load balancer , The commonly used software load balancers are nginx、haproxy etc. . There are also some hardware load balancers , Better performance , Of course, the charge is also more “ good ”. The architecture is shown in the following figure :

- “ benefit ” That is, the processing capacity of the application has increased , Able to handle more orders .
- “ Disadvantages ” The cost of communication has increased , The original problem solved by yelling , Now we need to rely on app Forwarded ( Load Balancer ). Whether it's a remote service call , Or request forwarding is time-consuming .
Four 、 After dinner communication
边栏推荐
- NC24325 [USACO 2012 Mar S]Flowerpot
- NC24325 [USACO 2012 Mar S]Flowerpot
- 'when to use const char * and when to use const char []' - when to use const char * and when to use const char []
- Using rendertext() to output multiple lines of text with rendertext() in R shiny
- Market Research - current situation and future development trend of cell-based seafood market
- Necessary browser plug-ins for network security engineers
- [QT] Q multithreaded development - Analysis of multithreaded application examples (Mandelbrot)
- U++ 学习笔记 ----松弛
- How can I use knockout's $parent/$root pseudovariables from inside a . computed() observable?
- wait解决僵尸进程
猜你喜欢
![[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)](/img/27/8594ba0b49d5008b7469967babed17.jpg)
[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)
![[foreign journal] sleep and weight loss](/img/81/42dcfae19e72a0bc761cb7a40fe5d5.jpg)
[foreign journal] sleep and weight loss

Socket套接字C/S端流程
![[shutter] shutter gesture interaction (small ball following the movement of fingers)](/img/5a/a8dad8a0943645c980cc4fe7cb55d4.gif)
[shutter] shutter gesture interaction (small ball following the movement of fingers)

Promise optimized callback hell

Oracle-游标

#include errors detected. Please update your includePath.

牛客网:最大子矩阵

It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #

Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
随机推荐
杰理之如何测试按键的误触率【篇】
NC50965 Largest Rectangle in a Histogram
《乔布斯传》英文原著重点词汇笔记(十一)【 chapter nine】
Regular expression (2)
[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
wait解决僵尸进程
Leetcode circular linked list (fast and slow pointer) code line by line interpretation
Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
[shutter] shutter application theme (themedata | dynamic modification theme)
UE4 游戏架构 学习笔记
[LeetCode] 多数元素【169】
Build your own website (22)
Market Research - current market situation and future development trend of third-party data platform
SimpleITK使用——4. 奇怪的問題
Market Research - current market situation and future development trend of aircraft wireless intercom system
U++ 学习笔记 堆
Learn computer knowledge from scratch
Technological Entrepreneurship: failure is not success, but reflection is
PHP optimizes SQL queries in foreach