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

Keycloak Dev Services startup optimization #42906

Closed
NicoGuilhem opened this issue Aug 30, 2024 · 9 comments
Closed

Keycloak Dev Services startup optimization #42906

NicoGuilhem opened this issue Aug 30, 2024 · 9 comments
Labels

Comments

@NicoGuilhem
Copy link

NicoGuilhem commented Aug 30, 2024

Description

Dev Services for Keycloak starts (by default) a container from quay.io/keycloak/keycloak.

This image is not optimized as it update configuration on each startup.

Container starting logs example
Changes detected in configuration. Updating the server image.
Updating the configuration and installing your custom providers, if any. Please wait.
2024-08-30 12:23:07,792 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 12844ms
Server configuration updated and persisted. Run the following command to review the configuration:

kc.sh show-config

Next time you run the server, just run:

kc.sh start --http-enabled=true --hostname-strict=false --spi-user-profile-declarative-user-profile-config-file=/opt/keycloak/upconfig.json --optimized

2024-08-30 12:23:14,659 INFO  [org.infinispan.CONTAINER] (ForkJoinPool.commonPool-worker-1) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2024-08-30 12:23:15,007 INFO  [org.infinispan.CLUSTER] (ForkJoinPool.commonPool-worker-1) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
2024-08-30 12:23:15,255 INFO  [org.infinispan.CLUSTER] (ForkJoinPool.commonPool-worker-1) ISPN000078: Starting JGroups channel `ISPN`
2024-08-30 12:23:15,258 INFO  [org.jgroups.JChannel] (ForkJoinPool.commonPool-worker-1) local_addr: 58123b8a-41c7-4b43-9a5a-73056b38d34d, name: 568fc1c31121-26637
2024-08-30 12:23:15,268 WARN  [org.jgroups.protocols.UDP] (ForkJoinPool.commonPool-worker-1) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2024-08-30 12:23:15,268 WARN  [org.jgroups.protocols.UDP] (ForkJoinPool.commonPool-worker-1) JGRP000015: the receive buffer of socket MulticastSocket was set to 20MB, but the OS only allocated 212.99KB
2024-08-30 12:23:15,269 WARN  [org.jgroups.protocols.UDP] (ForkJoinPool.commonPool-worker-1) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2024-08-30 12:23:15,270 WARN  [org.jgroups.protocols.UDP] (ForkJoinPool.commonPool-worker-1) JGRP000015: the receive buffer of socket MulticastSocket was set to 25MB, but the OS only allocated 212.99KB
2024-08-30 12:23:15,281 INFO  [org.jgroups.protocols.FD_SOCK2] (ForkJoinPool.commonPool-worker-1) server listening on *.41615
2024-08-30 12:23:17,287 INFO  [org.jgroups.protocols.pbcast.GMS] (ForkJoinPool.commonPool-worker-1) 568fc1c31121-26637: no members discovered after 2003 ms: creating cluster as coordinator
2024-08-30 12:23:17,307 INFO  [org.infinispan.CLUSTER] (ForkJoinPool.commonPool-worker-1) ISPN000094: Received new cluster view for channel ISPN: [568fc1c31121-26637|0] (1) [568fc1c31121-26637]
2024-08-30 12:23:17,359 INFO  [org.infinispan.CLUSTER] (ForkJoinPool.commonPool-worker-1) ISPN000079: Channel `ISPN` local address is `568fc1c31121-26637`, physical addresses are `[172.17.0.4:57151]`
2024-08-30 12:23:18,104 INFO  [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Initializing database schema. Using changelog META-INF/jpa-changelog-master.xml

UPDATE SUMMARY
Run:                        133
Previously run:               0
Filtered out:                 0
-------------------------------
Total change sets:          133

2024-08-30 12:23:21,634 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: 568fc1c31121-26637, Site name: null
2024-08-30 12:23:21,764 INFO  [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
2024-08-30 12:23:21,842 INFO  [org.keycloak.services] (main) KC-SERVICES0050: Initializing master realm
2024-08-30 12:23:24,397 INFO  [org.keycloak.services] (main) KC-SERVICES0009: Added user 'admin' to realm 'master'
2024-08-30 12:23:24,511 INFO  [io.quarkus] (main) Keycloak 25.0.0 on JVM (powered by Quarkus 3.8.5) started in 16.578s. Listening on: http://0.0.0.0:8080. Management interface listening on http://0.0.0.0:9000.
2024-08-30 12:23:24,512 INFO  [io.quarkus] (main) Profile prod activated. 
2024-08-30 12:23:24,512 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, keycloak, logging-gelf, narayana-jta, reactive-routes, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]
2024-08-30 12:23:38,933 ERROR [org.keycloak.events.EventBuilder] (executor-thread-1) Event listener 'metrics-listener' registered, but provider not found

Is there a way to optimize default startup according to keycloak documentation (without setting a specific image) ?

Implementation ideas

No response

Copy link

quarkus-bot bot commented Aug 30, 2024

/cc @geoand (devservices), @pedroigor (keycloak), @sberyozkin (keycloak), @stuartwdouglas (devservices)

@sberyozkin
Copy link
Member

sberyozkin commented Aug 30, 2024

Hi @NicoGuilhem It probably better be re-qualified as a question.

@sberyozkin sberyozkin added kind/question Further information is requested and removed kind/enhancement New feature or request labels Aug 30, 2024
@sberyozkin
Copy link
Member

sberyozkin commented Aug 30, 2024

@NicoGuilhem

Is there a way to optimize default startup according to keycloak documentation (without setting a specific image) ?

I think it is the only option, create a simple custom image with whatever optimizations expected as per the docs and then refer to it with the image-name property.

See also #41833, you can try to experiment with the default start up command.

Does it clarify it for you ?

@NicoGuilhem
Copy link
Author

@sberyozkin

Does it clarify it for you ?

Yes it's clear. Thank you for your answer.

Would it be possible to change default image to an "official" image already optmizied (built by Keycloak team ? or Quarkus Team ?) ?

@gsmet
Copy link
Member

gsmet commented Aug 30, 2024

I think this is a question for the Keycloak team really, we are just consuming the image.

@sberyozkin
Copy link
Member

@NicoGuilhem

Would it be possible to change default image to an "official" image already optmizied (built by Keycloak team ? or Quarkus Team ?) ?

quay.io/keycloak/keycloak images are official Keycloak images. And I don't think we can prepare and manage customized Keycloak images upstream here in the Quarkus project.

@geoand
Copy link
Contributor

geoand commented Aug 31, 2024

I'm going to close this as per the previous discussion

@geoand geoand closed this as completed Aug 31, 2024
@NicoGuilhem
Copy link
Author

Thanks for the informations :)

@NicoGuilhem
Copy link
Author

I think this is a question for the Keycloak team really, we are just consuming the image.

Started a discussion to keycloak team : keycloak/keycloak#32567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants