bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.26k stars 4.75k forks source link

[bitnami/zookeeper] Cannot effectively use `(Initial|Min|Max)RAMPercentage` cgrups aware java args in zookeeper container #20542

Closed kchaber closed 4 days ago

kchaber commented 1 year ago

Name and Version

bitnami/zookeeper:latest (3.8-debian-11)

What steps will reproduce the bug?

We cannot effectively use (Initial|Min|Max)RAMPercentage java arguments as zookeeper container always requires and adds fixed heap size via -Xmx, -Xms arguments.

The validation is done in the below function inside scripts/libzookeeper.sh:

zookeeper_configure_heap_size() {
    local -r heap_size="${1:?heap_size is required}"

    if [[ "$JVMFLAGS" =~ -Xm[xs].*-Xm[xs] ]]; then
        debug "Using specified values (JVMFLAGS=${JVMFLAGS})"
    else
        debug "Setting '-Xmx${heap_size}m -Xms${heap_size}m' heap options..."
        zookeeper_export_jvmflags "-Xmx${heap_size}m -Xms${heap_size}m"
    fi
}

What is the expected behavior?

Zookeeper container should not require the Xmx, Xms arguments to be provided in JVMFLAGS env variable.

What do you see instead?

(Initial|Min|Max)RAMPercentage should be used instead to dynamically allocate heap size based on container cgrups settings.

Additional information

No response

Mauraza commented 1 year ago

Hi @kchaber,

We are always open to a contribution, if you want you can create a PR with a change and we will be more than happy to review it

OneCricketeer commented 1 year ago

Depending on the JRE that's used, it should respect JAVA_TOOL_OPTIONS environment variable for arbitrary settings

Mauraza commented 1 year ago

Thanks @OneCricketeer for the comment, if @kchaber makes the contribution he should take it into account.

github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

jrsherry commented 1 month ago

Why was this issue closed? Seems that it's still a concern.

github-actions[bot] commented 1 week ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 4 days ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.