Skip to content

dnsdist: Add recvmmsg support for backend responses#16932

Draft
rgacogne wants to merge 1 commit into
PowerDNS:masterfrom
rgacogne:ddistrecvmmsg-from-backends
Draft

dnsdist: Add recvmmsg support for backend responses#16932
rgacogne wants to merge 1 commit into
PowerDNS:masterfrom
rgacogne:ddistrecvmmsg-from-backends

Conversation

@rgacogne

@rgacogne rgacogne commented Feb 25, 2026

Copy link
Copy Markdown
Member

Short description

Needs testing, especially performance testing, documentation and perhaps even a switch in the configuration.

Closes #16625

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • 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)

Comment thread pdns/dnsdistdist/dnsdist.cc Fixed
Comment thread pdns/dnsdistdist/dnsdist.cc Outdated
@rgacogne rgacogne force-pushed the ddistrecvmmsg-from-backends branch from 7548175 to 2d44918 Compare March 24, 2026 08:45
@coveralls

coveralls commented Mar 24, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27758512668

Coverage increased (+0.01%) to 71.085%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: 39 uncovered changes across 1 file (126 of 165 lines covered, 76.36%).
  • 39 coverage regressions across 12 files.

Uncovered Changes

File Changed Covered %
pdns/dnsdistdist/dnsdist-udp.cc 164 125 76.22%
Total (2 files) 165 126 76.36%

Coverage Regressions

39 previously-covered lines in 12 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
pdns/recursordist/test-syncres_cc1.cc 15 79.72%
pdns/recursordist/rec-tcpout.cc 6 79.05%
pdns/recursordist/pdns_recursor.cc 3 75.77%
pdns/recursordist/syncres.cc 3 81.25%
modules/pipebackend/pipebackend.cc 2 51.18%
pdns/recursordist/aggressive_nsec.cc 2 66.48%
pdns/recursordist/rec-main.cc 2 65.08%
pdns/recursordist/recpacketcache.cc 2 83.14%
pdns/backends/gsql/gsqlbackend.hh 1 97.77%
pdns/dnsdistdist/dnsdist-tcp.cc 1 74.73%

Coverage Stats

Coverage Status
Relevant Lines: 171313
Covered Lines: 133468
Line Coverage: 77.91%
Relevant Branches: 81882
Covered Branches: 46515
Branch Coverage: 56.81%
Branches in Coverage %: Yes
Coverage Strength: 6424407.79 hits per line

💛 - Coveralls

Comment thread pdns/dnsdistdist/dnsdist.cc Outdated
for (const auto& sockDesc : sockets) {
/* block until we have at least one message ready, but return
as many as possible to save the syscall costs */
msgsGot = recvmmsg(sockDesc, msgVec.data(), vectSize, MSG_WAITFORONE | MSG_TRUNC, nullptr);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
msgsGot = recvmmsg(sockDesc, msgVec.data(), vectSize, MSG_WAITFORONE | MSG_TRUNC, nullptr);
msgsGot = recvmmsg(sockDesc, msgVec.data(), vectSize, MSG_WAITFORONE, nullptr);

Comment thread pdns/dnsdistdist/dnsdist.cc Outdated
{
#ifndef DISABLE_RECVMMSG
#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
if (dnsdist::configuration::getImmutableConfiguration().d_udpVectorSize > 0) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
if (dnsdist::configuration::getImmutableConfiguration().d_udpVectorSize > 0) {
if (dnsdist::configuration::getImmutableConfiguration().d_udpVectorSize > 1) {

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
@rgacogne rgacogne force-pushed the ddistrecvmmsg-from-backends branch from 2d44918 to cd6a196 Compare June 18, 2026 12:11
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.

dnsdist: Ponder using recvmmsg to receive UDP responses from backends

5 participants