This is an automated email from the ASF dual-hosted git repository. laiyingchun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pegasus-website.git
The following commit(s) were added to refs/heads/master by this push: new 9fa2aae4 Update hotspot detection zh docs (#97) 9fa2aae4 is described below commit 9fa2aae4b5c7f410b5884b9f6d00abb2fed05ec4 Author: Pengfan Lu <lu_peng_...@163.com> AuthorDate: Wed Mar 26 21:58:00 2025 +0800 Update hotspot detection zh docs (#97) --- _docs/zh/administration/hotspot-detection.md | 29 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/_docs/zh/administration/hotspot-detection.md b/_docs/zh/administration/hotspot-detection.md index 9e030a37..debcf3d7 100644 --- a/_docs/zh/administration/hotspot-detection.md +++ b/_docs/zh/administration/hotspot-detection.md @@ -3,12 +3,14 @@ permalink: administration/hotspot-detection --- # 功能简介 -Pegasus 是一个以 hash 分片打散数据的分布式存储系统。通常情况下,流量会均匀地打在集群中的所有节点上。但是在极端情况下,比如 `hashkey` 设计不合理、出现了热点事件/热点用户、业务代码逻辑错误等场景下,Pegasus 单机节点往往会负载过高从而影响服务整体的可用性。于是我们设计了一套热点检测方案帮助运维人员能及时发现热点问题并找出热点流量。 +Pegasus 是一个以 `Hash` 分片打散数据的分布式存储系统。通常情况下,流量会均匀地打在集群中的所有节点上。但是在极端情况下,比如 `Hashkey` 设计不合理、出现了热点事件/热点用户、业务代码逻辑错误等场景下,Pegasus 单机节点往往会负载过高从而影响服务整体的可用性。于是我们设计了一套热点检测方案帮助运维人员能及时发现热点问题并找出热点流量。 # 热点分片查询 ## 设计原理 -Collector 周期性从集群拿到的各个分片的读写流量进行数据分析,对每个分片通过纵向的历史数据和横向同期数据对比,计算 [Z-score](https://en.wikipedia.org/wiki/Standard_score) 用来描述分片的热点情况。在开启 `enable_hotkey_auto_detect` 选项后,Collector 会自动向热点分片发送 [热点流量查询](#热点流量查询) 请求,统计当前异常的热点流量。 +Pegasus服务端主要有三个组件:Meta,Replica和Collector。其中Collector负责从Replica中获取Metric信息并上报给监控平台、集群可用性探测等功能。 + +此功能中,Collector 周期性从集群拿到的各个分片的读写流量进行数据分析,对每个分片通过纵向的历史数据和横向同期数据对比,计算 [Z-score](https://en.wikipedia.org/wiki/Standard_score) 用来描述分片的热点情况。在开启 `enable_hotkey_auto_detect` 选项后,Collector 会自动向热点分片发送 [热点流量查询](#热点流量查询) 请求,统计当前异常的热点流量,并将结果上报到监控平台(Falcon)。 ## 操作示例 在配置文件中添加以下几个配置项,然后重启 Collector: @@ -28,38 +30,41 @@ occurrence_threshold = 100 ``` ## 相关监控 + +在Falcon中依据此Metric即可查到是否目标机器存在热点,`hotkey_type` 分为 `read` 和 `write` 分别代表读/写热点。 + ``` app.stat.hotspots@{app_name}.{hotkey_type}.{partition_count} ``` -hotkey_type 分为 `read` 和 `write` 分别代表读/写热点 - # 热点流量查询 ## 设计原理 -在 replica 收到对应分片的热点流量查询请求后,会记录统计一段时间的流量,从而分析出具体的热点流量。如果周期时间内找不到热点流量,收集会自动停止。 +此功能可确认某一个分片热点的具体`Hashkey`。 Replica 收到对应分片的热点流量查询请求后,会记录统计一段时间的流量,从而分析出具体的热点流量。如果周期时间内找不到热点流量,收集会自动停止。 ## 操作示例 **开启热点流量检测** -你需要在命令行中添加探测表的 app_id、分片号、热点数据类型、需要探测的节点地址 +你需要在命令行中添加探测表的 `app_id`、分片号、热点数据类型、需要探测的节点地址 ``` >>> detect_hotkey -a 3 -p 1 -t write -c start -d 10.231.57.104:34802 Detect hotkey rpc is starting, use 'detect_hotkey -a 3 -p 1 -t write -c query -d 10.231.57.104:34802' to get the result later ``` **查询热点流量结果** -当热点流量检测未结束时,会受到如下提示 +当热点流量检测未结束时,会受到如下提示: ``` ->>> detect_hotkey -a 3 -p 1 -t write -c query -d 10.231.57.104:34802 -Hotkey detect rpc performed failed, in 3.1, error_hint:ERR_BUSY Can't get hotkey now, now state: hotkey_collector_state::COARSE_DETECTING +>>> detect_hotkey -a 3 -p 2 -t write -c query -d 10.231.57.104:34802 +Hotkey detection performed failed, in 584.78, error_hint:ERR_BUSY Can't get hotkey now, now state: hotkey_collector_state::COARSE_DETECTING +>>> detect_hotkey -a 3 -p 2 -t write -c query -d 10.231.57.104:34802 +Hotkey detection performed failed, in 584.78, error_hint:ERR_BUSY Can't get hotkey now, now state: hotkey_collector_state::FINE_DETECTING ``` -成功获取到热点流量 `hashkey = Thisishotkey1`,后的结果 +成功获取到热点流量 `hashkey = Thisishotkey1`,后的结果: ``` >>> detect_hotkey -a 3 -p 2 -t write -c query -d 10.231.57.104:34802 Find write hotkey in 3.2 result:\"Thisishotkey1\" ``` -周期内无法检测到热点流量的结果 +周期内无法检测到热点流量的结果: ``` >>> detect_hotkey -a 3 -p 2 -t write -c query -d 10.231.57.104:34803 Hotkey detect rpc performed failed, in 3.2, error_hint:ERR_BUSY Can't get hotkey now, now state: hotkey_collector_state::STOPPED @@ -70,7 +75,7 @@ Hotkey detect rpc performed failed, in 3.2, error_hint:ERR_BUSY Can't get hotkey >>> detect_hotkey -a 3 -p 2 -t write -c stop -d 10.231.57.104:34803 Detect hotkey rpc is stopped now ``` -无论是检测成功还是检测失败都要先 stop 这次探测才能开始下一次探测 +注意:无论是检测成功还是检测失败都要先 `stop` 这次探测才能开始下一次探测。 ## 相关配置 ```shell --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pegasus.apache.org For additional commands, e-mail: commits-h...@pegasus.apache.org