Skip to content

Commit

Permalink
[Synthetics] Improve overview page performance !! (#201275)
Browse files Browse the repository at this point in the history
## Summary

Improve overview page performance !!

Right now UI works for few hundred to 1000 monitors, but it starts
degrading after that, this PR makes sure, we refactor queries in such a
way that it scale up to 10k-20k monitors easily.


### Queries before
Before this PR, we were doing 2 steps queries, first fetch all saved
objects and the fetch all summary documents by passings all ids from
first phase. This meant that let's say if we have 20k saved objects,
first we will need to page through all of them to even start fetching
summaries. To fetch summary documents, we were using `top_hits` query
which can be memory expensive.


### Queries now
In this PR we fetch summaries and saved objects in parallel, since we
have space id on documents as well, there was no need to do 2 step
queries. Now we fetch both things in parallel and then we hydrate saved
object data from summary data. In this PR now we are using top_metrics
query to fetch each monitor status instead of `top_hits`


I tested on about 20k monitors, app performs reasoably well after the PR
<img width="1920" alt="image"
src="https://github.com/user-attachments/assets/c143e196-59a4-45b4-86b7-bd22ac4c5d4b">


On a very slow cluster on which kibana is local against a remote cluster

### After
<img width="1920" alt="image"
src="https://github.com/user-attachments/assets/540d0cdf-2f8c-44d1-af76-81953d9ca0ff">


### Before
<img width="1918" alt="image"
src="https://github.com/user-attachments/assets/5fdc314d-bb59-4137-9397-d8aee6bd4806">

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
shahzad31 and kibanamachine authored Dec 11, 2024
1 parent 52ee949 commit b4ccb0c
Show file tree
Hide file tree
Showing 12 changed files with 1,329 additions and 1,813 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,7 @@ const commons = {
},
},
},
meta: {
space_id: 'default',
},
};

This file was deleted.

Loading

0 comments on commit b4ccb0c

Please sign in to comment.