Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why native epoll support is introduced in Netty?

Tags:

I believe Java's NIO library will use epoll on Linux machines. What are all the advantages of using Epoll instead of NIO on Linux machines.

like image 438
Dhanaraj Durairaj Avatar asked May 05 '14 05:05

Dhanaraj Durairaj


People also ask

What is epoll in Netty?

Netty's epoll transport uses epoll edge-triggered while java's nio library uses level-triggered. Beside this the epoll transport expose configuration options that are not present with java's nio like TCP_CORK, SO_REUSEPORT and more.

Does Netty use epoll?

Netty supports the use of native-epoll-connection by adding an optional dependency. If the driver is not present, Netty will fallback to using NIO instead of the native protocol .


2 Answers

Netty's epoll transport uses epoll edge-triggered while java's nio library uses level-triggered. Beside this the epoll transport expose configuration options that are not present with java's nio like TCP_CORK, SO_REUSEPORT and more.

like image 58
Norman Maurer Avatar answered Sep 17 '22 19:09

Norman Maurer


There are some information about this in netty's docs:

Netty provides the following platform 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.

like image 20
Tobske Avatar answered Sep 19 '22 19:09

Tobske