Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netty EpollEventLoopGroup vs NioEventLoopGroup, which should I choose on CentOS 6?

Tags:

java

netty

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?

like image 743
Weibo Li Avatar asked Feb 23 '16 03:02

Weibo Li


2 Answers

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.

like image 191
Norman Maurer Avatar answered Sep 22 '22 06:09

Norman Maurer


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

like image 39
xiao-c Avatar answered Sep 26 '22 06:09

xiao-c