Chapter 17. Configuring the IO subsystem
You can configure the io
subsystem in JBoss EAP to enhance system performance and support application operations. By managing XNIO workers and buffer pools, you can ensure optimal functionality for subsystems like Undertow and Remoting. Properly adjusting these components might enable efficient data handling and responsiveness in your applications
17.1. IO Subsystem configuration
The io
subsystem defines the XNIO workers and buffer pools used by other subsystems, such as Undertow and Remoting.
These workers and buffer pools are defined in the io
subsystem by using the following CLI commands:
/subsystem=io/worker=* /subsystem=io/buffer-pool=*
This configuration represents the default setup for the io
subsystem. To view the default configuration of the io
subsystem, run the following CLI command:
/subsystem=io/:read-resource(recursive=true)
17.2. Configuring a worker
You can configure a worker in JBoss EAP to efficiently manage IO tasks and worker threads. Workers serve as XNIO worker instances, providing an abstraction layer for the Java NIO APIs and supporting SSL.
Workers are responsible for managing IO operations, coordinating tasks, and ensuring that requests for sending and receiving data are processed efficiently. These tasks are handled by a set of threads maintained in an IO thread pool.
By default, JBoss EAP includes a single worker named default
. You can define additional workers if required. When creating more than one worker, be aware that each additional worker results in a separate IO thread pool, which can impact resource utilization.
When no thread sizes are specified for a worker, JBoss EAP calculates the default values based on the number of available CPU cores. The configuration options are as follows:
-
io-threads
: Specify the number of IO threads to create for the worker. If not specified, the default is calculated ascpuCount * 2
. -
task-max-threads
: Specify the maximum number of threads for the worker task thread pool. If not specified, the default value is calculated ascpuCount * 16
.
You can manage workers through management CLI commands to update, create, or delete configurations.
Prerequisites
- JBoss EAP is running.
Procedure
Update an existing worker by using the following command:
/subsystem=io/worker=default:write-attribute(name=io-threads,value=10)
Reload the server to apply the changes by using the following command:
reload
Create a new worker by using the following command:
/subsystem=io/worker=newWorker:add
If needed, you can delete a worker by using the following command:
/subsystem=io/worker=newWorker:remove
Reload the server to apply the changes by using the following command:
reload
Additional resources
17.3. Configuring a buffer pool
You can configure a buffer pool in JBoss EAP to manage pooled NIO buffer instances, which play a crucial role in application performance. You can update existing buffer pools, create new ones, and delete those no longer needed to optimize system efficiency.
IO buffer pools are deprecated but remain the default configuration in the current release. Buffer pools are pooled NIO buffer instances. Changing the buffer size significantly impacts application performance. For most servers, the ideal buffer size is typically 16k. For more information, see Configuring byte buffer Pool section of the Configuration Guide for JBoss EAP. For more information, see Add lightweight global buffer pool API; deprecate heavier API, which describes the deprecation of the earlier buffer pool API and its replacement with the Undertow subsystem buffer pool.
Prerequisites
- JBoss EAP is running.
Procedure
Update an existing buffer pool by using the following command:
/subsystem=io/buffer-pool=default:write-attribute(name=direct-buffers,value=true)
Reload the server to apply the changes by using the following command:
reload
Create a new buffer pool by using the following command:
/subsystem=io/buffer-pool=newBuffer:add
If needed, you can delete a buffer pool by using the following command:
/subsystem=io/buffer-pool=newBuffer:remove
Reload the server to apply the changes by using the following command:
reload
Additional resources
17.4. IO subsystem performance tuning
You can optimize and monitor the performance of the io
subsystem to ensure efficient resource management and responsiveness. Regular monitoring helps identify potential issues before they affect system performance.
Additional resources
17.5. Configuring a Worker
Workers are XNIO worker instances. An XNIO worker instance is an abstraction layer for the Java NIO APIs, which provide functionality such as management of IO and worker threads as well as SSL support. By default, JBoss EAP provides single worker called default
, but more can be defined.
Updating an Existing Worker
To update an existing worker:
/subsystem=io/worker=default:write-attribute(name=io-threads,value=10)
reload
Creating a New Worker
To create a new worker:
/subsystem=io/worker=newWorker:add
Deleting a Worker
To delete a worker:
/subsystem=io/worker=newWorker:remove
reload
For a full list of the attributes available for configuring workers, please see the IO Subsystem Attributes section.
17.6. Configuring a Buffer Pool
IO buffer pools are deprecated, but they are still set as the default in the current release. Buffer pools are pooled NIO buffer instances. Changing the buffer size has a big impact on application performance. For most servers, the ideal buffer size is usually 16k. For more information about configuring Undertow byte buffer pools, see the Configuring Byte Buffer Pools section of the Configuration Guide for JBoss EAP.
Updating an Existing Buffer Pool
To update an existing buffer pool:
/subsystem=io/buffer-pool=default:write-attribute(name=direct-buffers,value=true)
reload
Creating a Buffer Pool
To create a new buffer pool:
/subsystem=io/buffer-pool=newBuffer:add
Deleting a Buffer Pool
To delete a buffer pool:
/subsystem=io/buffer-pool=newBuffer:remove
reload
For a full list of the attributes available for configuring buffer pools, please see the IO Subsystem Attributes section.
17.7. Tuning the IO Subsystem
For tips on monitoring and optimizing performance for the io
subsystem, see the IO Subsystem Tuning section of the Performance tuning for JBoss EAP.