Skip to content

Boss线程数好像设置有误 #9

Closed
@cjqCN

Description

@cjqCN

Boss线程数好像设置有误
private static final int BOSS_SIZE = Runtime.getRuntime().availableProcessors() * 2; private static EventLoopGroup boss = new NioEventLoopGroup(BOSS_SIZE);

Netty 的服务器端的 acceptor 阶段, 没有使用到多线程,
服务器端的 ServerSocketChannel 只绑定到了 bossGroup 中的一个线程, 在调用 Java NIO 的 Selector.select 处理客户端的连接请求时, 实际上是在一个线程中的, 所以对只有一个服务的应用来说, bossGroup 设置多个线程是没有什么作用的

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions