You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "lhsoft (via GitHub)" <gi...@apache.org> on 2024/03/26 03:35:38 UTC

[I] Tagged task group增加不同tag的task数量 (brpc)

lhsoft opened a new issue, #2581:
URL: https://github.com/apache/brpc/issues/2581

   当前每个tagged task group数量是平均分配,但现实中需要对不同的task group指定不同的worker数量
   
   可以增加一个FLAGS_per_tagged_task_group_numbers = "20:40:40",指定不同task group的数量
   
   


-- 
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: dev-unsubscribe@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2019980377

   感觉你可以把bthread_min_concurrency设置成非0的,然后bthread_concurrency设置成一个比较大的数。
   然后再用上边的方式调整每组worker,你看看行不行。
   多组的配置这块我其实也没想好怎么搞合理。


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group增加不同tag的task数量 (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2019700335

   > 现在有两个参数可以配置 1、bthread_current_tag 用于指定 tag 2、bthread_concurrency_by_tag 用户设置(1)中tag的worker数量
   
   我看了下代码,这两个参数只能动态添加,且不能超过bthread_concurrency的上限,我的需求是:初始化的时候,设置bthread_currency, 同时指定不同的tag对应的worker number,看起来这两个参数不能完全满足


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group增加不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2019506341

   现在有两个参数可以配置
   1、bthread_current_tag 用于指定 tag
   2、bthread_concurrency_by_tag 用户设置(1)中tag的worker数量


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn closed issue #2581: Tagged task group设置不同tag的task数量
URL: https://github.com/apache/brpc/issues/2581


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2030941630

   我理解bRPC框架支持这个能力,策略由业务层调用这些能力就能达到。比如:你自己设置一个gflags变量FLAGS_per_tagged_task_group_numbers = "20:40:40",在validator里面
   调用bthread_set_minconcurrency bthread_setconcurrency bthread_current_tag bthread_concurrency_by_tag 这些函数,在初始化阶段就把不同池子的worker的数量设置好了。


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "lhsoft (via GitHub)" <gi...@apache.org>.
lhsoft commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2029274558

   多谢二位,动态配置确实可以实现目的,但感觉还是不够方便。最好有一种更只管简单的方式,大家线上用tagged group,也很少使用平均分配的方式吧。


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2019982716

   > 当前每个tagged task group数量是平均分配,但现实中需要对不同的task group指定不同的worker数量
   > 
   > 可以增加一个FLAGS_per_tagged_task_group_numbers = "20:40:40",指定不同task group的数量
   
   @wwbmmm 你有啥好的建议吗?你觉得这么搞可以吗?


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2116852306

   https://github.com/apache/brpc/blob/master/docs/cn/bthread_tagged_task_group.md


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [I] Tagged task group设置不同tag的task数量 (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on issue #2581:
URL: https://github.com/apache/brpc/issues/2581#issuecomment-2029043111

   > > 当前每个tagged task group数量是平均分配,但现实中需要对不同的task group指定不同的worker数量
   > > 可以增加一个FLAGS_per_tagged_task_group_numbers = "20:40:40",指定不同task group的数量
   > 
   > @wwbmmm 你有啥好的建议吗?你觉得这么搞可以吗?
   
   感觉多组的tag配置还是动态设置比较好,gflag本身不适合用来表达过于复杂的逻辑。如果用户需要在启动时指定,可以定义自己的gflag配置,然后根据自己的gflag配置调用bthread的接口来设置每一组的worker数量。


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org