It attempts to detect and fix a selector imbalance problem.
By default Hazelcast uses 3 threads to read data from TCP connections and
3 threads to write data to connections. We have measured significant fluctuations
of performance when the threads are not utilized equally.
IOBalancer
tries to detect such situations and fix them by moving
NioInboundPipeline
and
NioOutboundPipeline
between
NioThread
instances.
It measures number of events serviced by each pipeline in a given interval and
if imbalance is detected then it schedules pipeline migration to fix the situation.
The exact migration strategy can be customized via
MigrationStrategy
.
Measuring interval can be customized via
GroupProperty.IO_BALANCER_INTERVAL_SECONDS
It doesn't leverage
ConnectionListener
capability
provided by
ConnectionManager
to observe connections
as it has to be notified right after a physical TCP connection is created whilst
ConnectionListener
is notified only after a successful (Hazelcast)
binding process.