当前位置:网站首页>Ribbon load balancing principle and some source codes
Ribbon load balancing principle and some source codes
2022-07-27 04:25:00 【Maosang】
Black horse programmer -Ribbon Load balancing source code
Premise : Service providers have multiple service clusters , Otherwise, if there is only one service , Also load balancing a hammer !
Ribbon Basic principles of load balancing :
1、Ribbon Will intercept Eureka Client From the client http request , Get service name (userservice)
2、 from Eureka Pull the dynamic service list from (8081、8082.....)
3、 Choose a service from it ( Such as 8081) come out ( polling 、 Random equal algorithm )
4、 To call this service 
The detailed steps :
1、 Client initiated http request , For example, use RestTemplate launch ;
2、LoadBalancerInterceptor Load balancing interceptors , It will block all initiated by this client http request , To analyze , Access to services ID( Instance name example :userservice);
3、 Through this instance name , from Eureka Pull the dynamic service list from ;
4、Eureka Back to the list of services , here LoadBalancerInterceptor The load balancing interceptor gets all the service instances ;
5、 Use IRule Interface for load balancing ,IRule Rule interfaces include : Client custom rules 、 polling 、 Random 、 Retry and other load balancing algorithms :
6、 Use the one specified by the client , Or the default load balancing algorithm , Select one from the list of services , Return to RibbonLoadBanlancerClient(Ribbon Load balancer client )
7、RibbonLoadBanlancerClient(Ribbon Load balancer client ) Use real ip And port (http://127.0.0.1:8080/user/1) Replace The original “ service name + route ”(http://userservice/user/1), And make a request
8、 Final , Request to the corresponding server selected after load balancing
When using @LoadBalanced When the annotation , Automatically called spring-cloud Medium Ribbon Components are load balanced , We just need to configure Ribbon Our algorithm can be used as we like
边栏推荐
- The difference between ArrayList and LinkedList
- JS three methods of traversing arrays: map, foreach, filter
- JVM调优中的一些常见指令
- Deep analysis - dynamic memory management
- E-commerce system combined with commodity spike activities, VR panorama continues to bring benefits
- 好用的shell快捷键
- Interview question 02.05. sum of linked list
- xxx is not in the sudoers file.This incident will be reported.的解决方法
- 法解析的外部符号 “public: virtual __cdecl nvinfer1::YoloLayerPlugin::~YoloLayerPlugin(void)“ “public: virtua
- [small sample segmentation] msanet: multi similarity and attention guidance for boosting few shot segmentation
猜你喜欢

卷积神经网络——灰度图像的卷积

E-commerce system combined with commodity spike activities, VR panorama continues to bring benefits

JMeter download and installation

Ant JD Sina 10 architects 424 page masterpiece in-depth distributed cache from principle to practice pdf

Learning route from junior programmer to architect + complete version of supporting learning resources

Big talk · book sharing | lean product development: principles, methods and Implementation

【软件工程期末复习】知识点+大题详解(E-R图、数据流图、N-S盒图、状态图、活动图、用例图....)

深度剖析 —— 动态内存管理

Worship the 321 page PDF of the core technology of Internet entrepreneurship that Alibaba is pushing internally. It's really kneeling

电商分账系统重要吗,平台应该如何选择分账服务商呢?
随机推荐
PX4模块设计之十二:High Resolution Timer设计
匿名命名管道, 共享内存的进程间通信理解与使用
BigDecimal pit summary & Best Practices
Worship the 321 page PDF of the core technology of Internet entrepreneurship that Alibaba is pushing internally. It's really kneeling
Maximum nesting depth of parentheses
你了解微信商户分账吗?
Using LCD1602 to display ultrasonic ranging
大咖说·图书分享|精益产品开发:原则、方法与实施
356 pages, 140000 words, weak current intelligent system of high-end commercial office complex, 2022 Edition
从零开始C语言精讲篇4:数组
Which securities company has the lowest handling charge? Is it safe to open an account on your mobile phone
[leetcode] day104 no overlapping interval
Is VR panoramic production a single weapon in the home decoration industry? Why is this?
Echart柱状图中数据显示在图上方
VR panorama gold rush "careful machine" (Part 1)
Network knowledge corner | it only takes four steps to teach you to use SecureCRT to connect to ENSP. You must see the operation guide of common tools
微信input组件添加清除图标,点击清空不生效
JS to realize page Jump and parameter acquisition and loading
Navicat将MySQL导出表结构以及字段说明
2022-07-26:以下go语言代码输出什么?A:5;B:hello;C:编译错误;D:运行错误。 package main import ( “fmt“ ) type integer in