当前位置:网站首页>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
边栏推荐
- 2022 operation of simulated examination question bank and simulated examination platform for safety production management personnel of hazardous chemical production units
- Navicat将MySQL导出表结构以及字段说明
- Rust:axum learning notes (1) Hello World
- PX4模块设计之十二:High Resolution Timer设计
- JMeter学习笔记004-CSV文件行数控制循环次数
- Introduction to JVM principle
- Navicat exports Mysql to table structure and field description
- A. Round Down the Price
- 电商分账系统重要吗,平台应该如何选择分账服务商呢?
- 微服务化解决文库下载业务问题实践
猜你喜欢
![[competition reference] pytorch common code snippet and operation collection](/img/b3/0b91e381e2444dfd222537bf5b8ccf.jpg)
[competition reference] pytorch common code snippet and operation collection

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

How CentOS installs mysqldump

从零开始C语言精讲篇4:数组

使用kubesphere图形界面dashboard开启devops功能

What is animation effect? What is the transition effect?

记一次TCP丢包带来的重大性能问题

Five basic data structures of redis

好用的shell快捷键

Cool Lehman VR panorama paves the way for you to start a business
随机推荐
利用JSON类型在mysql中实现数组功能
Some common instructions in JVM tuning
Five basic data structures of redis
技术分享 | 需要小心配置的 gtid_mode
卷积神经网络——24位彩色图像的卷积的详细介绍
使用WebMvcConfigurer进行接口请求拦截进行中增强(附源码)
搜索旋转排序数组
influxDB 基础了解
无有线网络下安装并配置debian
Elastic开源社区:开发者招募
对NIO的初步理解
The external symbol parsed by the method "public: virtual _ucdecl nvinfer1:: yololayerplugin:: ~yololayerplugin (void)" "public: virtual
记一次TCP丢包带来的重大性能问题
Is VR panoramic production a single weapon in the home decoration industry? Why is this?
Navicat exports Mysql to table structure and field description
sram、dram、sdram、ddr的区别和用途
The new Internet era has come. What new opportunities will Web 3.0 bring us
Elastic open source community: Developer Recruitment
JS modify the key value of the object array
使用kubesphere图形界面dashboard开启devops功能