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

[FEATURE] Faster loading of dynamic integrations #1389

Closed
Swiddis opened this issue Jan 30, 2024 · 3 comments · Fixed by #1401
Closed

[FEATURE] Faster loading of dynamic integrations #1389

Swiddis opened this issue Jan 30, 2024 · 3 comments · Fixed by #1401
Labels
enhancement New feature or request integrations Used to denote items related to the Integrations project v2.12.0

Comments

@Swiddis
Copy link
Collaborator

Swiddis commented Jan 30, 2024

Is your feature request related to a problem?
For the dynamic catalog feature in #1381, integrations are loaded into the available integrations page from .kibana all at once (multiple times?), which involves sending the entire uploaded content over network repeatedly. This is less-than performant. This is an issue to address the performance issue from reading integrations.

What solution would you like?
I can think of a few potential bottlenecks, I'm not sure which is the real stopper (or how to profile it):

  • Integrations are pulled multiple times for different requests, we don't implement any caching. This can be fixed by adding a cache within OSD that stores integrations read from the index.
  • Assets are included entirely within integrations, making them take a lot of bandwidth. This is talked about in the separate issue [BUG] Integration assets restricted by OS 1MB upload limit #1388.
  • Integrations aren't paginated/filtered in the query, which means that OS might be sending a lot of data that isn't needed. This is harder to optimize without breaking integrations down further as part of the previous issue.

What alternatives have you considered?
See above. Some or all of these can be implemented to improve the speed. I've ordered them by how much I think each issue contributes, but I haven't done the profiling to back those assumptions up.

Do you have any additional context?
N/A

@Swiddis Swiddis added enhancement New feature or request untriaged integrations Used to denote items related to the Integrations project and removed untriaged labels Jan 30, 2024
@Swiddis
Copy link
Collaborator Author

Swiddis commented Feb 1, 2024

Threw together a quick benchmark of the starting state and ran it locally. Gist. On my hardware (n=50):

Response Time Statistics:
Min: 0.23 seconds
Median: 0.25 seconds
Average: 0.25 seconds
Max: 0.3 seconds

If I disable index reading entirely:

Response Time Statistics:
Min: 0.0 seconds
Median: 0.01 seconds
Average: 0.01 seconds
Max: 0.02 seconds

Going to mess with optimization now.

@Swiddis
Copy link
Collaborator Author

Swiddis commented Feb 1, 2024

Adding a flat in-memory cache of SerializedIntegration[]:

Response Time Statistics:
Min: 0.05 seconds
Median: 0.06 seconds
Average: 0.06 seconds
Max: 0.08 seconds

Adding an in-memory cache partitioned by integration name Map<string, SerializedIntegration[]>:

Response Time Statistics:
Min: 0.0 seconds
Median: 0.01 seconds
Average: 0.01 seconds
Max: 0.01 seconds

Seems like almost all of the performance can be solved by avoiding unnecessary repeated list iteration. Will see what I can do for a PR.

@Swiddis
Copy link
Collaborator Author

Swiddis commented Feb 1, 2024

No caching but optimized network calls (seen here):

Response Time Statistics:
Min: 0.04 seconds
Median: 0.05 seconds
Average: 0.06 seconds
Max: 0.1 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request integrations Used to denote items related to the Integrations project v2.12.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant