I'm using netty 4.1.0CR, the official code samples suggest me to use NioEventLoopGroup
to start a server as well as client, as following:
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup();
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup);
But I'm running both server and client on Linux(CentOS 6), should I use EpollEventLoopGroup
to get better performance? Or how could I decide which one to use?
If you are running on linux you can use EpollEventLoopGroup and so get better performance, less GC and have more advanced features that are only available on linux.
Netty provides the following platforms in specific JNI transports:
Linux (since 4.0.16)
MacOS/BSD (since 4.1.11)
These JNI transports add features specific to a particular platform, generate less garbage, and generally improve performance when compared to the NIO based transport.
For more information check Netty Native transports
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With