You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2019/12/29 10:46:40 UTC

[GitHub] [incubator-brpc] yanglimingcn opened a new issue #1006: auto concurrency limiter

yanglimingcn opened a new issue #1006: auto concurrency limiter
URL: https://github.com/apache/incubator-brpc/issues/1006
 
 
   **Describe the bug (描述bug)**
   
   目前对auto_concurrency_limiter这块的实现遇到些问题,想在这里问一下。现象就是我的服务的latency大概是25us,qps是10000/s,
   计算出来的concurrency小于1,导致服务请求都不成功。
   自适应算法的公式为:next_max_concurrency = _min_latency_us * _ema_max_qps / 1000000 *  (1 + XXX_ratio)
   (这里先忽略_explore_ratio 或者 reduce_ratio)
   我举个例子说明问题:
   1、qps = 10000/s latency = 2500us concurrency = 25
   2、qps = 10000/s latency = 25us   concurrency = 0.25
   直观上看这个latency小的concurrency也小,这个很难理解。
   换个角度说一下就是,上面两组数据使用这个公式计算的concurrency 1)代表在2500us时间段内处理25个请求,2)代表在25us时间段内处理0.25个请求。
   其实在2500us时间段内2)也能处理25个请求,并且它的qps探索空间应该能更大。但是现在的值是0.25,导致max_concurrency的值一直是0(concurrency是整形),并且恢复不了(因为所有请求都被拒绝了)。
   目前的实现有一定的局限性。
   **To Reproduce (复现方法)**
   auto_concurrency_limiter例子里面的echo处理每个请求的延时修改为25us
   
   **Expected behavior (期望行为)**
   能适用到各种数据范围,产生正确的结果。
   
   **Versions (各种版本)**
   OS: debian
   Compiler:
   g++ (Debian 4.9.2-10+deb8u1) 4.9.2
   Copyright (C) 2014 Free Software Foundation, Inc.
   This is free software; see the source for copying conditions.  There is NO
   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   brpc: master
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] zyearn commented on issue #1006: auto concurrency limiter

Posted by GitBox <gi...@apache.org>.
zyearn commented on issue #1006: auto concurrency limiter
URL: https://github.com/apache/incubator-brpc/issues/1006#issuecomment-570985514
 
 
   little's law说的就是long-term average,均值稳定就可以

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] yanglimingcn commented on issue #1006: auto concurrency limiter

Posted by GitBox <gi...@apache.org>.
yanglimingcn commented on issue #1006: auto concurrency limiter
URL: https://github.com/apache/incubator-brpc/issues/1006#issuecomment-570181153
 
 
   再请教个问题,是不是服务的请求执行时间不是很稳定的服务不太适合这个算法啊?的确根据little‘s law的理论,得到并发度,但是我测试发现,相比最小latency,我放宽一些latency,qps就高起来了。

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] zyearn commented on issue #1006: auto concurrency limiter

Posted by GitBox <gi...@apache.org>.
zyearn commented on issue #1006: auto concurrency limiter
URL: https://github.com/apache/incubator-brpc/issues/1006#issuecomment-569686934
 
 
   latency qps和 concurrency满足[little's law](https://en.wikipedia.org/wiki/Little%27s_law),也是目前这套自适应限流的理论基础。你说的concurrency小于1的问题应该在https://github.com/apache/incubator-brpc/pull/1003 要修复的问题

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-brpc] zyearn edited a comment on issue #1006: auto concurrency limiter

Posted by GitBox <gi...@apache.org>.
zyearn edited a comment on issue #1006: auto concurrency limiter
URL: https://github.com/apache/incubator-brpc/issues/1006#issuecomment-569686934
 
 
   latency qps和 concurrency满足[little's law](https://en.wikipedia.org/wiki/Little%27s_law),也是目前这套自适应限流的理论基础。你说的concurrency小于1的问题应该是 https://github.com/apache/incubator-brpc/pull/1003 要修复的问题

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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