知识卡片
Raftstore繁忙的判据
有负载时,Raftstore 的 CPU 使用率超过 85% 即视为繁忙、成为瓶颈,此时 propose wait duration 可能高达百毫秒。在 Grafana 的 TiKV 面板看三项指标:
| 指标 | 含义 | 参考值 |
|---|---|---|
| Raft store CPU | Raftstore 线程的 CPU 使用率 | 低于 raftstore.store-pool-size × 85% |
| Propose wait duration | 请求发给 Raftstore 到真正开始处理的延迟 | 低于 50–100ms |
| Commit log duration | Raft 日志提交到多数成员的耗时 | 低于 200–500ms |
解读注意:CPU 使用率按单线程计,多线程 Raftstore 等比例放大;线程中含 I/O 操作,使用率不可能达到 100%。Commit log duration 高且波动大,可能是 Raftstore 负载高、append log 慢,或网络阻塞导致日志无法及时提交。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 6 处
- 性能调优 · 查看原书依据
通常在有负载的情况下,如果 Raftstore 的 CPU 使用率达到了 85% 以上,即可视为达到繁忙状态且成为了瓶颈,同时 propose wait duration 可能会高达百毫秒级别。
- 性能调优 · 查看原书依据
Raftstore 的 CPU 使用率是指单线程的情况。如果是多线程 Raftstore,可等比例放大使用率。
- 性能调优 · 查看原书依据
由于 Raftstore 线程中有 I/O 操作,所以 CPU 使用率不可能达到 100%。
- 性能调优 · 查看原书依据
Thread-CPU 下的 Raft store CPU 参考值:低于 raftstore.store-pool-size * 85%。
- 性能调优 · 查看原书依据
Raft Propose 下的 Propose wait duration Propose wait duration 是从发送请求给 Raftstore,到 Raftstore 真正开始处理请求之间的延迟时间。
- 性能调优 · 查看原书依据
Raft IO 下的 Commit log duration Commit log duration 是 Raftstore 将 Raft 日志提交到相应 Region 的多数成员所花费的时间。如果该指标的值较高且波动较大,可能的原因有: