Repository navigation
possible to set a container memory limit to 512MB? #37184
Unanswered
f1-outsourcing
asked this question in
Q&A
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am currently testing a bit with keycloak. I was launching the container with 512MB, however after the login it was oom killed. So currently I am running with 1024MB and added these options to the environment (not even sure if these are used, or do these need to be put in JAVA_OPTS_KC_HEAP)
"JAVA_OPTS_ADD": "-XX:MaxRAM=800m -XX:+UseSerialGC"
I read a bit about this quarkus about how efficient it should be, so I thought I should be able to run this easily with 512MB memory limit. Test environment has only 15 - 100 ldap users.
https://www.keycloak.org/server/containers
All reactions
Replies: 2 comments · 2 replies
Uh oh!
There was an error while loading. Please reload this page.
"JAVA_OPTS_KC_HEAP": "-XX:MaxHeapFreeRatio=30 -XX:MaxRAMPercentage=65" with 512MB limit also generates oom directly after the login
All reactions
Uh oh!
There was an error while loading. Please reload this page.
That is not a property known to kc.sh. See the handling in kc.sh: https://github.com/keycloak/keycloak/blob/822eb4471d68d09bad89d70cc71f33db59932021/quarkus/dist/src/main/content/bin/kc.sh#L102C14-L102C31
Quarkus is - especially in native mode, but that is still in the works with Keycloak.
See https://www.keycloak.org/high-availability/concepts-memory-and-cpu-sizing for general recommendations on memory sizing.
Trying to get to 512MB container limit with the default of 70 MaxRamPercentage or an override to 65 is aggressive. If you want to see how low you can go, then you'll also need to take heap dumps when the OOM occurs to see what is actually holding memory and if there is some additional tuning that can be used to prevent that.
All reactions
Uh oh!
There was an error while loading. Please reload this page.
Did you figure out how to run it with 512MB?
All reactions
Uh oh!
There was an error while loading. Please reload this page.
I did not test with keycloak, but I am building all containers with bell/alpine and some other I have running with 512 with these:
"JAVA_OPTS_ADD": "-XX:MaxJavaStackTraceDepth=1 -XX:MaxRAM=400m -XX:+UseSerialGC"All reactions