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

When some kind of resource has great quantity, the sql will be rather slow #488

Open
panpan0000 opened this issue Jan 31, 2023 · 2 comments
Labels
kind/bug Something isn't working

Comments

@panpan0000
Copy link
Contributor

What happened?

the k8s api-server event amount is very large(> 40000). it cause the table content is big.

then the normal sql which required owner refernece is very slow.

What did you expect to happen?

some better architecture to refine this.

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

in kpanda (DCE5.0 code), clusterpedia managers openshift (with large events), then the sql to find pods list which belongs to a deployment, will be very slow.

Anything else we need to know?

DCE5 issue tracker( private network): https://gitlab.daocloud.cn/ndx/engineering/kpanda/-/issues/1880

Clusterpedia Version

latest

Host Kubernetes version

1.24

@panpan0000 panpan0000 added the kind/bug Something isn't working label Jan 31, 2023
@clusterpedia-bot
Copy link

Hi @panpan0000,
Thanks for opening an issue!
We will look into it as soon as possible.

Details

Instructions for interacting with me using comments are available here.
If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

@panpan0000
Copy link
Contributor Author

per lizhongjun , previous ,in large event database ,
the sql select which parses json structure is slow.
but below sql without unstruct data query is also slow :


SELECT `object` FROM `resources` WHERE `group` = '' AND `resource` = 'pods' AND `version` = 'v1' AND cluster = 'on-premise' AND namespace = 'default' AND owner_uid IN (SELECT `uid` FROM `resources` WHERE `cluster` = 'on-premise' AND owner_uid IN (SELECT `uid` FROM `resources` WHERE `cluster` = 'on-premise' AND namespace IN ('default','') AND name = 'nginx-002')) ORDER BY created_at DESC LIMIT 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants