-
Notifications
You must be signed in to change notification settings - Fork 306
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
FISH-1315 Improve loading time for REST application when there are many password aliases #5177 #5200
Conversation
jenkins test please |
This is not really a comment on this PR as I understand what it is achieving but the fact that OpenAPI is loading all ConfigProperties at boot is a bug in itself as this could have a big performance impact on many ConfigSources and some people will want both OpenAPI and a slow config source or a source with many keys. |
@smillidge, I think you are right. I was trying to find a solution to my problem, but probably some people need both OpenAPI and slow config sources. It seems that OpenAPIConfiguration only needs several properties (mp.openapi.model.reader, mp.openapi.filter, mp.openapi.scan.lib, mp.openapi.scan.disable, mp.openapi.scan.packages, mp.openapi.scan.classes, mp.openapi.scan.exclude.packages, mp.openapi.scan.exclude.classes, mp.openapi.servers, mp.openapi.servers.path.* , mp.openapi.servers.operation.* and mp.openapi.schema.*) I'm newbie in Microprofile and OpenAPI, so I ignore if these properties can be stored in a concrete config source or can be stored anywhere. If it can be stored anywhere, I can't think of any way to extract those properties without first reading all the config sources. |
If OpenAPI is just looking for specific properties. That isn't of itself a bug, if it is loading all properties that would be. The Password Alias config source probably needs a review to ensure it is performant. |
I've reviewed the password alias config source:
|
@smillidge, I think the problem is similar to #5187 |
jenkins test please |
.../src/main/java/fish/payara/nucleus/microprofile/config/source/PasswordAliasConfigSource.java
Outdated
Show resolved
Hide resolved
.../src/main/java/fish/payara/nucleus/microprofile/config/source/PasswordAliasConfigSource.java
Outdated
Show resolved
Hide resolved
@AngelTG2 I figured it would be easier to change myself than to explain :) Let me know if you are ok with this. |
jenkins test |
@lprimak. Perfect. I also think it will be faster that way. Thank you |
Jenkins test |
FISH-1315 Improve loading time for REST application when there are many password aliases payara#5177
FISH-1315 Improve loading time for REST application when there are many password aliases payara#5177
ISSUE 5177 - Load of REST application is very slow (120 seconds) when there are many password aliases created
Description
This is a fix for the issue #5177
Load of REST application is very slow (120 seconds) when there are many password aliases created.
In this situation (800 password aliases), the cause of this slowness is that Microprofile OpenAPI reads the Microprofile Config when register an application in OpenAPI. PasswordAlias is a config source and it's necessary to read the keystore that is a taxing process if there are many password aliases.
One possible solution to resolve this issue is disable OpenAPI, but disabling OpenAPI seems that only affect to publish /openapi url. OpenAPI service is started even if OpenAPI is disabled and always register the application causing the slowness.
In this PR I've changed the registerApp method of OpenService class to prepare the document only if OpenAPI is enabled. With this modification, instead of taking 130 seconds to load an application it only takes less than 6.
Instead of modifying OpenAPIService class, the OpenApiApplicationContainer class could have been modified to avoid calling OpenApiService, but I thought it could have other side effects.
Important Info
Blockers
Testing
New tests
Testing Performed
Testing Environment
Documentation
Notes for Reviewers