Why do we really need multiple netty boss threads?

后端 未结 1 1270
梦如初夏
梦如初夏 2021-02-03 13:01

I\'m really confused about the number of threads for a boss group. I can\'t figure out a scenario where we need more than one boss thread. In do we need more than a single threa

相关标签:
1条回答
  • the creator of Netty says multiple boss threads are useful if we share NioEventLoopGroup between different server bootstraps, but I don't see the reason for it.

    As Norman Maurer said, it's not necessary, but it's very useful.

    If you are using 1 thread for 2 different bootstraps, it means that you can't handle connections to this bootstraps simultaneously. So in very very bad case, when boss thread handle only connections for one bootstrap, connections to another will never be handled.

    Same for workers EventLoopGroup.

    0 讨论(0)
提交回复
热议问题