当前位置:网站首页>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
边栏推荐
- 杰理之、产线装配环节【篇】
- Pointer and string
- Market Research - current situation and future development trend of carob chocolate market
- 解决 excel 文件上传时更改选中的文件出现错误net::ERR_UPLOAD_FILE_CHANGED
- [ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
- Unity发布WebGL播放声音的一种方法
- 杰理之直接触摸样机的顶针反应不正常【篇】
- [shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)
- SimpleITK使用——4. 奇怪的問題
- Baidu AI Cloud - create a face recognition application
猜你喜欢
大话云原生之负载均衡篇-小饭馆客流量变大了
[foreign journal] sleep and weight loss
[001] [arm-cortex-m3/4] internal register
uniapp微信登录返显用户名和头像
[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
杰理之、产线装配环节【篇】
Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed
[shutter] shutter application theme (themedata | dynamic modification theme)
NC24325 [USACO 2012 Mar S]Flowerpot
Basic concepts of image and deep understanding of yuv/rgb
随机推荐
What is the'function'keyword used in some bash scripts- What is the 'function' keyword used in some bash scripts?
[micro service sentinel] rewrite Sentinel's interface blockexceptionhandler
Scrcpy this software solves the problem of sharing mobile screen with colleagues | community essay solicitation
NC50965 Largest Rectangle in a Histogram
Service visibility and observability
SimpleITK使用——4. 奇怪的问题
[shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
Market Research - current situation and future development trend of anti-counterfeiting label market
NC24325 [USACO 2012 Mar S]Flowerpot
Market Research - current market situation and future development trend of handheld wound imaging equipment
[LeetCode] 反转字符串【344】
U++ 学习笔记 堆
存储单位换算
《乔布斯传》英文原著重点词汇笔记(九)【 chapter seven】
#include errors detected. Please update your includePath.
I admire that someone explained such an obscure subject as advanced mathematics so easily
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
[shutter] shutter resource file use (import resource pictures | use image resources)
[001] [arm-cortex-m3/4] internal register
New feature of go1.18: trylock, which has been tossed n times