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

konnect: handle deletions first #821

Closed
wants to merge 1 commit into from
Closed

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Oct 28, 2024

What this PR does / why we need it:

This PR makes the generic Konnect entity reconciler to handle deletions first so that deletions of multiple entities are handled faster.

This was observed during heavier, local performance tests.

This PR:

controller_runtime_active_workers{controller="KongConsumer"} 0
controller_runtime_max_concurrent_reconciles{controller="KongConsumer"} 8
controller_runtime_reconcile_errors_total{controller="KongConsumer"} 0
controller_runtime_reconcile_panics_total{controller="KongConsumer"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="error"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue_after"} 50
controller_runtime_reconcile_total{controller="KongConsumer",result="success"} 150
controller_runtime_terminal_reconcile_errors_total{controller="KongConsumer"} 0
workqueue_adds_total{controller="KongConsumer",name="KongConsumer"} 200
workqueue_depth{controller="KongConsumer",name="KongConsumer"} 0
workqueue_retries_total{controller="KongConsumer",name="KongConsumer"} 50


kubectl wait --timeout=-1s --for=delete kongconsumer --all  0.11s user 0.05s system 1% cpu 10.374 total

controller_runtime_active_workers{controller="KongConsumer"} 0
controller_runtime_max_concurrent_reconciles{controller="KongConsumer"} 8
controller_runtime_reconcile_errors_total{controller="KongConsumer"} 0
controller_runtime_reconcile_panics_total{controller="KongConsumer"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="error"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue_after"} 50
controller_runtime_reconcile_total{controller="KongConsumer",result="success"} 350
controller_runtime_terminal_reconcile_errors_total{controller="KongConsumer"} 0
workqueue_adds_total{controller="KongConsumer",name="KongConsumer"} 400
workqueue_depth{controller="KongConsumer",name="KongConsumer"} 0
workqueue_retries_total{controller="KongConsumer",name="KongConsumer"} 50

main:

controller_runtime_active_workers{controller="KongConsumer"} 0
controller_runtime_max_concurrent_reconciles{controller="KongConsumer"} 8
controller_runtime_reconcile_errors_total{controller="KongConsumer"} 0
controller_runtime_reconcile_panics_total{controller="KongConsumer"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="error"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue_after"} 50
controller_runtime_reconcile_total{controller="KongConsumer",result="success"} 150
controller_runtime_terminal_reconcile_errors_total{controller="KongConsumer"} 0
workqueue_adds_total{controller="KongConsumer",name="KongConsumer"} 200
workqueue_depth{controller="KongConsumer",name="KongConsumer"} 0
workqueue_retries_total{controller="KongConsumer",name="KongConsumer"} 50

kubectl wait --timeout=-1s --for=delete kongconsumer --all  0.12s user 0.05s system 0% cpu 19.466 total

controller_runtime_active_workers{controller="KongConsumer"} 0
controller_runtime_max_concurrent_reconciles{controller="KongConsumer"} 8
controller_runtime_reconcile_errors_total{controller="KongConsumer"} 0
controller_runtime_reconcile_panics_total{controller="KongConsumer"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="error"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue"} 0
controller_runtime_reconcile_total{controller="KongConsumer",result="requeue_after"} 50
controller_runtime_reconcile_total{controller="KongConsumer",result="success"} 350
controller_runtime_terminal_reconcile_errors_total{controller="KongConsumer"} 0
workqueue_adds_total{controller="KongConsumer",name="KongConsumer"} 400
workqueue_depth{controller="KongConsumer",name="KongConsumer"} 0
workqueue_retries_total{controller="KongConsumer",name="KongConsumer"} 50

Conclusion

The same amount of reconciliations with nearly halved deletion time.

Creation of 50 consumers, decreased ever so slightly but that might be a network latency effect. Non goal for this PR.

main:

kubectl -n default wait --for=condition=Programmed=true kongconsumer --all  1  0.18s user 0.08s system 0% cpu 26.805 total

This PR:

kubectl -n default wait --for=condition=Programmed=true kongconsumer --all  1  0.18s user 0.08s system 1% cpu 18.907 total

@pmalek pmalek self-assigned this Oct 28, 2024
@pmalek pmalek force-pushed the konnect-handle-deletions-first branch 3 times, most recently from 5a2fa7c to ce710fc Compare October 28, 2024 19:20
@pmalek pmalek force-pushed the konnect-handle-deletions-first branch from ce710fc to 8c5eccf Compare October 29, 2024 09:06
@pmalek
Copy link
Member Author

pmalek commented Oct 29, 2024

This would require the change in behavior described in #788: so that the operator does not set the ownership relations between object and objects living inside the CP are not scheduled for deletion when CP gets deleted.

Closing until that changes.

@pmalek pmalek closed this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant