KusionStack / karpor

Intelligence for Kubernetes. World's most promising Kubernetes Visualization Tool for Developer and Platform Engineering teams.
https://karpor-demo.kusionstack.io
Apache License 2.0
442 stars 45 forks source link

Performance Issue: Cluster Management audit/score/topology api response timeout #569

Open CirillaQL opened 1 month ago

CirillaQL commented 1 month ago

What happened?

I tried to check information about my cluster in Cluster Management, but the audit, score, and topology responses timed out. 微信截图_20240801144709 微信截图_20240801144721

What did you expect to happen?

apis response successfully

How can we reproduce it (as minimally and precisely as possible)?

import a large Kubernetes cluster and enter into cluster management.

Anything else we need to know?

I use Postman to get api, topology api use 43.5s and audit api use 38.5s, maybe find some ways to fix this performance issue. 微信截图_20240801145638 微信截图_20240801145924 And this is my cluster size: 微信截图_20240801145948

Karpor version

v0.4.4 ```console $ karpor -V # paste output here ```

OS version

```console # On Linux: $ cat /etc/os-release # paste output here $ uname -a # paste output here alpine Docker # On Windows: C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture # paste output here ```

Install tools

Helm Chart
elliotxx commented 1 month ago

@CirillaQL Thanks for feedback, what you said looks like a performance problem. Usually, the first execution of the audit api will scan all resources in the set cluster. The calculation result will record in the cache, but this will cause the first time to open the page too slowly when there are more resources, which is indeed a problem.

I think I can optimize performance at this point:

Do you have any ideas?