threads
This commit is contained in:
@@ -19,7 +19,8 @@
|
||||
<!--
|
||||
【节点全局唯一】 @since 2.3.0
|
||||
全局Serivce执行的线程池, Application.workExecutor, 没配置该节点将自动创建一个。
|
||||
threads: 线程数,为0表示不启用workExecutor,只用IO线程。默认: CPU核数, 核数=1的情况下默认值为2
|
||||
threads: 线程数,默认值: CPU核数*10, 核数=2的情况下默认值为20。值为0表示不启用workExecutor,都在IO线程中运行。
|
||||
clients: client回调函数运行的线程池大小, 默认值: CPU核数*4
|
||||
-->
|
||||
<executor threads="4"/>
|
||||
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
<!--
|
||||
【节点全局唯一】 @since 2.3.0
|
||||
全局Serivce执行的线程池, Application.workExecutor, 没配置该节点将自动创建一个。
|
||||
threads: 线程数,为0表示不启用workExecutor,只用IO线程。默认: CPU核数, 核数=1的情况下默认值为2
|
||||
threads: 线程数,默认值: CPU核数*10, 核数=2的情况下默认值为20。值为0表示不启用workExecutor,都在IO线程中运行。
|
||||
clients: client回调函数运行的线程池大小, 默认值: CPU核数*4
|
||||
-->
|
||||
<executor threads="4"/>
|
||||
|
||||
|
||||
@@ -539,7 +539,7 @@ public final class Application {
|
||||
final AnyValue executorConf = config.getAnyValue("executor", true);
|
||||
StringBuilder executorLog = new StringBuilder();
|
||||
|
||||
final int workThreads = Math.max(Utility.cpus(), executorConf.getIntValue("threads", Utility.cpus() * 4));
|
||||
final int workThreads = Math.max(Utility.cpus(), executorConf.getIntValue("threads", Utility.cpus() * 10));
|
||||
//指定threads则不使用虚拟线程池
|
||||
this.workExecutor = executorConf.getValue("threads") != null
|
||||
? WorkThread.createExecutor(workThreads, "Redkale-WorkThread-%s")
|
||||
|
||||
Reference in New Issue
Block a user