cloudwego / kitex

Go RPC framework with high-performance and strong-extensibility for building micro-services.
https://www.cloudwego.io
Apache License 2.0
6.93k stars 807 forks source link

can kitex support kcp? #157

Open lubanproj opened 2 years ago

lubanproj commented 2 years ago

We mainly focus on frame synchronization in online games and real-time battle scenarios which has high requirements for latency. After looking at the test data on the Internet, the performance of kcp is better than that of quic in weak network scenarios. I looked at grpc and rpcx. The mode based on a single long connection can support kcp, but kitex cannot.

refer to : https://github.com/xtaci/kcp-go

YangruiEmma commented 2 years ago

Thank you for your suggestion, we will consider about it but the time is not sure now. When we have planned to do it, we will update this issue. Of course, we would appreciate it if you can submit your implementation.

hunterhug commented 2 years ago

Thank you for your suggestion, we will consider about it but the time is not sure now. When we have planned to do it, we will update this issue. Of course, we would appreciate it if you can submit your implementation.

can refer the project of rpcx, it takes a plug-in way to implement many choice. 传输协议和编码都可以采用契约式接口解偶,这样可以通过插件化形式来实现。

YangruiEmma commented 2 years ago

Thank you for your suggestion, we will consider about it but the time is not sure now. When we have planned to do it, we will update this issue. Of course, we would appreciate it if you can submit your implementation.

can refer the project of rpcx, it takes a plug-in way to implement many choice. 传输协议和编码都可以采用契约式接口解偶,这样可以通过插件化形式来实现。

感谢您的建议,kitex的设计就是可以扩展支持其他协议和传输模块的,提供了扩展接口,能力支持是OK的,但我们要评估优先级,也期望有其他开发者参与贡献~

joway commented 2 years ago

@lubanproj @hunterhug Hi, we are doing some research on UDP protocol in the RPC scenario.

We found that kcp is designed for the high radio packet-loss environment, but the RPC framework is most of the time used in a data center that has a very good network state. And the retransmission and userspace-ACK features cause bad performance compared to TCP.

With TCP, netpoll could have 29w QPS. With KCP, only have 14w QPS.

I think it's maybe a good idea to use UDP in the RPC scenario, but we may need to develop a suitable UDP protocol for this use case, and KCP seems not a suitable solution.

If you have good practices in this field, welcome to provide your use case and the performance data.