MrGuin commented on code in PR #2280:
URL: https://github.com/apache/brpc/pull/2280#discussion_r1233652155
##########
src/brpc/controller.cpp:
##########
@@ -1173,14 +1173,16 @@ void Controller::IssueRPC(int64_t start_realtime_us) {
wopt.ignore_eovercrowded = has_flag(FLAGS_IGNORE_EOVERCROWDED);
int rc;
size_t packet_size = 0;
+ // For async RPC, write to socket in background bthread to avoid blocking
current thread.
+ bool write_in_background = _done != nullptr;
Review Comment:
确实,我稍后改一下。
问下 `SocketVarsCollector::nkeepwrite` 和 `nkeepwrite_second` 这两个 bvar
是什么涵义呢?看起来是每次 `KeepWrite` 都把 `nkeepwrite` 自增一下,那 `nkeepwrite_second`
就是一秒内创建了多少次 KeepWrite bthread 吗?我这里在异步 RPC 的负载下观察到监控页面里的
rpc_keepwrite_second,这个值在改动之前是每秒一万二左右,改动之后每次都直接起 bthread
这个值就变成了每秒二万四左右。看起来像是多创建了一倍的 KeepWrite bthread,而且有些混合场景下性能会有下降,感觉可能是 bthread
创建调度开销导致的。
那异步 RPC 默认行为还是走正常的流程,在某些特殊场景下(比如要一次性发出大量 RPC)可以启用这个选项。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]