当前位置:网站首页>Ribbon service invocation and load balancing
Ribbon service invocation and load balancing
2022-06-29 06:35:00 【Miaoshiansen likes fish】
Learn from the previous content , Service registration and service discovery have been implemented . When you start a service , Can pass HTTP To register information in the registry , And through SpringCloud Provides a tool to get a list of Registry Services . But there are still many problems in the call between services , How to call microservices more conveniently , How to choose multiple micro service providers , How to load balance and so on .
One 、Ribbon summary
1.1 What is? Ribbon
Ribbon yes Netflix Released a load balancer , It helps to control HTTP and TCP Client behavior . stay SpringCloud in ,Eureka General coordination Ribbon To use ,Ribbon It provides the function of client load balancing ,Ribbon Use from Eureka Service information read in , When calling the service provided by the service node , The load will be reasonable .
stay SpringCloud The registry and Ribbon In combination with ,Ribbon Automatically get the list information of service providers from the registry , And based on the built-in load balancing algorithm , Request service .
1.2 Ribbon Main role of
(1) The service call
be based on Ribbon Implement service calls , It is composed of all service lists pulled ( service name - Request path ) The mapping relationship . With the help of RestTemplate Finally call .
(2) Load balancing
When there are multiple service providers ,Ribbon According to the load balancing algorithm ( Such as simple polling 、 Random connection, etc ) Automatically select the service address to be called .
1.3 Ribbon Load balancing and Nginx The difference between load balancing
LB Load balancing (Load Balance) What is it? ? To put it simply, users' requests are evenly distributed to multiple services , So as to achieve systematic HA( High availability ). Common load balancing software Nginx,LVS, Hardware F5 etc. .
Nginx It's server load balancing , All client requests are delivered to Nginx, Then from Nginx Implement forwarding request , That is, load balancing is performed by , Server implementation .
Ribbon Local load balancing , When the micro interface is called , After obtaining the list of registration information services in the Registration Center , The cache to JVM Local , Thus in Local implementation RPC Remote service call technology .
Centralized LB: I.e. use independent... Between consumers and providers of services LB facilities ( It can be hardware , Such as F5, It can also be software , Such as Nginx), The facility payload forwards the access request to the service provider through some policy .
In process LB: take LB Logic is integrated into the consumer , The consumer knows from the service registry what addresses are available , Then I choose a suitable server from these addresses .Ribbon It's in the process LB, It's just a class library , Integrated into consumer processes , The consumer uses it to get the address of the service provider .
边栏推荐
- Design and practice of kubernetes cluster and application monitoring scheme
- [Flink] flinksql and table programming cases
- Output of character pointer to string in C language
- 'only_ full_ group_ The influence of by'sql mode on group by and its treatment
- Creation of Arduino uno development environment
- Implementation of queue
- P5 DS - component and document Association
- JIRA basic usage sharing
- [deep learning] - maze task learning I (to realize the random movement of agents)
- Games101 Lecture 10 geometry 1 Notes
猜你喜欢

Installing modules in pycharm

Unity AR Shadow 阴影

Segment in Lucene

Fresnel diffraction with rectangular aperture based on MATLAB

Internet enterprises need CRM software to help

Jenkins operation Chapter 6 mail server sending build results

Difference between URI and URL

The echares map is implemented separately by provinces, and the tooltip user-defined prompt box, scattered annotation and scattered illumination are explained in detail

Monitor employee turnover dynamics. This system makes employees tremble!

Two houses with different colors and the farthest distance
随机推荐
Servlet version conflict causes page 404
Go compile source code (window environment)
Two houses with different colors and the farthest distance
Leetcode simple problem building arrays with stack operation
Illustrate plug-in -- AI plug-in development -- creative plug-in -- astute graphics -- multi axis mirroring function
Honeypot based on MySQL load data local INFILE
Design of leetcode simple problem goal parser
Hyperledger Fabric 2. X custom smart contract
ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience
Ctrip launched the "3+2" office mode. Are you sour?
Fault: ntfrs warning log for id13562
2022-01 Microsoft vulnerability notification
Servlet version conflict causes page 404
力扣今日题-324. 摆动排序 II
What is the "danksharding" of V God Kop on Valentine's day?
[C language series] - branch and loop statements
How to use regex in file find
Introduction to Ceres Quartet
Haar cascades and LBP cascades in face detection [closed] - Haar cascades vs. LBP cascades in face detection [closed]
Browser local storage