当前位置:网站首页>How can services start smoothly under tens of millions of QPS
How can services start smoothly under tens of millions of QPS
2022-08-02 20:45:00 【InfoQ】
背景

原因分析
解决方案

- The first step is to ensure that the system runs smoothly完全启动完成后,to have traffic access;
- 第二步Small flow preheating,through a small amount of trafficJVM The virtual machine compiles high-frequency code into machine code and caches it in the JVM 缓存中,再次使用的时候不会触发临时加载;
- 第三步Gradually put traffic to full volume,When a high-traffic request uses hot code,No need to explain every pass,Finally achieve smooth start.
System fully booted
F5探活
注册中心注册

ribbon.eager-load.enabled=true
ribbon.eager-load.clients=service_id1,service_id2
probe detection

<--省略无用信息-->
spec:
containers:
- name: *****
image: *****
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8090
initialDelaySeconds: 5 # 容器启动后多久开始探测
failureThreshold: 10 # 连续探测10次失败表示失败
timeoutSeconds: 10 # 表示容器必须在10s内做出相应反馈给probe,否则视为探测失败
periodSeconds: 5 # 探测周期,每5s探测一次
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8090
initialDelaySeconds: 10 # 容器启动后多久开始探测
timeoutSeconds: 2 # 表示容器必须在2s内做出相应反馈给probe,否则视为探测失败
periodSeconds: 30 # 探测周期,每30s探测一次
successThreshold: 1 # 连续探测1次成功表示成功
failureThreshold: 3 # 连续探测3次失败表示失败
<--省略无用信息-->
Small flow preheating

开源 Dubbo

- 服务提供端在向注册中⼼注册服务的过程中,将⾃身的预热时⻓ WarmupTime、服务启动时间 StartTime 通过元数据的形式注册到注册中⼼中;
- 服务消费端在注册中⼼订阅相关服务实例列表,调⽤过程中根据 WarmupTime、StartTime 计算个实例所分批的调⽤权重;
- 刚启动 StartTime 距离调⽤时刻差值较⼩的实例权重下,从⽽实现对刚启动应⽤Allocate less traffic to achieve 其进⾏⼩流量预热.
open source meituanOCTO-RPC


Serivce Mesh Isito-proxy

message SlowStartConfig {
// Represents the size of slow start window.
// If set, the newly created host remains in slow start mode starting from its creation time
// for the duration of slow start window.
google.protobuf.Duration slow_start_window = 1;
// This parameter controls the speed of traffic increase over the slow start window. Defaults to 1.0,
// so that endpoint would get linearly increasing amount of traffic.
// When increasing the value for this parameter, the speed of traffic ramp-up increases non-linearly.
// The value of aggression parameter should be greater than 0.0.
// By tuning the parameter, is possible to achieve polynomial or exponential shape of ramp-up curve.
//
// During slow start window, effective weight of an endpoint would be scaled with time factor and aggression:
// `new_weight = weight * time_factor ^ (1 / aggression)`,
// where `time_factor=(time_since_start_seconds / slow_start_time_seconds)`.
//
// As time progresses, more and more traffic would be sent to endpoint, which is in slow start window.
// Once host exits slow start, time_factor and aggression no longer affect its weight.
core.v3.RuntimeDouble aggression = 2;
}
总结
- 实例启动,包括JVM、Springetc. initialization and initialization of some microservice components such as configuration center,It is worth noting that do not register in the registry before the resource is fully loaded,You can delay registration by setting,让应⽤在充分初始化后再注册到注册中⼼对外提供服务;
- Small flow preheating,Via client load and weight algorithm,Make the traffic of the instance node just started grow linearly,Ultimately reached normal levels;
- 全量运行,需要查看JVM、Interface corresponding time indicator monitoring and logging,Make sure that the newly launched instance goes online without any problems.
边栏推荐
- 土巴兔IPO五次折戟,互联网家装未解“中介”之痛
- My recursive never burst stack
- golang 源码分析(39)hystrix-go
- 多聚体/壳聚糖修饰白蛋白纳米球/mPEG-HSA聚乙二醇人血清白蛋白纳米球的制备与研究
- 成功部署工业物联网的五个关键
- Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (5) Task Book
- 解决多版本jar包冲突问题
- 企业云成本管控,你真的做对了吗?
- E-Surfing Cloud 4.0 Distributed Cloud Enables Digital Transformation of Thousands of Industries
- 一朵“云“如何带来产业新变革
猜你喜欢
redis总结_基础
土巴兔IPO五次折戟,互联网家装未解“中介”之痛
解决多版本jar包冲突问题
基于HDF的LED驱动程序开发(1)
小程序毕设作品之微信体育馆预约小程序毕业设计成品(6)开题答辩PPT
How Tencent architects explained: The principle of Redis high-performance communication (essential version)
Taking advantage of cloud-network integration, e-Surfing Cloud has paved the way for digital transformation for government and enterprises
一文看懂推荐系统:概要01:推荐系统的基本概念
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Works (7) Mid-term Inspection Report
Enterprise cloud cost control, are you really doing it right?
随机推荐
魔豹联盟:佛萨奇2.0dapp系统开发模式详情
golang源码分析(33)pollFD
MySQL表的约束
本地MSE播放fragment mp4服务
详细教学——1688关键词搜索API操作流程
Local broadcast MSE fragments mp4 service
土巴兔IPO五次折戟,互联网家装未解“中介”之痛
cpolar应用实例之多设备数据采集
灵动微电子发布低功耗 MM32L0130 系列 MCU 产品
记一次 .NET 某工控自动化控制系统 卡死分析
erp系统和wms系统有什么区别
shell中awk命令的if条件语句引入外置变量
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Work (5) Task Book
MySQL基本操作和基于MySQL基本操作的综合实例项目
POE交换机全方位解读(中)
HDF驱动框架的API(1)
判断文件属主
全面认识二极管,一篇文章就够了
55.【sort函数的升序降序】
redis总结_分布式缓存