brpc调用openmp时cpu消耗不受控制
Open
feature
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
在brpc服务中调用openmp进行矩阵运算,在设置了环境变量`OMP_NUM_THREADS和OMP_DYNAMIC="FALSE"`后,cpu消耗依旧不受控制。
例:`OMP_NUM_THREADS=4 OMP_DYNAMIC="FALSE"`;单个client请求的情况下,cpu消耗达到在600%-1000%之间波动;多个client并发的情况下,cpu消耗更加不可控。
已验证使用pthread对上述openmp的计算模块进行多线程调用时cpu消耗正常;已验证在brpc服务中去除openmp的相关模块后正常。
请问上述情况和bthread有没有关系?或者有什么排查方向吗?非常感谢!
Contributor guide
Research direction
The report names no source file or test. Start by reproducing the matrix workload in a brpc service with OMP_NUM_THREADS=4 and OMP_DYNAMIC=FALSE, compare one and multiple clients with the pthread and no-OpenMP cases, and investigate whether bthread affects CPU usage. Done means establishing the cause and recording a verified resolution or diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100