Reputation: 1048
For testing purposes, I want to run multiple instances of Hazelcast on a single node. Hazelcast assumes that it is managing the entire node, and therefore it creates a large enough number of threads to fully (in fact, over) load all the cores. On my 8-core Linux node, Hazelcast creates 74 threads per instance, which quickly runs up against the user thread limit. (Yes, I know this can be changed with ulimit
.)
From jconsole threads view:
Some of the thread counts can be reduced by setting Hazelcast system properties:
hazelcast.operation.generic.thread.count
hazelcast.operation.thread.count
hazelcast.io.thread.count
hazelcast.event.thread.count
The default numbers of wan, generic-operation and partition-operation threads are all 2 x CPU core count. There doesn't appear to be any way to reduce the number of wan threads.
Is there a way to specify how many cores Hazelcast should use, rather than specifying generic-operation.thread
and partition-operation.thread
separately? Setting CPU affinity doesn't work, as Hazelcast still thinks it has access to all the cores.
Is there any way to change the number of WAN replication threads?
Upvotes: 3
Views: 3248
Reputation: 11402
For Hazelcast 3.4 by default the partition operation thread count will be 1x core-count.
There is no option to configure number of operation threads apart from these properties.
AFAIK it isn't possible to change the number of wan replication threads since it is hardcoded to: ExecutorConfig.DEFAULT_POOL_SIZE.
A thread that doesn't do anything, it very cheap. The OS scheduler doesn't schedule it; just needs to track data.
Upvotes: 1