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

Refactor consul service monitor #564

Merged
merged 4 commits into from
Nov 15, 2018
Merged

Refactor consul service monitor #564

merged 4 commits into from
Nov 15, 2018

Conversation

magiconair
Copy link
Contributor

This patch refactors the consul service monitor and provides a new option registry.consul.serviceMonitors to configure the concurrency for routing table updates.

Fabio uses one go routine by default to fetch status information from Consul when the service status changes. This can be too slow when lots of services are registered. The new registry.consul.serviceMonitors option configures how many go routines fabio will use to fetch service data from Consul.

This patch unfortunately supersedes #559 from @galen0624 since this was a good opportunity to finally refactor the service monitor code to make it more extensible and testable.

Fixes #558

@magiconair
Copy link
Contributor Author

Discussion is on #559

Refactor the set of functions which watch the consul state
and generate the route commands into a set of objects to make
them testable and extendable.
The code which updates the routing table from consul was using a
single go routine to fetch data from consul. This can be a slow
process if consul has lots of registered services.

This patch adds an option `registry.consul.serviceMonitors`
to increase the concurrency for the route updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant