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

dnsdist: Implement a limit of concurrent connections to a backend #11713

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

rgacogne
Copy link
Member

Short description

This PR adds a new option to limit the number of TCP connections to a backend. When that limit is reached, no new connection to that backend will be opened, and queries routed to that backend will fail, until the number of connections goes back below that limit.
It also introduces a new metric for that value, and a counter indicating how often it was reached.
Finally it slightly improves the way we are reusing TCP connections by detaching them from the incoming connection a bit earlier in the process, and immediately releasing idle connections when no longer need them.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@rgacogne rgacogne added this to the dnsdist-1.8.0 milestone Jun 21, 2022
@rgacogne rgacogne force-pushed the ddist-upstream-conn-limit branch from 6fe26aa to ed3fe8c Compare June 22, 2022 12:15
@rgacogne
Copy link
Member Author

Rebased to fix a conflict.

@rgacogne rgacogne force-pushed the ddist-upstream-conn-limit branch from ed3fe8c to c8cfeda Compare June 23, 2022 10:34
@rgacogne
Copy link
Member Author

Rebased to fix a conflict.

rgacogne added 4 commits June 24, 2022 14:10
…dead

By remember that a connection is no longer usable when we notice that,
we prevent a case where we could pretend that it will be usable when
it has finished processing the current queries and responses, which
is not true.
@rgacogne rgacogne force-pushed the ddist-upstream-conn-limit branch from c8cfeda to a34f264 Compare June 24, 2022 12:17
@rgacogne
Copy link
Member Author

And rebased again.

@rgacogne rgacogne merged commit 99e0173 into PowerDNS:master Jun 24, 2022
@rgacogne rgacogne deleted the ddist-upstream-conn-limit branch June 24, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants