-
Notifications
You must be signed in to change notification settings - Fork 985
Native Transports
Netty provides three platform-specific JNI transports:
-
epoll on Linux
-
io_uring on Linux (Incubator)
-
kqueue on MacOS/BSD
Lettuce defaults to native transports if the appropriate library is available within its runtime. Using a native transport adds features specific to a particular platform, generate less garbage and generally improve performance when compared to the NIO based transport. Native transports are required to connect to Redis via Unix Domain Sockets and are suitable for TCP connections as well.
Native transports are available with:
-
Linux epoll x86_64 systems with a minimum netty version of
4.0.26.Final
, requiringnetty-transport-native-epoll
, classifierlinux-x86_64
<dependency> <groupId>io.netty</groupId> <artifactId>netty-transport-native-epoll</artifactId> <version>${netty-version}</version> <classifier>linux-x86_64</classifier> </dependency>
-
Linux io_uring x86_64 systems with a minimum netty version of
4.1.54.Final
, requiringnetty-incubator-transport-native-io_uring
, classifierlinux-x86_64
. Note that this transport is still experimental.<dependency> <groupId>io.netty.incubator</groupId> <artifactId>netty-incubator-transport-native-io_uring</artifactId> <version>0.0.1.Final</version> <classifier>linux-x86_64</classifier> </dependency>
-
MacOS kqueue x86_64 systems with a minimum netty version of
4.1.11.Final
, requiringnetty-transport-native-kqueue
, classifierosx-x86_64
<dependency> <groupId>io.netty</groupId> <artifactId>netty-transport-native-kqueue</artifactId> <version>${netty-version}</version> <classifier>osx-x86_64</classifier> </dependency>
You can disable native transport use through system properties. Set io.lettuce.core.epoll
, io.lettuce.core.iouring
respective io.lettuce.core.kqueue
to false
(default is true
, if unset).
Native transport support does not work with the shaded version of Lettuce because of two reasons:
-
netty-transport-native-epoll
andnetty-transport-native-kqueue
are not packaged into the shaded jar. So adding the jar to the classpath will resolve in different netty base classes (such asio.netty.channel.EventLoopGroup
instead ofcom.lambdaworks.io.netty.channel.EventLoopGroup
) -
Support for using epoll/kqueue with shaded netty requires netty 4.1 and all parts of netty to be shaded.
See also Netty documentation on native transports.
Lettuce documentation was moved to https://redis.github.io/lettuce/overview/
Intro
Getting started
- Getting started
- Redis URI and connection details
- Basic usage
- Asynchronous API
- Reactive API
- Publish/Subscribe
- Transactions/Multi
- Scripting and Functions
- Redis Command Interfaces
- FAQ
HA and Sharding
Advanced usage
- Configuring Client resources
- Client Options
- Dynamic Command Interfaces
- SSL Connections
- Native Transports
- Unix Domain Sockets
- Streaming API
- Events
- Command Latency Metrics
- Tracing
- Stateful Connections
- Pipelining/Flushing
- Connection Pooling
- Graal Native Image
- Custom commands
Integration and Extension
Internals