chenbay commented on PR #1928:
URL: https://github.com/apache/incubator-brpc/pull/1928#issuecomment-1281020322

   > > > @chenbay Could you describe the use case of these new options?
   > > 
   > > 
   > > @wwbmmm 两个节点间多个streams 
protocol通过一个socket连接传输数据,handler里消费速度跟不上,数据堆积在_consumer_queue里,因为streams数量我们使用的没法限制,所以想加到socket上限制。
   > 
   > 
感觉好像没必要在Socket上限制。如果每个Stream都设置了max_buf_size,当数据堆积在_consumer_queue到一定程度,发送端自然会限流,每个Stream都会被限住,那么Socket上自然就限住了。
 
而且如果有部分Stream消费地比较快的话,那么这部分Stream的发送端还可以继续发送。但如果在Socket层面限流的话,就会导致这部分Stream也被限制发送了,造成不必要的限制。
   
   max_buf_size只能限制单个stream的buffer 
size,我们两个节点间stream数量可能很多,希望能限制这些streams的总buffer大小,控制内存占用,目前考虑的是通过socket来限制(因为socket就是端到端),socket内的多个streams就让他们自己竞争,有一个min_buf_size也保证了stream不会饿死。


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