Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate keycloak_quarkus_java_opts (Xms Xmx) used #185

Closed
roumano opened this issue Apr 8, 2024 · 1 comment · Fixed by #186
Closed

duplicate keycloak_quarkus_java_opts (Xms Xmx) used #185

roumano opened this issue Apr 8, 2024 · 1 comment · Fixed by #186
Labels
bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements

Comments

@roumano
Copy link

roumano commented Apr 8, 2024

SUMMARY

We can change the variable keycloak_quarkus_java_opts for java memory (the default value is -Xms1024m -Xmx2048m )

It's used in the templates/keycloak-sysconfig.j2 so the service is start with this option.

Sadly, it's also existing a Xms & Xmx attribut harcoded in the kc.sh as your can see :

grep Xms /opt/keycloak/keycloak-24.0.1/bin/kc.sh 
         JAVA_OPTS_KC_HEAP="$JAVA_OPTS_KC_HEAP -Xms64m -Xmx512m"

So, when start the keycloak service, it's using both argument .

Please found the full command used to start the service :

/etc/alternatives/jre_17/bin/java -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.err.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 -XX:+ExitOnOutOfMemoryError -Djava.security.egd=file:/dev/urandom -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:FlightRecorderOptions=stackdepth=512 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Xms64m -Xmx512m --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED -Xms1024m -Xmx2048m -Dkc.home.dir=/opt/keycloak/keycloak-24.0.1/bin/.. -Djboss.server.config.dir=/opt/keycloak/keycloak-24.0.1/bin/../conf -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dpicocli.disable.closures=true -Dquarkus-log-max-startup-records=10000 -cp /opt/keycloak/keycloak-24.0.1/bin/../lib/quarkus-run.jar io.quarkus.bootstrap.runner.QuarkusEntryPoint start --optimized --proxy-headers xforwarded
ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible [core 2.14.9]

COLLECTION VERSION
middleware_automation.keycloak 2.1.0  
STEPS TO REPRODUCE
  • Deploy keycloak quarkus with this role with any (don't care) attribut
  • See the command used to start keyclock (ps -ef -wwww | grep keycloak)
ps -ef -wwww | grep [k]eycloak
keycloak   34089       1  0 Mar28 ?        00:42:14 /etc/alternatives/jre_17/bin/java -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.err.encoding=UTF-8 -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 -XX:+ExitOnOutOfMemoryError -Djava.security.egd=file:/dev/urandom -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:FlightRecorderOptions=stackdepth=512 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -Xms64m -Xmx512m --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED -Xms1024m -Xmx2048m -Dkc.home.dir=/opt/keycloak/keycloak-24.0.1/bin/.. -Djboss.server.config.dir=/opt/keycloak/keycloak-24.0.1/bin/../conf -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dpicocli.disable.closures=true -Dquarkus-log-max-startup-records=10000 -cp /opt/keycloak/keycloak-24.0.1/bin/../lib/quarkus-run.jar io.quarkus.bootstrap.runner.QuarkusEntryPoint start --optimized
EXPECTED RESULTS

a unique Xms & Xmx arguement on the started service

/etc/alternatives/jre_17/bin/java ... ... -Xms1024m -Xmx2048m ... ...
ACTUAL RESULTS
/etc/alternatives/jre_17/bin/java ... ... -Xms64m -Xmx512m  ... ... -Xms1024m -Xmx2048m ... ...
@guidograzioli guidograzioli added the bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements label Apr 8, 2024
@guidograzioli
Copy link
Member

guidograzioli commented Apr 8, 2024

Reproed; heap settings go in envvar JAVA_OPTS_KC_HEAP not JAVA_OPTS_APPEND

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfixes Fixes that resolve issues. SHOULD not be used for minor enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants