Commit 061a265
authored
[Konflux] improve backend performance with targeted catalog lookups and response caching (#2630)
* fix(konflux): replace unfiltered catalog scan with targeted entity lookup
getRelatedEntities was calling catalog.getEntities() with no filter,
fetching the entire catalog on every request.
Now uses the parent entity's hasPart relations with
catalog.getEntitiesByRefs() to fetch only the needed subcomponents.
* perf(konflux): cache API clients and catalog lookups, strip managedFields
- Cache CustomObjectsApi instances per cluster instead of creating
new KubeConfig + client on every request. Auth headers are injected
per-request via middleware, so cached clients are safe to share.
- Add a 30s TTL cache for catalog entity/config/combination lookups
to avoid duplicate calls across parallel resource requests.
- Strip metadata.managedFields from K8s and Kubearchive responses
to reduce payload size (~50% reduction).
* perf(konflux): increase staleTime and disable refetchOnWindowFocus
Increase react-query staleTime from 30s to 5min and disable
refetchOnWindowFocus to reduce unnecessary re-fetches when
switching browser tabs.
* chore(konflux): add changesets
Add changesets with the changes made for both konflux and konflux-backend
plugins.
* fixup! perf(konflux): cache API clients and catalog lookups, strip managedFields
* fixup! perf(konflux): cache API clients and catalog lookups, strip managedFields1 parent a86326d commit 061a265
12 files changed
Lines changed: 270 additions & 91 deletions
File tree
- workspaces/konflux
- .changeset
- plugins
- konflux-backend/src
- helpers
- __tests__
- services
- __tests__
- konflux/src
- api
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | | - | |
273 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
| |||
502 | 508 | | |
503 | 509 | | |
504 | 510 | | |
505 | | - | |
506 | 511 | | |
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
510 | 515 | | |
511 | 516 | | |
512 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
513 | 523 | | |
514 | 524 | | |
515 | 525 | | |
| |||
519 | 529 | | |
520 | 530 | | |
521 | 531 | | |
522 | | - | |
| 532 | + | |
523 | 533 | | |
524 | 534 | | |
525 | 535 | | |
| |||
Lines changed: 63 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
Lines changed: 16 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | | - | |
59 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
Lines changed: 9 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 106 | | |
113 | 107 | | |
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
117 | | - | |
118 | | - | |
| 111 | + | |
| 112 | + | |
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
| |||
545 | 539 | | |
546 | 540 | | |
547 | 541 | | |
548 | | - | |
| 542 | + | |
549 | 543 | | |
550 | 544 | | |
551 | | - | |
| 545 | + | |
552 | 546 | | |
553 | 547 | | |
554 | 548 | | |
| |||
564 | 558 | | |
565 | 559 | | |
566 | 560 | | |
567 | | - | |
| 561 | + | |
568 | 562 | | |
569 | 563 | | |
570 | 564 | | |
| |||
586 | 580 | | |
587 | 581 | | |
588 | 582 | | |
589 | | - | |
| 583 | + | |
590 | 584 | | |
591 | 585 | | |
592 | 586 | | |
| |||
602 | 596 | | |
603 | 597 | | |
604 | 598 | | |
605 | | - | |
| 599 | + | |
606 | 600 | | |
607 | 601 | | |
608 | 602 | | |
| |||
Lines changed: 8 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 124 | | |
130 | 125 | | |
131 | 126 | | |
| |||
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
139 | | - | |
| 133 | + | |
| 134 | + | |
140 | 135 | | |
141 | 136 | | |
142 | 137 | | |
| |||
174 | 169 | | |
175 | 170 | | |
176 | 171 | | |
177 | | - | |
| 172 | + | |
178 | 173 | | |
179 | 174 | | |
180 | 175 | | |
181 | | - | |
182 | 176 | | |
183 | 177 | | |
184 | 178 | | |
| |||
301 | 295 | | |
302 | 296 | | |
303 | 297 | | |
304 | | - | |
305 | | - | |
| 298 | + | |
306 | 299 | | |
| 300 | + | |
307 | 301 | | |
308 | | - | |
309 | 302 | | |
310 | 303 | | |
311 | 304 | | |
| |||
423 | 416 | | |
424 | 417 | | |
425 | 418 | | |
426 | | - | |
| 419 | + | |
427 | 420 | | |
428 | 421 | | |
429 | 422 | | |
| |||
0 commit comments