浏览代码

Reduce the number of event loop threads for io_uring (#8231)

Francesco Nigro 2 年之前
父节点
当前提交
a4029fc9cd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      frameworks/Java/netty/src/main/java/hello/HelloWebServer.java

+ 1 - 1
frameworks/Java/netty/src/main/java/hello/HelloWebServer.java

@@ -37,7 +37,7 @@ public class HelloWebServer {
 	public void run() throws Exception {
 		// Configure the server.
 		if (IOUring.isAvailable()) {
-			doRun(new IOUringEventLoopGroup(), IOUringServerSocketChannel.class, IoMultiplexer.IO_URING);
+			doRun(new IOUringEventLoopGroup(Runtime.getRuntime().availableProcessors()), IOUringServerSocketChannel.class, IoMultiplexer.IO_URING);
 		} else
 			if (Epoll.isAvailable()) {
 			doRun(new EpollEventLoopGroup(), EpollServerSocketChannel.class, IoMultiplexer.EPOLL);