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

2023-01-09 Thread GitBox


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

   @leaf-potato 谢谢你的指点,`append_user_data ` 确实可以避免大chunk copy 到 attachment 的问题。 
Q3 我正在学习中。
   针对 Q1 还有疑问,不理解你上面回复
   ```
   在限制范围内,attachment和proto的区别在于序列化和反序列化,如果attachment是传proto序列化后的数据,理论上两者差距不大。
   ```
   针对`attachment传proto序列化后的数据,理论上两者差距不大`,是不是因为采用 `append_user_data 
`没有复制数据,所以跟直接传proto序列化后的数据效果差不多?如果采用 `append` 复制proto序列化后的数据到 iobuf,就应该会慢一些?
   
   这一块有官方文档说明么?或者有没有实验数据。
   


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