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

Optimize service add #1727

Merged
merged 17 commits into from
Feb 20, 2024
Merged

Optimize service add #1727

merged 17 commits into from
Feb 20, 2024

Conversation

scareything
Copy link
Member

@scareything scareything commented Feb 1, 2024

IP address selection for intercepted hostnames was taking a significant amount of time, especially for large numbers of services (1000's). This PR optimizes IP assignment:

  • All local addresses were being looked up before getting a new IP. this was not necessary at all
  • Assign the entire DNS IP range to the loopback device at startup instead of assigned each IP as it is allocated.
  • re-use returned DNS IPs if available

@scareything scareything requested review from a team as code owners February 1, 2024 19:59
@scareything
Copy link
Member Author

Inspired by Robert's changes at https://github.com/openziti/ziti/tree/optimize_service_add

@scareything scareything marked this pull request as draft February 1, 2024 21:17
@scareything scareything force-pushed the optimize_service_add.smc branch 2 times, most recently from b4d1226 to f839734 Compare February 9, 2024 17:55
@scareything scareything marked this pull request as ready for review February 12, 2024 13:46
@@ -70,6 +70,16 @@ func (self *tunneler) Start(notifyClose <-chan struct{}) error {
log := pfxlog.Logger()
log.WithField("mode", self.listenOptions.mode).Info("creating interceptor")

resolver, err := dns.NewResolver(self.listenOptions.resolver)
if err != nil {
pfxlog.Logger().WithError(err).Error("failed to start DNS resolver")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue related to this code: #1513
Do you think you could pop in a quick fix for that here.. just assign a default resolver if the selected resolver initialization fails?

@scareything scareything merged commit 25a8fb2 into release-next Feb 20, 2024
18 checks passed
@scareything scareything deleted the optimize_service_add.smc branch February 20, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants