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

Reduce number of session queries to DB (Performance) #1428

Closed
yuriyz opened this issue Jul 30, 2020 · 1 comment
Closed

Reduce number of session queries to DB (Performance) #1428

yuriyz opened this issue Jul 30, 2020 · 1 comment
Assignees
Labels
enhancement libs update, re-factroring, etc.
Milestone

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Jul 30, 2020

Describe the issue

We got more queries to persistence then we had in 4.1.1. One of the reason is device flow. We have to optimize it and not query object which is already in memory.

Before login form:
1. AuthorizeRestWebServiceImpl -> String deviceAuthzUserCode = deviceAuthorizationService.getUserCodeFromSession(httpRequest);
Login form:
1. Authenticator -> ... final SessionId sessionId = sessionIdService.getSessionId(servletRequest)
2. Authenticator -> self.userAuthenticationInteractive() -> ...  lastResult = authenticateImpl(servletRequest, true, false, false);
3. Authenticator -> ExternalAuthenvticationService -> AuthenticationService.setAuthenticatedUserSessionAttribute -> .... SessionId sessionId = sessionIdService.getSessionId();
4. Authenticator -> ExternalAuthenvticationService -> AuthenticationService.setAuthenticatedUserSessionAttribute -> .... SessionId sessionId = sessionIdService.getSessionId();
5. Authenticator -> self.userAuthenticationInteractive() -> ...  sessionId = sessionIdService.getSessionId();

6. Authenticator -> AuthenticationService.configureSessionUser()-> SessionId newSessionId = sessionIdService.setSessionIdStateAuthenticated(getHttpRequest(), getHttpResponse(), sessionId, user.getDn());

7.8.9: AuthorizeAction
10.11: AuthenticationFilter
12: AuthorizeRestWebServiceImpl -> String deviceAuthzUserCode = deviceAuthorizationService.getUserCodeFromSession(httpRequest);
13: TokenRestWebServiceImpl
@yuriyz yuriyz added the enhancement libs update, re-factroring, etc. label Jul 30, 2020
@yuriyz yuriyz added this to the 4.2.1 milestone Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
yuriyz added a commit that referenced this issue Jul 30, 2020
@yuriyz
Copy link
Contributor Author

yuriyz commented Jul 31, 2020

Done, also added local in-memory cache to SessionIdService.

@yuriyz yuriyz closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement libs update, re-factroring, etc.
Projects
None yet
Development

No branches or pull requests

2 participants