Reducing the number of Hazelcast streams

For testing purposes, I want to run multiple instances of Hazelcast on one node. Hazelcast assumes that it is running a whole node and therefore it creates a large enough number of threads to load all cores completely (in fact, more). On my 8-core Linux node Hazelcast creates 74 threads per instance, which quickly breaks the user thread limit. (Yes, I know this can be changed with ulimit

.)

From jconsole viewing themes:

  • hz.hzInstance_1_dev.scheduled
  • hz.hzInstance_1_dev.generic-operation.thread (x16)
  • hz.hzInstance_1_dev.partition-operation.thread (x16)
  • hz.hzInstance_1_dev.response
  • hz.hzInstance_1_dev.event (x5)
  • hz.hzInstance_1_dev.wait-notify
  • hz.hzInstance_1_dev.wan (x16)
  • hz.hzInstance_1_dev.cached.thread
  • hz.hzInstance_1_dev.migration
  • hz.hzInstance_1_dev.IO-thread-in (x3)
  • hz.hzInstance_1_dev.IO-thread-out (x3)
  • hz.hzInstance_1_dev.IO-thread-acceptor
  • hz.hzInstance_1_dev.cached-thread (x8)
  • hz.hzInstance_1_dev.HealthMonitor

Some of the flow counts can be reduced by setting the Hazelcast System Properties :

  • generic-operation.thread = hazelcast.operation.generic.thread.count

  • partition-operation.thread = hazelcast.operation.thread.count

  • IO-thread = hazelcast.io.thread.count

  • event = hazelcast.event.thread.count

By default, the wan, generic-operation and partition-operation thread numbers are 2 x CPU core count. There seems to be no way to reduce the number of wan threads.

Is there a way to specify how many cores Hazelcast should use, rather than separately specifying generic-operation.thread

and partition-operation.thread

? The processor proximity setting does not work as Hazelcast still thinks it has access to all cores.

Is there a way to change the number of WAN replication threads?

+3


source to share


1 answer


For Hazelcast 3.4, the default partition thread count will be 1 x core-count.

There is no way to adjust the number of workflows separately from these properties.



AFAIK it is not possible to change the number of wan replication threads as it is hardcoded: ExecutorConfig.DEFAULT_POOL_SIZE.

A thread that does nothing is very cheap. The OS scheduler does not schedule it; you just need to track the data.

+1


source







All Articles