From: David Howells <dhowells@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: dhowells@redhat.com, linux-nfs@vger.kernel.org,
linux-cifs@vger.kernel.org, linux-afs@lists.infradead.org,
ceph-devel@vger.kernel.org, keyrings@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: What's a good default TTL for DNS keys in the kernel
Date: Thu, 16 Apr 2020 14:01:38 +0100 [thread overview]
Message-ID: <142355.1587042098@warthog.procyon.org.uk> (raw)
In-Reply-To: <87v9lzu3cx.fsf@oldenburg2.str.redhat.com>
Florian Weimer <fweimer@redhat.com> wrote:
> > Florian Weimer <fweimer@redhat.com> wrote:
> >
> >> You can get the real TTL if you do a DNS resolution on the name and
> >> match the addresses against what you get out of the NSS functions. If
> >> they match, you can use the TTL from DNS. Hackish, but it does give you
> >> *some* TTL value.
> >
> > I guess I'd have to do that in parallel.
>
> Not necessary. You can do the getaddrinfo lookup first and then perform
> the query.
That means that the latency of both is added together and causes the first
mount to take longer - though as long as you have a local DNS cache, that's
fine.
> > AFS keeps track of the expiration on the record and will issue a new lookup
> > when the data expires, but NFS doesn't make use of this information.
>
> And it will switch servers at that point? Or only if the existing
> server association fails/times out?
AFS will switch servers at the next operation if the server list changes. And
if the current op tries to access an old server and gets bounced, this should
trigger an immediate reevaluation. It also regularly probes the servers and
interfaces it knows about to find which one's accessible and which has the
best response and can switch servers on that basis also.
I should also note that AFS deletes the dns_resolver key after reading it and
maintains the expiry information in its internal structs.
Note also that in AFS this only applies to locating the Volume Location
servers (which is a layer of abstraction that hides which server(s) a volume
resides on and what their addresses are). The VL service is queried to find
out where file servers are (giving you their addresses itself so you don't
need to access the DNS there).
> > The keyring subsystem will itself dispose of dns_resolver keys that
> > expire and request_key() will only upcall again if the key has
> > expired.
>
> What's are higher-level effects of that?
If the record never expires (the current case), the address lookup in the
kernel (dns_query()) will always return the same address until someone
manually evicts it.
Otherwise, once the record expires, the kernel will just upcall again.
> I'm still not convinced that the kernel *needs* accurate TTL
> information. The benefit from upcall avoidance likely vanishes quickly
> after the in-kernel TTL increases beyond 5 or so. That's just my guess,
> though.
You might be right - certainly for NFS and CIFS where the address ascribed to
a superblock is hard to change as it partly defines the superblock. Change
the address and your superblock in now a different thing as far as the VFS is
concerned.
This makes fscache indexing tricky for NFS. How do you define a superblock?
Is it address? Is it hostname? What happens if one or the other changes?
What happens if there are two or more addresses (say ipv4 and ipv6 addrs)?
AFS defined some abstractions for this: the cell name and the volume ID
number. The physical location of the volume doesn't matter - and the volume
can even be moved around whilst in use.
David
next prev parent reply other threads:[~2020-04-16 13:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 14:20 What's a good default TTL for DNS keys in the kernel David Howells
2020-04-14 20:16 ` Jeff Layton
2020-04-15 17:07 ` Steve French
2020-04-16 10:15 ` David Howells
2020-04-15 9:44 ` Florian Weimer
2020-04-16 10:27 ` David Howells
2020-04-16 10:33 ` Florian Weimer
2020-04-16 13:01 ` David Howells [this message]
2020-04-16 13:40 ` Chuck Lever
2020-04-17 11:31 ` Aurélien Aptel
2020-04-17 23:23 ` Steve French
2020-04-18 18:10 ` Florian Weimer
2020-04-19 4:53 ` Steve French
2020-04-19 8:37 ` David Howells
2020-04-20 0:58 ` Paulo Alcantara
2020-04-20 13:13 ` David Howells
2020-04-20 18:21 ` Paulo Alcantara
2020-04-20 22:14 ` cifs - Race between IP address change and sget()? David Howells
2020-04-20 22:30 ` Jeff Layton
2020-04-21 1:29 ` Ronnie Sahlberg
2020-04-21 2:26 ` Steve French
2020-04-21 2:29 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=142355.1587042098@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=fweimer@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).