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

Replace 'polling' to 'watch` strategy to improve performance and reduce cpu usage #10

Open
denis-tingaikin opened this issue Aug 14, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@denis-tingaikin
Copy link
Member

Currently we're using 'polling' strategy to check diff with cluster properties. Its polling clusterproperties every second to detect diff.
We can improve this apporoach with replacing 'polling' to 'watch'.

TODO

  1. Do fetch for list as its doing currently https://github.com/networkservicemesh/cmd-cluster-info-k8s/blob/main/main.go#L148-L161 before main loop.
  2. Start watcher in the main loop instead https://github.com/networkservicemesh/cmd-cluster-info-k8s/blob/main/main.go#L148-L161
    (see at aboutapiRESTClient.Get().Resource("clusterproperties").Watch method)
  3. Correctly handle watcher expiration (Note: watchers have a time limit for watching, so we should re-start watch on expiration)
  4. Test that cluster-info example is still working with changes.
@denis-tingaikin denis-tingaikin added the enhancement New feature or request label Aug 14, 2022
@denis-tingaikin denis-tingaikin added this to the v1.6.0 milestone Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants