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 2020/09/01 16:05:21 UTC

[GitHub] [incubator-brpc] guodongxiaren opened a new issue #1225: rpc_dump的功能可以自定义频率吗?

guodongxiaren opened a new issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225


   **Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
   不用生产环境来dump流量。用的非生产环境,但是非生产环境的流量很小。想dump流量貌似很慢。
   
   **Describe the solution you'd like (描述你期望的解决方法)**
   调节一下随机策略。加一个控制因子
   ```c
   inline size_t is_collectable(CollectorSpeedLimit* speed_limit) {
       if (speed_limit->ever_grabbed) { // most common case
           const size_t sampling_range = speed_limit->sampling_range;
           // fast_rand is faster than fast_rand_in
           if ((butil::fast_rand() & (COLLECTOR_SAMPLING_BASE - 1)) >= sampling_range) {
               return 0;
           }
           return sampling_range;
       }
       // Slower, only runs before -bvar_collector_expected_per_second samples are
       // collected to calculate a more reasonable sampling_range for the type.
       extern size_t is_collectable_before_first_time_grabbed(CollectorSpeedLimit*);
       return is_collectable_before_first_time_grabbed(speed_limit);
   }
   ```
   这个sampling_range 能不能是通过控制因子计算的。
   
   **Describe alternatives you've considered (描述你想到的折衷方案)**
   
   
   **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



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


[GitHub] [incubator-brpc] guodongxiaren commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
guodongxiaren commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-687048973


   > 那你实际观测到的采样率大概是多少呢?
   
   一个非线上的机器,就是一分钟内一会有请求一会没有。qps小于1吧。就想每次请求都落一下。不想用线上的机器落。怕影响性能。


----------------------------------------------------------------
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



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


[GitHub] [incubator-brpc] gydong commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-687955924


   『貌似很慢』这个描述很笼统,不清楚哪里不符合预期,是流量少导致慢还是采样频率不符合预期,如何不符合预期


----------------------------------------------------------------
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



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


[GitHub] [incubator-brpc] jamesge commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
jamesge commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-688422452


   从实现角度来说,如果FLAGS_bvar_collector_expected_per_second远大于实际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



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


[GitHub] [incubator-brpc] gydong edited a comment on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
gydong edited a comment on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-686230241


   把 FLAGS_bvar_collector_expected_per_second 设置成超过你服务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



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


[GitHub] [incubator-brpc] guodongxiaren commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
guodongxiaren commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-687979748


   > 『貌似很慢』这个描述很笼统,不清楚哪里不符合预期,是流量少导致慢还是采样频率不符合预期,如何不符合预期
   
   不符合预期是说。当qps小于1的时候,一条都dump不下来。


----------------------------------------------------------------
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



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


[GitHub] [incubator-brpc] gydong commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-686230241


   把 FLAGS_bvar_collector_expected_per_second 设置成超过你服务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



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


[GitHub] [incubator-brpc] guodongxiaren commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
guodongxiaren commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-686485682


   > 把 FLAGS_bvar_collector_expected_per_second 设置成超过你服务QPS的一个数字不可以吗?
   
   这个flag默认值是1000。已经远超我们的qps了。
   @gydong 


----------------------------------------------------------------
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



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


[GitHub] [incubator-brpc] gydong commented on issue #1225: rpc_dump的功能可以方便的自定义采样频率吗?

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225#issuecomment-686840044


   那你实际观测到的采样率大概是多少呢?


----------------------------------------------------------------
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



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