高性能网络的 Netty 替代品是什么? [英] What are the Netty alternatives for high-performance networking?

查看:26
本文介绍了高性能网络的 Netty 替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在选择一个网络库来实现一个不能节省任何微秒的客户端/服务器系统.它将实现自己的协议来发送和接收消息.我正在寻找一个好的 NIO 框架,它可以让我轻松开发服务器和客户端,而不必过多担心低级选择器的细节.每个人都向我推荐 Netty,但在向我的团队提交框架之前,我想尝试 2 或 3 个其他替代方案.我不太喜欢 Netty 的一件事是它如何使用自己的 ByteBuf 实现和引用计数来处理 ByteBuffers.任何人都可以分享您的想法和替代方案吗?

I am in the process of choosing a networking library to implement a client/server system that cannot spare any microsecond. It will implement its own protocol to send and receive messages. I am looking for a good NIO framework that will allow me to easily develop the server and the client, without having to worry too much about the low level selector details. Everyone recommends me Netty but I would like to experiment with 2 or 3 other alternatives before committing my team with a framework. One thing I did not like very much about Netty is how it handles ByteBuffers with its own ByteBuf implementation and reference counting. Can anyone share your thoughts and alternatives?

推荐答案

我们已经开发了一个 NIO 网络库 在环回上的执行时间低于 2 微秒,而不会为 GC 产生任何垃圾.正如 Peter Lawrey 提到的,原生 JDK 选择器会产生大量垃圾,但我们已经通过实现我们自己的 epoll 选择器修复了所有这些垃圾泄漏.忙于等待选择器线程对于延迟来说是很大的,但必须有一个平衡,不烧芯片或消耗大量能量.我们的选择器实现使用低级技巧来实现一种处理这种平衡的节能模式.

We have developed a NIO networking library that performs under 2 microseconds over loopback without producing any garbage for the GC. As Peter Lawrey mentioned, the native JDK selector produces a lot of garbage but we have fixed all these garbage leaks by implementing our own epoll selector. Busy waiting the selector thread is great for latency but there must be a balance not to burn the chip or consume a lot of energy. Our selector implementation use low-level tricks to implement a kind of energy saving mode that takes care of that balance.

除了CoralReactor,你还可以看看GrizzlyMina,但我们还没有玩过这些框架.

Besides CoralReactor, you can also take a look on Grizzly and Mina, but we haven't played with these frameworks yet.

对于某些 Netty TCP 性能基准,您可以查看 此处.

For some Netty TCP performance benchmarks you can take a look here.

这篇关于高性能网络的 Netty 替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆