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: Use a separate lock for accessing the pool's servers #6381

Merged
merged 1 commit into from Mar 26, 2018

Conversation

Projects
None yet
3 participants
@rgacogne
Member

rgacogne commented Mar 23, 2018

Short description

We used to hold the Lua lock while applying the load-balancing policy to select a backend, which is only needed by Lua policies, not core ones. We do need a lock to make sure that the vector of servers is not altered under our feet, but a per-pool read-write lock is enough and reduces contention a lot, especially when the maintenance thread is doing some heavy-lifting.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
dnsdist: Use a separate lock for accessing the pool's servers
We used to hold the Lua lock while applying the load-balancing policy
to select a backend, which is only needed by Lua policies, not core
ones. We do need a lock to make sure that the vector of servers is
not altered under our feet, but a per-pool read-write lock is enough
and reduces contention a lot, especially when the maintenance thread
is doing some heavy-lifting.

@rgacogne rgacogne added this to the dnsdist-1.3.0 milestone Mar 23, 2018

@rgacogne

This comment has been minimized.

Member

rgacogne commented Mar 23, 2018

This PR supersedes #6190.

@zeha

zeha approved these changes Mar 24, 2018

@pieterlexis pieterlexis merged commit 0a1c8d0 into PowerDNS:master Mar 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rgacogne rgacogne deleted the rgacogne:dnsdist-serverpool-mutex branch Mar 26, 2018

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