GiganticRay commented on issue #2582:
URL: https://github.com/apache/brpc/issues/2582#issuecomment-3426101079
> > concurrency
>
> 每个Server可以设置不同的并发度 brpc::ServerOptions options; options.max_concurrency =
FLAGS_server1_concurrency;
>
> 也可以实现一个gflags的validator,实现动态修改并发度。 bool
SetMaxConcurrencyOfServer1Validator(const char*, const int32_t value) {
servers_map[tag].ResetMaxConcurrency(value); return true; }
感谢回复~ 我没有直接使用 brpc server,我直接使用的 bthread 组件起任务,目前想单独为不同的 tag 设置
concurrency,我直接通过 `bthread_setconcurrency_by_tag` 接口,会出现报错: ` "Fail to set
concurrency by tag, , Total concurrency larger than bthread_concurrency".`。
于是我转而去设置 bthread 的最大 concurrency,发现只有接口 bthread_setconcurrency 能设置
bthread::FLAGS_bthread_concurrency,但是除此之外,bthread_setconcurrency 还 “均分” 新的
worker 至每一个 tag:
https://github.com/apache/brpc/blob/046fd435c7377af2827349bde71b5736ca172406/src/bthread/bthread.cpp#L372
,设置后再次调用 `bthread_setconcurrency_by_tag` 会失败。
目前我自己修改了 bthread_setconcurrency_by_tag (based on release1.10),看起来能解这个问题:
<img width="3388" height="926" alt="Image"
src="https://github.com/user-attachments/assets/d7263c51-f7c3-4487-a0ae-47f44588134a"
/>
想请教一下,现有 bthread 接口是否能满足“动态设置每一个 tag 的并发度”需求呢
--
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]