第 19 章 配置 IO 子系统
19.1. IO 子系统概述
io 子系统定义其他子系统(如 Undertow 和 Remoting)使用的 XNIO 工作节点(worker)和缓冲池。这些工作节点和缓冲池在 io 子系统的下列组件里定义:
默认的 IO 子系统配置
<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>19.2. 配置工作节点
工作节点(worker)就是 XNIO 工作节点实例,它是 Java NIO API 的抽象层,提供管理 IO 和工作节点线程的功能,及对 SSL 的支持。在默认情况下,JBoss EAP 提供一个名为 default 的工作节点,但您也可以定义多个工作节点。
更新现有的工作节点
要更新现有的工作节点:
/subsystem=io/worker=default:write-attribute(name=io-threads,value=10)
重新载入
创建新的工作节点
要创建新的工作节点:
/subsystem=io/worker=newWorker:add
删除工作节点
要删除工作节点:
/subsystem=io/worker=newWorker:remove
重新载入
关于配置工作节点的可用属性的完整列表,请参考 IO 子系统属性章节。
19.3. 配置缓冲池
缓冲池就是包括一组 NIO 缓冲实例的池。
修改缓冲大小对应用程序的性能有巨大的影响。对于多数的服务器来说,理想的大小通常是 16K 。
更新现有的缓冲池
要更新现有的缓冲池:
/subsystem=io/buffer-pool=default:write-attribute(name=direct-buffers,value=true)
重新载入
创建缓冲池
要创建新的缓冲池:
/subsystem=io/buffer-pool=newBuffer:add
删除缓冲池
要删除缓冲池:
/subsystem=io/buffer-pool=newBuffer:remove
重新载入
关于配置缓冲池的可用属性的完整列表,请参考 IO 子系统属性章节。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.