当前位置:网站首页>Store Limit 使用文档
Store Limit 使用文档
2022-07-30 14:50:00 【添香小铺】
Store Limit 是 PD 在 3.0 版本引入的特性,旨在能够更加细粒度地控制调度的速度,针对不同调度场景进行调优。
实现原理
PD 的调度是以 operator 为单位执行的。一个 operator 可能包含多个调度操作。示例如下;
"replace-down-replica {mv peer: store [2] to [3]} (kind:region,replica, region:10(4,5), createAt:2020-05-18 06:40:25.775636418 +0000 UTC m=+2168762.679540369, startAt:2020-05-18 06:40:25.775684648 +0000 UTC m=+2168762.679588599, currentStep:0, steps:[add learner peer 20 on store 3, promote learner peer 20 on store 3 to voter, remove peer on store 2])"
以上示例中,replace-down-replica 这个 operator 具体包含以下操作:
- 在
store 3上添加一个 learner peer,ID 为20。 - 将
store 3上 ID 为20的 learner peer 提升为 voter。 - 删除
store 2上的 peer。
Store Limit 是通过在内存中维护了一个 store ID 到令牌桶的映射,来实现 store 级别的限速。这里不同的操作对应不同的令牌桶,目前仅支持限制添加 learner/peer 和删除 peer 两种操作的速度,即对应于每个 store 存在两种类型的令牌桶。
每次 operator 产生后会检查所包含的操作对应的令牌桶中是否有足够的 token。如果 token 充足才会将该 operator 加入到调度的队列中,同时从令牌桶中拿走对应的 token,否则该 operator 被丢弃。令牌桶会按照固定的速率补充 token,从而实现限速的目的。
Store Limit 与 PD 其他 limit 相关的参数(如 region-schedule-limit,leader-schedule-limit 等)不同的是,Store Limit 限制的主要是 operator 的消费速度,而其他的 limit 主要是限制 operator 的产生速度。引入 Store Limit 特性之前,调度的限速主要是全局的,所以即使限制了全局的速度,但还是有可能存在调度都集中在部分 store 上面,因而影响集群的性能。而 Store Limit 通过将限速的粒度进一步细化,可以更好的控制调度的行为。
使用方法
Store Limit 相关的参数可以通过 pd-ctl 进行设置。
查看当前 store 的 limit 设置
查看当前 store 的 limit 示例如下:
store limit // 显示所有 store 添加和删除 peer 的速度上限。 store limit add-peer // 显示所有 store 添加 peer 的速度上限。 store limit remove-peer // 显示所有 store 删除 peer 的速度上限。
设置全部 store 的 limit
设置全部 store 的 limit 示例如下:
store limit all 5 // 设置所有 store 添加和删除 peer 的速度上限为每分钟 5 个。 store limit all 5 add-peer // 设置所有 store 添加 peer 的速度上限为每分钟 5 个。 store limit all 5 remove-peer // 设置所有 store 删除 peer 的速度上限为每分钟 5 个。
设置单个 store 的 limit
设置单个 store 的 limit 示例如下:
store limit 1 5 // 设置 store 1 添加和删除 peer 的速度上限为每分钟 5 个。 store limit 1 5 add-peer // 设置 store 1 添加 peer 的速度上限为每分钟 5 个。 store limit 1 5 remove-peer // 设置 store 1 删除 peer 的速度上限为每分钟 5 个。
边栏推荐
- 被捧上天的Scrum敏捷管理为何不受大厂欢迎了?
- Redis cache penetration, breakdown, avalanche and consistency issues
- tiup env
- Flink本地UI运行
- 【云原生】灰度发布、蓝绿发布、滚动发布、灰度发布解释
- 100w的数据表比1000w的数据表查询更快吗?
- 剑指 Offer II 037. 小行星碰撞
- 952. 按公因数计算最大组件大小 : 枚举质因数 + 并查集运用题
- golang modules initialization project
- Huawei issues another summoning order for "Genius Boys"!He, who had given up an annual salary of 3.6 million, also made his debut
猜你喜欢

HTTP缓存小结

How is the B+ tree index page size determined?

面试何惧调优!腾讯技术官私藏的性能优化方案手册,原理实战齐全

GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?

Mysql database query is very slow. Besides the index, what else can be caused?

Flink real-time data warehouse completed

Memory-mapped, bit-band operations

B+树索引页大小是如何确定的?
![[Cloud native] Alibaba Cloud ARMS business real-time monitoring](/img/e7/55f560196521d22f830b2caf110e34.png)
[Cloud native] Alibaba Cloud ARMS business real-time monitoring

Excel使用Visual Basic Editor对宏进行修改
随机推荐
Go to Tencent for an interview and let people turn left directly: I don't know idempotency!
视频切换播放的例子(视频切换范例)代码
(Crypto essential dry goods) Detailed analysis of the current NFT trading markets
ISELED---氛围灯方案的新选择
Could not acquire management access for administration
tiup help
golang图片处理库image简介
软件包 - 笔记
4 senior experts share the insider architecture design and implementation principles of Flink technology with years of experience in large factories
难道Redis真的变慢了吗?
DDS Arbitrary Waveform Output Based on FPGA
The highest level of wiring in the computer room, the beauty is suffocating
QIIME2得到PICRUSt2结果后如何分析
5G-based Warehousing Informatization Solution 2022
Excel uses Visual Basic Editor to modify macros
canal scrape data
GeoServer
JVM performance tuning
Office Automation | Office Software and Edraw MindMaster Shortcuts
MySql error: SqlError(Unable to execute query", "Can't create/write to file OS errno 2 - No such file...