charts icon indicating copy to clipboard operation
charts copied to clipboard

Documentation on heapSize is incorrect

Open JVMartin opened this issue 1 year ago • 2 comments

In the documentation, it states:

This chart will automatically calculate Java heap size from given resources.requests.memory value. If you want to specify number of heap size, you can set graylog.heapSize to your desired value. The graylog.heapSize value must be in JVM -Xmx format.

So, we all incorrectly assumed this meant that if we do not specify a graylog.heapSize in our values, it will default to our resources.requests.memory value, which we are specifying like so in our values file:

graylog:
  replicas: 2
  resources:
    requests:
      cpu: "1000m"
      memory: "7Gi"
    limits:
      memory: "9Gi"

To my surprise, I saw Graylog regularly consuming > 13GB of memory. It turns out, the documentation is incorrect, because 16g is hard-coded to the default values here: https://github.com/KongZ/charts/blob/0c8a9a4c70eaec3a68e7f007e075d8666290805c/charts/graylog/values.yaml#L369-L372

And so this if condition is used: https://github.com/KongZ/charts/blob/0c8a9a4c70eaec3a68e7f007e075d8666290805c/charts/graylog/templates/statefulset.yaml#L111-L115

We had to explicitly add heapSize to our values file:

heapSize: "7g"

In order to get Graylog to stop consuming so much memory.

By the way, love the chart, thank you for it! :pray:

JVMartin avatar Nov 15 '24 21:11 JVMartin

Thank you for pointing this out. The document is surely not accurate. Since Graylog 5 upgrades to Java 17 the option -XX:+UseContainerSupport has been added. This option will let JVM determine the heap size from given memory resources on Pod.

To use this option, it needs to remove heapSize from values. I will update the document and add more explanation about this option. 

KongZ avatar Nov 22 '24 16:11 KongZ