-
Notifications
You must be signed in to change notification settings - Fork 13
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
Slow SQLite query in kine #82
Comments
Thank you for reporting this @miro-balaz . I think we should start with a test in [1] that would expose/reproduce this behavior. There is a make rule to trigger the dqlite tests [2]. [1] https://github.com/canonical/k8s-dqlite/blob/master/test/list_test.go#L13 |
@ktsakalozos I created a branch to my fork. I am not sure where to finally put it, maybe into benchmarks. I never created unit test for performance before. https://github.com/miro-balaz/k8s-dqlite/tree/miro-balaz/issues/82 I also have fix for that, but I do not want to rush it. Lets make sure this test is right. Edit: But the test works and shows expected behaviour. |
Since you want to improve the performance of updateEntry (make it linear) you could measure the time of the first 1000 calls to it and then assert that the time it takes to make the next 1000 batches is similar to what you expect. Fail the test if it takes more than expected. This way you can show the fix to the behavior you observe. I would suggest you open a PR and mark it as draft. |
I was doing a test, and found that SQL query
from
https://github.com/canonical/kine/tree/v0.4.1-k8s-dqlite.9
performs very badly in situations where there are many rows with the same name. I do not know how long it takes, I stopped it after few seconds. I think it might have quadratic complexity. This situation can arise in k8s after some problems. That is how I discovered it.
Is this something that is known? Are there any plans to change it?
The text was updated successfully, but these errors were encountered: