High number of lettuce-nioEventLoop threads

3,114 views
Skip to first unread message

mykev...@gmail.com

unread,
Oct 13, 2017, 7:20:42 PM10/13/17
to lettuce-redis-client-users
Hello,

We are seeing high number of lettuce-nioEventLoop threads, and I wonder if this is normal.  The thread dump is as following, and we see 120 - 146.

"lettuce-nioEventLoop-11-17" Id=441 | RUNNABLE (in native)
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:759)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:400)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
        at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
        at java.lang.Thread.run(Thread.java:745)

One thing we experience is, our web server goes down when the number goes like 146.  Is there any known issue related to this?  We are using lettuce 4.3.1.Final.

Thank you,
Kevin

Mark Paluch

unread,
Oct 14, 2017, 2:06:36 PM10/14/17
to lettuce-redis-client-users
Hi Kevin, 

The thread name indicates that you have at least 11 eventLoopGroup’s spun up. Each of them spins up to Runtime.availableProcessors().

Make sure to either use a single RedisClient instance or share threading resources via ClientResources [0].

Cheers, 
Mark

--
You received this message because you are subscribed to the Google Groups "lettuce-redis-client-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-clien...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lettuce-redis-client-users/1c4ff36b-1806-4b94-bd4d-6830828502ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mykev...@gmail.com

unread,
Oct 15, 2017, 7:57:55 PM10/15/17
to lettuce-redis-client-users
Hi Mark,

Thanks for the information on ClientResources.  There were 6 groups and 4 of them had 36 threads.  Yes the server has 36 cores.
Count Thread Group
     36 nioEventLoop-11
     36 nioEventLoop-14
      1 nioEventLoop-19
      1 nioEventLoop-20
     36 nioEventLoop-5
     36 nioEventLoop-8

I have multiple instances of a client with different Redis clusters.  Can we configure a ClientResources and share for multiple Redis clusters/servers, or one ClientResources per Redis cluster?

Thank you in advance!
Kevin
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-client-users+unsub...@googlegroups.com.

Mark Paluch

unread,
Oct 16, 2017, 2:06:42 AM10/16/17
to lettuce-redis-client-users
You can share a single instance across multiple RedisClient/RedisClusterClient instances, see the documentation for further reference.
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-clien...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lettuce-redis-client-users/c714e5d8-ef25-4bbc-92f6-89ab0d43fd39%40googlegroups.com.

7153...@qq.com

unread,
Apr 25, 2019, 11:14:45 PM4/25/19
to lettuce-redis-client-users


在 2017年10月14日星期六 UTC+8上午7:20:42,mykev...@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages