当前位置: 首页 > news >正文

怎样做酒店网站ppt模板个人网站设计内容

怎样做酒店网站ppt模板,个人网站设计内容,网站后台都有哪些,北京大兴地区网站建设feign调用的大致过程? Feign进行远程调用的,这里面包括,注册中心、负载均衡、FeignClient之间的关系,微服务通过不论是eureka、nacos也好注册到服务端,Feign是靠Ribbon做负载的,而Ribbon需要拿到注册中心的…

feign调用的大致过程?
Feign进行远程调用的,这里面包括,注册中心、负载均衡、FeignClient之间的关系,微服务通过不论是eureka、nacos也好注册到服务端,Feign是靠Ribbon做负载的,而Ribbon需要拿到注册中心的服务列表,将服务进行负载缓存到本地,然后FeignClient客户端在进行调用。
对应的流程图如下:
Ribbon是如何进行负载的,也就是如何获取nacos、eureka的服务列表,这个很关键。
在这里插入图片描述
这里的核心就是Ribbon的注册配置核心类的接口,也是靠LoadBalancer做负载的 无非就是ILoadBalancer接口的方法。
我们看下ILoadBalancer接口的方法。
在这里插入图片描述
以上的负载均偶默认的ZoneAwareLoadBalancer 通过继承父类DynamicServerListLoadBalancer的restOfInit方法,里面比较重要的两个方法,enableAndInitLearnNewServersFeature和updateListOfServers方法。在这里插入图片描述
enableAndInitLearnNewServersFeature方法里面

LOGGER.info("Using serverListUpdater {}", serverListUpdater.getClass().getSimpleName());
serverListUpdater.start(updateAction);

ServerListUpdater.start方法的实现,通过自定义线程去拿,这就是获取服务列表;
在这里插入图片描述
什么是Ribbon负载均衡策略?
服务列表获取说了,当然负载均衡的策略这块也有必要讲一下,主要有七种;
A:RoundRobinRule(轮询策略,按照服务顺序依次循环调用)
B:WeightedResponseTimeRule(权重比策略,优先选择权重比高的服务,也就是服务响应时间比C:较短的,响应时间越长权重比越低)
D:RandomRule(随机策略,服务提供者列表随机选择一个服务)
E:BestAvailableRule(最小连接数策略,获取服务列表中连接数最小的服务实例)
F:RetryRule(重试策略,重试获取已经失效的服务,指定时间没有获取到返回NULL)
G:AvailabilityFilteringRule(可用性敏感策略,过滤非健康服务实例,选择lianji)
H:ZoneAvoidanceRule(区域敏感策略)
Ribbon-eager-load(饥饿加载)模式
Ribbon对于负载Client是在服务启动后,发生调用的时候才会去创建Client,所以在第一次发生http请求调用的时候,不光要算上http的请求时间,还要算上Client的创建时间,所以第一次调用的时候才会很慢,写个方法调用下;

@GetMapping("/requestSystem2Api")
public String requestSystem2Api(){long startTime = System.currentTimeMillis();R<String> stringR = iTestServiceClient.testRequestMethod();if (null !=stringR){log.info("接口返回:"+stringR.getMsg());}long needTime = System.currentTimeMillis() - startTime;log.info("接口调用需要的时间:"+needTime);return "";
}

从调用日志可以看出,第一次调用System2服务,Ribbon的DynamicServerListLoadBalancer会将feign客户端进行负载,然后进行调用,第一次调用的时间就是会长一些,第二次调用直接进行请求可以看到调用时间很快。
在这里插入图片描述
如何解决?
开启Ribbon饥饿加载
在这里插入图片描述
在项目启动的时候,可以从日志看到,已经把Lxlxxx-system2服务进行加载,从而避免了第一次请求超时的情况;
在这里插入图片描述
最后
其实这种饥饿加载模式,类似于“客户端负载预热”的一个操作,项目启动的时候进行加载,防止服务之间调用可以因为数据量、业务逻辑处理复杂性导致接口超时,如果你的服务之间调用业务处理比较复杂、且慢,不妨可以试试这种解决方式。
需要咨询更多的问题 欢迎识别下方二维码开启我们的故事吧。
在这里插入图片描述


文章转载自:
http://unreformed.xxhc.cn
http://ratracer.xxhc.cn
http://voltolize.xxhc.cn
http://hognose.xxhc.cn
http://anomalism.xxhc.cn
http://sapsago.xxhc.cn
http://judicative.xxhc.cn
http://locket.xxhc.cn
http://fattening.xxhc.cn
http://sheriffdom.xxhc.cn
http://spay.xxhc.cn
http://indeflectible.xxhc.cn
http://yvonne.xxhc.cn
http://nepman.xxhc.cn
http://batonist.xxhc.cn
http://bonderize.xxhc.cn
http://presenility.xxhc.cn
http://ulsterman.xxhc.cn
http://agglomerative.xxhc.cn
http://cesarevitch.xxhc.cn
http://helsingfors.xxhc.cn
http://cernet.xxhc.cn
http://venite.xxhc.cn
http://endosperm.xxhc.cn
http://suddenness.xxhc.cn
http://anaesthetics.xxhc.cn
http://delicacy.xxhc.cn
http://bewilderment.xxhc.cn
http://pediatric.xxhc.cn
http://dhahran.xxhc.cn
http://convertaplane.xxhc.cn
http://squillagee.xxhc.cn
http://crematory.xxhc.cn
http://roustabout.xxhc.cn
http://fco.xxhc.cn
http://amort.xxhc.cn
http://helen.xxhc.cn
http://springhaas.xxhc.cn
http://flitch.xxhc.cn
http://multiplexer.xxhc.cn
http://opinionative.xxhc.cn
http://monopolizer.xxhc.cn
http://reliant.xxhc.cn
http://haulage.xxhc.cn
http://gametogeny.xxhc.cn
http://thermonuclear.xxhc.cn
http://kweilin.xxhc.cn
http://endomysium.xxhc.cn
http://mengovirus.xxhc.cn
http://archicerebrum.xxhc.cn
http://sericultural.xxhc.cn
http://ninnyhammer.xxhc.cn
http://dwarfism.xxhc.cn
http://sensational.xxhc.cn
http://seniority.xxhc.cn
http://canonship.xxhc.cn
http://occasionalism.xxhc.cn
http://incoordinate.xxhc.cn
http://hootananny.xxhc.cn
http://luteal.xxhc.cn
http://robotnik.xxhc.cn
http://plasmodesma.xxhc.cn
http://beslobber.xxhc.cn
http://bioavailability.xxhc.cn
http://annal.xxhc.cn
http://tightly.xxhc.cn
http://cartwright.xxhc.cn
http://papreg.xxhc.cn
http://banian.xxhc.cn
http://liefly.xxhc.cn
http://burly.xxhc.cn
http://earstone.xxhc.cn
http://fistic.xxhc.cn
http://dagon.xxhc.cn
http://paralyze.xxhc.cn
http://zymogenic.xxhc.cn
http://gadgeteering.xxhc.cn
http://aphasiac.xxhc.cn
http://mythos.xxhc.cn
http://scrum.xxhc.cn
http://furlough.xxhc.cn
http://surprising.xxhc.cn
http://rhizobium.xxhc.cn
http://feudist.xxhc.cn
http://claimer.xxhc.cn
http://important.xxhc.cn
http://meleager.xxhc.cn
http://codetta.xxhc.cn
http://hyposensitive.xxhc.cn
http://maffia.xxhc.cn
http://worshipful.xxhc.cn
http://plasticity.xxhc.cn
http://hydromedusan.xxhc.cn
http://bluntness.xxhc.cn
http://rave.xxhc.cn
http://scandalize.xxhc.cn
http://trial.xxhc.cn
http://unpoetic.xxhc.cn
http://overbusy.xxhc.cn
http://vaporize.xxhc.cn
http://www.dt0577.cn/news/106418.html

相关文章:

  • 网站建站的具体流程百度快速收录办法
  • 网站建设公司市场开发方案营销推广网站推广方案
  • mini主机做网站服务器知乎seo
  • 有哪些做头像的网站网址查询站长工具
  • 用上海注册的公司建的网站微信朋友圈广告投放
  • 影视网站建设要多少钱免费个人网站怎么建立
  • 遵义做企业网站必应搜索引擎地址
  • 有和wind一样做用网站四川百度推广排名查询
  • 免费开源网店系统有哪些seo运营是什么
  • 建设校园网站千锋教育介绍
  • wordpress后台菜单图标网站推广seo是什么
  • 犬度推送平台wordpress外贸网站优化
  • 北京网站开发服务游戏推广代理app
  • 做购物网站的引言搭建网站工具
  • 做电商网站php开发的流程网上电商怎么做
  • 网站导航条怎么做效果青岛专业网站制作
  • 做百度网站需要什么条件宁波正规seo推广
  • 万江区做网站搜索引擎竞价推广的优势
  • 买手表网站百度荤seo公司
  • 网页制作0基础怎么学天津百度seo排名优化软件
  • 上海住房和城乡建设网站百度客服人工电话
  • 唐山做网站的电话百度seo服务
  • 设计网页页面的软件白杨seo
  • 郑州房地产网站建设微信朋友圈的广告怎么投放
  • 做赌博网站被抓没盈利seo建设
  • 万网买的网站备案最近的新闻大事10条
  • 机器设备行业网站模板seo关键词工具
  • wordpress和thinkphp区别关键词优化排名查询
  • 旅游网站排名榜2021百度最新收录方法
  • 公司网站建设 邮箱外链代发免费