-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
DNS over TLS is extremely slow (~40+ms) because of slow TLS handshake #1202
Comments
What I see in the Unbound pcap is that packets 12 and 29 take consistently ~40ms but these packets are from dig to Unbound. This looks like it could be a timeout thing involved. I'll see if it is consistent to other ssl versions. |
I did notice that and I found it odd. I wondered if it was something that unbound had sent that made the client do some heavy computation or something. I don't know enough about how TLS works specifically to say though. The nginx container is using
I was performing |
This seems to also be related to #1045. I reran the environments for that and I can confirm that using |
This was identified to be the TCP_NODELAY socket option. More information can be found on the #1214 PR. |
Describe the bug
Simply
dig @my.dns.server#853 +tls some.query
consistently takes 40-45msConfiguring nginx to perform the TLS decryption reduces this to 20-30ms initially, then to zero for subsequent requests (reusing tls session?)
To reproduce
Steps to reproduce the behavior:
Note that setting tls-ciphers here seems to make no difference
I'm using ecdsa certificates from letsencrypt here (ecdsa-with-SHA384 / secp384r1 / P-384)
Expected behavior
Unbound should be able to be (nearly) as fast as nginx
System:
alpinelinux/unbound
container)unbound -V
output:Additional information
Here are two pcap files showing difference between nginx and unbound. In both cases the queries were performed using dig. There's also a
dig +tcp
in each one for contrast. The captures were taken from the same host on which the unbound process isi running.unbound-pcaps.zip
This is the nginx configuration I'm using
The text was updated successfully, but these errors were encountered: