luky116 edited a comment on pull request #258:
URL: https://github.com/apache/dubbo-go-samples/pull/258#issuecomment-939592589


   > @luky116 samples 里面给出的例子,用了随机拒绝的逻辑,看实现应该是拒绝了2/3的流量,随机拒绝逻辑意义不大,放到samples 
里不适合。我理解你这个例子是为了说明,用户可以自定义限制逻辑。我认为可以单独在filter里面开一个samples来阐述拒绝逻辑自定义方法和要点。 
但这个samples 是tpslimit,建议使用框架提供好的 tps 拒绝策略,来拒绝一段时间内过量的请求。并且能通过samples 
运行,来实际看到一部分超额的流量被拒绝。例如配置上限为10/s,然后并发20个请求,最后打印成功数和失败数,在集成测试中也是按照这个思路进行assert
   
   用dubbogo框架自带的确实会好点,我改为了fixedWindow策略,提交代码,你看下哈。


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

Reply via email to