-
Notifications
You must be signed in to change notification settings - Fork 219
clone on read from cache #321
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
Conversation
@metacosm @adam-sandor @ppatierno So as discussed here: |
@csviri sorry I checked the wrong link! I have tested my PR not yours yet. |
Hmm, cloning by serializing and deserializing might have quite a performance impact and I'm not sure it wouldn't actually be faster to always retrieve the last version from the cluster… |
@metacosm Making an API call on every event we received / processing of controller is not a good idea. You will have to make or maintain a TCP connection to the K8S API server, while we have anyways the latest resource from the watch always. Also note that we try to minimize the K8S API, so we don't make a DOS attack on our own. I think its quite high priority to not do polling on K8S API in general. There might be faster way for cloning, but at this state to fix this problem, I thing definitely the cloning is the way to go. On long term we can discuss different strategy. But this PR fixes this problem, the performance impact is negligible) |
@ppatierno |
@csviri retrieving from the cluster does indeed deserialize but here we're serializing then deserializing… Also, the process is not a perfect clone i.e. not all state is necessarily serialized (though the controller should be able to reconstruct that state from the "clean" copy). I do agree that we should merge this fix if it indeed addresses the issue but I'm not convinced that this caching strategy is the proper one and we might indeed need to re-think some things. |
@metacosm Sure, happy to discuss alternatives. Pls organise a meeting in case. Although I think caches have a significant roles here also in event sources to avoid polling. Hopefully can finish the blog this week, this is touched too, ehh cannot find enough time :/ |
No description provided.