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

[Application config] Usage and performance optimization #6300

Closed
SuZhou-Joe opened this issue Apr 1, 2024 · 8 comments · Fixed by #5855 or #6364
Closed

[Application config] Usage and performance optimization #6300

SuZhou-Joe opened this issue Apr 1, 2024 · 8 comments · Fixed by #5855 or #6364
Assignees
Labels
enhancement New feature or request performance Make it fast! v2.14.0

Comments

@SuZhou-Joe
Copy link
Member

SuZhou-Joe commented Apr 1, 2024

Is your feature request related to a problem? Please describe.

Issue 1: required parameters for getConfigurationClient function

The getConfigurationClient method requires a scopedClusterClient to return the applicationConfigClient, but applicationConfig is supposed to be a generic config interface, which should not be related to opensearch.

Issue 2: Performance concern on application config

The applicationClient.get is a async method which will fetch the doc inside .opensearch-config index. workspace or other plugins will leverage this service to get the dynamic application settings. In order to get latest config, plugins will call the function every time when there is a incoming request to handle, which may introduce a huge workload to the target storage.

Describe the solution you'd like

required parameters for getConfigurationClient function

Change the required param to request: OpensearchDashboardRequest and construct the scopedClusterClient within OpenSearchConfigurationClient so that the implementation of the ConfigurationClient will be totally transparent to other plugins.

Performance concern on application config

Add cache within application config. As for normal user case, user can only mutate the config through application.updateEntityConfig method, we can add a cache in memory to reduce the unnecessary call to the real storage service.

Describe alternatives you've considered

N/A

Additional context

#5855

@SuZhou-Joe SuZhou-Joe added the enhancement New feature or request label Apr 1, 2024
@SuZhou-Joe
Copy link
Member Author

@tianleh Would you like to take a look as you were the author of the related PR? cc @seraphjiang

@tianleh
Copy link
Member

tianleh commented Apr 1, 2024

@tianleh Would you like to take a look as you were the author of the related PR? cc @seraphjiang

checking

@kavilla kavilla removed the untriaged label Apr 2, 2024
@kavilla kavilla linked a pull request Apr 2, 2024 that will close this issue
7 tasks
@kavilla kavilla added performance Make it fast! v2.14.0 labels Apr 2, 2024
@kavilla
Copy link
Member

kavilla commented Apr 2, 2024

+1 @SuZhou-Joe,

@tianleh. I think this should be a prioritization maybe even worth a patch for 2.13. If anyone is using this already.

As @SuZhou-Joe said I think we can utilize the storage service (which basically saves it it to local storage). If local storage does not contain the expect key then do the call dynamic app config. On app load we can do the update regardless and then subsequent requests will pull from local storage.

@SuZhou-Joe
Copy link
Member Author

@kavilla Yes, for browser side we can do that but as the application config is a service for server side, I suppose we need to figure out a way to cache in server side as well.

@tianleh
Copy link
Member

tianleh commented Apr 4, 2024

Created a RFC for the performance concern #6341

Please review the proposal in the RFC

@seraphjiang
Copy link
Member

Issue 1: required parameters for getConfigurationClient function

how about this? could we have quick fix ?

@tianleh
Copy link
Member

tianleh commented Apr 8, 2024

how about this? could we have quick fix ?

It was implemented in such way to leverage the scoped client for permission check. I will run some experiments of the suggestion to construct the scopedClusterClient within OpenSearchConfigurationClient.

@tianleh
Copy link
Member

tianleh commented Apr 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Make it fast! v2.14.0
Projects
None yet
4 participants