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

Invalidate cache entry for service instances by subscribing to curator TreeCache #295

Open
belovaf opened this issue Sep 18, 2021 · 1 comment

Comments

@belovaf
Copy link

belovaf commented Sep 18, 2021

Current ZookeeperLoadBalancerConfiguration implementation caches service instances for 35 seconds by default.
If any instance get down in this period we will load balance on it anyway.
Of course, we can disable service instance cache, but it is not good by performance reasons (and zookeeper possible downtime).

In our project we implemented ServiceInstanceListCacheInvalidator which is subscribed to TreeCache from ZookeeperServiceWatch.
It removes single service instances (one cache entry) from cache when it is notified about that service instances change.
With this feature we can safely increase cache ttl to a relative big value (15 minutes or more).

What do you think about it? Can i make pull request with this feature?

@weihubeats
Copy link

We also encountered a similar problem, can you take a look at your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants