[GitHub] [incubator-brpc] leaf-potato commented on issue #2052: 传输大量数据必须用butil::IOBuf 吗?

2023-01-03 Thread GitBox


leaf-potato commented on issue #2052:
URL: 
https://github.com/apache/incubator-brpc/issues/2052#issuecomment-1369936547

   > Q3:通过 perf,我们看到 bthread 中的 sys call 占总体 sys call 的 20% 
左右,不知道是我们使用姿势有问题,或者是有优化参数可以控制?
   
   可以参考 
[高效率排查server卡顿](https://github.com/apache/incubator-brpc/blob/master/docs/cn/server_debugging.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-unsubscr...@brpc.apache.org

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


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



[GitHub] [incubator-brpc] leaf-potato commented on issue #2052: 传输大量数据必须用butil::IOBuf 吗?

2023-01-03 Thread GitBox


leaf-potato commented on issue #2052:
URL: 
https://github.com/apache/incubator-brpc/issues/2052#issuecomment-1369923528

   > 也就是发送数据量 >=2G 的时候在发送端的 copy 无法消除,其他的 copy 都可以消除,这样可以更高效。
   
   我理解不管使用PB还是attachment发送数据都会涉及到一次拷贝,只是这个拷贝发生的地方不同:
   1. PB发送数据:用户设置PB => PB序列化(框架)=> 发送。拷贝发生在框架拿到PB序列化的结果。
   2. attachment:用户PB序列化 => attachment => 发送。拷贝发生在用户序列化PB给attachment赋值。
   
   > 在限制范围内,attachment和proto的区别在于序列化和反序列化,如果attachment是传proto序列化后的数据,理论上两者差距不大。
   
   综上,用户更多考虑的是如何给PB赋值时减少拷贝,比方使用PB的Swap方法进行数据交换等。最终得@wwbmmm来double 
check下避免得出错误结论~


-- 
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-unsubscr...@brpc.apache.org

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


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



[GitHub] [incubator-brpc] fzhedu commented on issue #2052: 传输大量数据必须用butil::IOBuf 吗?

2023-01-03 Thread GitBox


fzhedu commented on issue #2052:
URL: 
https://github.com/apache/incubator-brpc/issues/2052#issuecomment-1369506674

   @leaf-potato 感谢您的回复。Q2 已经没疑问了,但是 Q1 中关于用 iobuf 和直接 chunkPB 
传输的性能方面还有疑问,因为我们传输的是 chunkPB list,它由多个 chunkPB 组成,可以直接传输 chunkPB 
list。如果用IObuf,现有 Starrocks 中将 chunkPB list 中的每个 chunkPB copy 到 IOBuf 
中进行发送;接受端则需要从 IObuf 中 copy 出 chunkPB。在发送和接受端各有一次 copy,这个代价使得 IObuf 应该会慢一些。同时考虑到 
IOBuf 不限制发送数据量的优势,因此我们做出一些优化:
   1. 针对接受端,使用 cut() 函数避免 copy,直接引用 iobuf 中的数据来 deserialize,避免原来的 copy;
   2. 针对发送端,当发送数据量< 2G,则直接传 serialize 的 chunkPB list,不然则 copy 到 iobuf。
   
   也就是发送数据量 >=2G 的时候在发送端的 copy 无法消除,其他的 copy 都可以消除,这样可以更高效。
   
   此外还有个问题请教一下:
   
   Q3:通过 perf,我们看到 bthread 中的 sys call 占总体 sys call 的 20% 
左右,不知道是我们使用姿势有问题,或者是有优化参数可以控制?
   
   
   
![image](https://user-images.githubusercontent.com/6490813/210322342-3b8dc18b-8774-47b7-bf6b-09594ddb5b24.png)
   


-- 
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-unsubscr...@brpc.apache.org

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


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