Skip to content

Commit ffedb14

Browse files
committed
docs: add default threads count about NioEventLoopGroup
1 parent 7ddb830 commit ffedb14

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/io/lettuce/core/AbstractRedisClient.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@
6868

6969
/**
7070
* Base Redis client. This class holds the netty infrastructure, {@link ClientOptions} and the basic connection procedure. This
71-
* class creates the netty {@link EventLoopGroup}s for NIO ({@link NioEventLoopGroup}) and EPoll (
72-
* {@link io.netty.channel.epoll.EpollEventLoopGroup}) with a default of {@code Runtime.getRuntime().availableProcessors() * 4}
73-
* threads. Reuse the instance as much as possible since the {@link EventLoopGroup} instances are expensive and can consume a
74-
* huge part of your resources, if you create multiple instances.
71+
* class creates the netty {@link EventLoopGroup}s for NIO ({@link NioEventLoopGroup}) with a default of
72+
* {@code SystemPropertyUtil.getInt("io.netty.eventLoopThreads", Math.max(MIN_IO_THREADS, Runtime.getRuntime().availableProcessors()))}
73+
* threads and EPoll ({@link io.netty.channel.epoll.EpollEventLoopGroup}) with a default of
74+
* {@code Runtime.getRuntime().availableProcessors() * 4} threads. Reuse the instance as much as possible since the
75+
* {@link EventLoopGroup} instances are expensive and can consume a huge part of your resources, if you create multiple
76+
* instances.
7577
* <p>
7678
* You can set the number of threads per {@link NioEventLoopGroup} by setting the {@code io.netty.eventLoopThreads} system
7779
* property to a reasonable number of threads.

0 commit comments

Comments
 (0)