Skip to content

OIDC slows down application startup time in native mode #15831

Open
@igor-dmitriev

Description

Description

We are using Quarkus with GraalVM native-image which is deployed to AWS Lambda, we noticed significant performance loss when we added io.quarkus:quarkus-oidc dependency.
It is needed to have Auth0 integration.

implementation 'io.quarkus:quarkus-oidc'

quarkusPlatformVersion=1.12.2.Final

application.properties

quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss} | %X{userId} [%-5p] %c{1} - %m%n
quarkus.log.category."software.amazon.awssdk".level=WARN
quarkus.log.category."software.amazon.awssdk.request".level=DEBUG
quarkus.log.category."io.quarkus.bootstrap".level=WARN
quarkus.log.category."com.igor.repository".level=DEBUG

quarkus.oidc.enabled=false

quarkus.oidc.auth-server-url=${AUTH_SERVER_URL}
quarkus.oidc.client-id=${CLIENT_ID}

quarkus.http.auth.permission.default.paths=/*
quarkus.http.auth.permission.default.policy=permit

quarkus.http.auth.permission.swagger.paths=/openapi,/documentation/*,/branding/*
quarkus.http.auth.permission.swagger.policy=permit

quarkus.swagger-ui.title=API
quarkus.swagger-ui.theme=outline
quarkus.swagger-ui.path=/documentation

quarkus.http.cors=true
quarkus.http.cors.origins=*
quarkus.http.cors.headers=accept,authorization,content-type,x-requested-with
quarkus.http.cors.methods=GET,POST,PUT,PATCH,DELETE,OPTIONS

quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=${JDBC_LOGIN}
quarkus.datasource.password=${JDBC_PASSWORD}
quarkus.datasource.jdbc.url=${JDBC_URL}
quarkus.mybatis.map-underscore-to-camel-case=true

quarkus.native.additional-build-args=--report-unsupported-elements-at-runtime

This is how it works without oidc:

oidc disabled

as you may see start-up time is 0.2 seconds

and this is how it works with oidc:

oidc enabled

We tested it multiple times
+0.5 seconds in average

Implementation ideas

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions