Details
-
Story
-
Resolution: Done
-
Major
-
1.8.4.GA
-
None
-
False
-
False
Description
- Set appropriate default DYNAMIC_HEAP_FRACTION value to avoid OOM error
- The default DYNAMIC_HEAP_FRACTION values of KakfaConnect, MirrorMaker and CruiseControl are 1.0(=100%)[1], however this seems dangerous default value.
- DYNAMIC_HEAP_FRACTION=1.0 means that the entire memory of the container is specified as the heap size if -Xmx is not specified, but it will lead to frequent OOM errors, because JVM use metaspace, code cache and threads, etc. as non-heap memory and the container will also be using memory for outside of the JVM.
- The workawound is to set -Xmx and -Xms in jvmOptions explicitly.
- Also, it should be documented on our document that the default heap allocation rate for each component by DYNAMIC_HEAP_FRACTION when -Xmx -in jvmOptions is not specified ( Kafka=0.5(=50%), Zookeeper=0.75(=75%), KakfaConnect=1.0(=100%), MirrorMaker=1.0(=100%), CruiseControl=1.0(=100%) [1] ). In general, if -Xmx is not specified, it is assumed that 25% of the container memory will be used for the heap, so changing the default heap size by cluster operator is counter-intuitive at first glance and should be documented.
- FYI, there are some cases of frequent OOM errors on MirorrMaker2. I haven't fully tested it, but I was able to avoid it by increasing the memory resources of the MirorrMaker2 container and setting -Xms and -Xmx explicitly.
[1] https://github.com/strimzi/strimzi-kafka-operator/search?q=heapOptions
Attachments
Issue Links
- is related to
-
ENTMQST-3779 [DOC OCP] Kafka's default heap size (-Xmx) should be 22% of the memory request
- Closed