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 did not set TCP_NODELAY, causing needless latency #7030

Merged
merged 2 commits into from Oct 5, 2018

Conversation

ahupowerdns
Copy link
Contributor

Winfried and others noted that our TLS responses were super slow. This turned out to be caused by the Nagle
algorithm which we failed to disable. https://en.wikipedia.org/wiki/Nagle%27s_algorithm

Short description

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)
  • checked that this code was merged to master

Winfried and others noted that our TLS responses were super slow. This turned out to be caused by the Nagle
algorithm which we failed to disable. https://en.wikipedia.org/wiki/Nagle%27s_algorithm
@@ -715,7 +716,7 @@ void* tcpAcceptorThread(void* p)
continue;
}
#endif

SSetsockopt(ci->fd, SOL_TCP, TCP_NODELAY, 1); // disable NAGLE
Copy link
Member

Choose a reason for hiding this comment

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

Just a nit but we have a nice setTCPNoDelay() function in misc.hh :-) It also uses IPPROTO_TCP instead of SOL_TCP, which is more portable.

@pieterlexis pieterlexis merged commit b287cd3 into PowerDNS:master Oct 5, 2018
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.

None yet

3 participants