Last active
September 15, 2021 12:09
-
-
Save yangl/7038eb963c052640aa0c470173f6697e to your computer and use it in GitHub Desktop.
解决Lettuce在多分片时线程数过多问题,需单独配置ioThreadPoolSize&computationThreadPoolSize然后共享eventExecutorGroup,非-Dio.netty.eventLoopThreads=… https://lettuce.io/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ClientResources.builder().ioThreadPoolSize(…).computationThreadPoolSize(…).eventExecutorGroup(...).build() | |
EventExecutorGroup eventExecutorGroup = DefaultEventLoopGroupProvider.createEventLoopGroup(DefaultEventExecutorGroup.class, | |
computationThreadPoolSize, threadFactoryProvider); | |
/** | |
* Create a new client that connects to the supplied uri with shared {@link ClientResources}.You need to shut down the | |
* {@link ClientResources} upon shutting down your application. You can connect to different Redis servers but you must | |
* supply a {@link RedisURI} on connecting. | |
* | |
* @param clientResources the client resources, must not be {@code null}. | |
* @param uri the Redis URI, must not be {@code null}. | |
* @return a new instance of {@link RedisClient}. | |
*/ | |
public static RedisClient create(ClientResources clientResources, String uri) { | |
assertNotNull(clientResources); | |
LettuceAssert.notEmpty(uri, "URI must not be empty"); | |
return create(clientResources, RedisURI.create(uri)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment