matrixorigin / matrixorigin/matrixone

[Task] Profile sysbench CPU/Memory/Mutex contention and analyze bottlenecks

Open
#25,472 5 comments 0 reactions 1 assignee Claimed by @VioletQwQ-0 View on GitHub
area/observability severity/s0
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

## Performance Task: Profile current sysbench workload (CPU/Memory/Mutex)

### Is there an existing issue for performance?
- [x] I have checked existing issues.

### Environment
- Branch: `main`
- Deployment: dev standalone / multi-CN as applicable

### Details of Performance
建立一个专用的 sysbench profiling 任务,聚焦当前问题场景下的 CPU、Memory、Mutex 瓶颈:
- 覆盖 `go` runtime CPU profile、heap、mutex profile;
- 形成可复现、可对比的采集流程;
- 输出 top/火焰图等可定位结论,给出优化方向。

### Reproduction Steps (sysbench)
1. 以低干扰方式启动 MO(示例):
```bash
./mo-service -debug-http=:6060 -block-profile-rate=100 -mutex-profile-fraction=100 -launch ./etc/launch/launch.toml
```
2. 确认实际运行的 sysbench 脚本参数(threads、duration、events、sql)
3. 压测时采集 profile(至少持续 30s):
```bash
curl -s "http://127.0.0.1:6060/debug/pprof/profile?seconds=30" > cpu.pprof
curl -s http://127.0.0.1:6060/debug/pprof/heap > heap.pprof
curl -s http://127.0.0.1:6060/debug/pprof/mutex > mutex.pprof
curl -s http://127.0.0.1:6060/debug/pprof/block > block.pprof
curl -s http://127.0.0.1:6060/debug/pprof/goroutine > goroutine.pprof
```
4. 多轮采集:压测前、压测中、压测后。
5. 分析(示例):
```bash
go tool pprof -top cpu.pprof
go tool pprof -web cpu.pprof # 如安装 graphviz
go tool pprof -top heap.pprof
go tool pprof -top mutex.pprof
go tool pprof -top block.pprof
```

### Expected Analysis Output
- CPU: 确认是否存在明显热点算子、锁、序列化/反序列化或调度路径;
- Memory: 定位高分配点,确认是否有持续增长(可疑泄漏)或短时暴涨;
- Mutex: 定位高竞争对象及其调用链,给出是否为代码路径、并发参数或引擎交互导致。

### Acceptance
- 采集步骤对同一 workload 可复现
- 形成每类 profile 的结论与可落地优化建议
- 输出下一步修复建议清单(含优先级)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.