event_dispatcher 数量设置咨询
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cpp
Research direction
Start by reviewing the event_dispatcher_num setting, signal_task behavior, and the constraints discussed in issue #1120. Measure the impact of different dispatcher counts across tagged groups and document whether per-group or worker-based configuration is needed. Done means an agreed configuration recommendation or a clearly scoped feature proposal.
Written by the indexing model from the issue text.
Description
在我们的场景中,通过 brpc 框架传输数据量较大。单个客户端可能会和多个服务端建立连接。在流量较小时(大量 brpc_worker 都阻塞在 parking log上),如果单次发送大量请求后返回。极端情况下分为两种可能,会影响系统长尾时延
- 通过一个 fd 接收所有的 repsonse,此时虽然能产生 n 个 bthread,但是加了nosignal的flag。最后的 bthread_flush 只能唤醒最多 2 个 brpc_worker 消费。其实大量的 response 都是在串行消费。 这里是 signal_task 为了权衡性能和调度及时性,所以设置成了2。目前来看好像已经是最优设置?
- 如果 response 通过多个 fd 接收。fd 的 消费在一个 event_dispatcher 中是串行的,此时也会存在大量response 串行消费的问题。但是这种场景下,可以通过增加 event_dispatcher 的数量,来提升唤醒并消费任务的 brpc_worker 数量, 实测可以提升一些性能。
这里有几个问题咨询一下
- event_dispatcher 数量设置有什么建议参考吗?event_dispatcher 较多对性能有副影响么?
- 当前 event_dispatcher_num 设置是不区分 tag 的,即每个 tagged group 都会初始化 event_dispatcher_num 个 bthread。但是基于实际需求,每个 tagged group 中的 brpc_worker 数实际上是不一样的。之前 https://github.com/apache/brpc/issues/1120 中提到过,event_dispatcher_num 的大小不能大于等于 brpc_worker 的数量,否则会存在问题。导致在多 tag 场景下设置 event_dispatcher_num 不太灵活,是不是应该有类似于分别设置或者每 n 个 brpc_worker 初始化一个 event_dispatcher 的参数。
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.2k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 72
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/brpc
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
endpoint2hostname() prints a byte-swapped port for IPv6 endpointsPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
perf(butil): ARM64 (aarch64) performance and modernisation improvements across atomics, CRC32C, spin-wait hints, and fast timersPossibly taken @jimmystewpot claimed this 2 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 2 days
-
file:// naming service takes a comment after the address as the tagPossibly taken @0z5a claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 2 days
Similar issues
-
agent:Windows bug in progress pri:medium sev:low testing windows
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#125651 ·
Maintainers usually reply within 1 day
-
Android: with view recycling on, a recycled View keeps its nextFocusLeftPossibly taken A pull request linked to this issue is open or already merged. OpenNeeds: Triage :mag: Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#60167 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100