-
Notifications
You must be signed in to change notification settings - Fork 27
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
Reduce the number of API calls to K8S #197
Reduce the number of API calls to K8S #197
Conversation
new in py39 - drat! Let me take another run at this. |
@javacruft seems like performance has been decreasing lately, we can consider merging this work, what's the status? |
f90511d
to
7c60ebf
Compare
The charm makes a large number of API calls to retrieve information about the IP address allocated to the K8S service; cache this information to reduce the number of calls made and speed up hook performance. Note functools.lru_cache is used as this charm runs on 20.04 which uses Python 3.8 - when the base is updated to 22.04 the more simple cache decorator can be used instead.
7c60ebf
to
73f867e
Compare
@PietroPasotti refreshed for 3.8 compatibility - I'm taking it for a test drive now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be relatively risk-free as the charm exits after every invocation, meaning that the caching will only be done throughout the lifetime of a single event.
itests failing due to some ingress gateway unavailable |
@PietroPasotti any idea what the cause of the gateway unavailable error is? I had a dig around in the logs but can't see anything obvious |
no idea either: https://discourse.charmhub.io/t/traefik-k8s-docs-troubleshooting-gateway-address-unavailable/10813 |
't was flaky |
The charm makes a large number of API calls to retrieve information about the IP address allocated to the K8S service; cache this information to reduce the number of calls made and speed up hook performance.
Issue
Improve the performance of hook executions
Solution
Cache response from K8S to reduce the amount of API calls made.
Context
The traefik charm stands out as always the last to settle in Sunbeam deployments; hopefully this may improve this situation a bit.
Testing Instructions
https://microstack.run/docs -> "multi-node tutorial"