brpc压测,主机CPU压不满
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
**Describe the bug (描述bug)**
brpc/example/multi_threaded_echo_c++ 启动brpc服务端,启动brpc客户端进行压测,thread_num为200,在同一台主机上启动多个客户端,系统CPU始终占不完,top命令查看,最多只能占用到85%左右,还有10%+的idle. server进程的CPU占用在1700%左右。如果启动两个server,一个监听8002端口,一个监听8003端口,在同一台主机上分别启动多个客户端对这两个server进行压测,加大压力,系统CPU还是只能占到85%左右,此时两个server进程的CPU占用合起来在1700%左右。看起来像是rpc服务端受到什么系统资源的限制,压测时无法占满主机的CPU,调整client.cpp中的attachment_size和request_size大小还是如此,压测无法将主机CPU资源占满
**To Reproduce (复现方法)**
见 (描述bug)
**Expected behavior (期望行为)**
同一台主机,加大客户端压力,可以压满主机的CPU;或者启动不同的rpc服务端,分别进行压测,可以压满主机的CPU
**Versions (各种版本)**
OS: Linux optane152
Compiler: gcc version 8.3.0 (GCC)
brpc: 当前git上最新版本的代码
protobuf:
**Additional context/screenshots (更多上下文/截图)**

Contributor guide
Research direction
Reproduce the benchmark in brpc/example/multi_threaded_echo_c++ using the client.cpp settings described, first comparing single-server and two-server runs with top. Check whether changing attachment_size and request_size affects the CPU ceiling, and document the limiting resource or condition observed. A useful result should explain the persistent idle CPU and provide a reproducible test configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, networking, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100