Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Daire Byrne <daire@dneg.com>
To: linux-nfs <linux-nfs@vger.kernel.org>
Subject: directory caching & negative file lookups?
Date: Thu, 1 Sep 2022 14:32:27 +0100	[thread overview]
Message-ID: <CAPt2mGOnsA9pcmZQkr2q40d7A+NLj7=xr+dzFh7XwJPdGYW6Hw@mail.gmail.com> (raw)

Hi,

So I have a bit of a newbie question (apologies) that came to me while
debugging some code that was spamming our NFS servers with lookups for
nonexistent files.

If we can cache directory entries (readdir) and even all their
attributes (readdirplus) for some specified period of time (actimeo,
nocto) on a client, then why can't we use that data to serve negative
lookups for files in that directory too (if we so choose)?

There are probably very good reasons you always need to do a
(negative) file lookup, like being able to read files recently created
on another client (despite your local cache for that directory), but
I'm just curious what the official reasons are. If we could choose to
serve negative lookups using the directory entries cache for a
read-only or unchanging filesystem, would that still be bad? We
already choose to use nocto for some workloads...

In our case we see these kinds of heavy negative lookup workloads for
network installed software (100 entries in PYTHONPATH is bad) and in
buggy software (randomly generated filename lookups are really bad!).
Of course, this overhead gets really bad as you add latency between
the client and server.

Daire

             reply	other threads:[~2022-09-01 13:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 13:32 Daire Byrne [this message]
2022-09-01 13:55 ` directory caching & negative file lookups? Trond Myklebust
2022-09-01 15:27   ` Daire Byrne
2022-09-01 15:43     ` Trond Myklebust
2022-09-01 15:49       ` Daire Byrne
2024-04-05 14:47         ` Daire Byrne
2024-04-05 15:03           ` Trond Myklebust
2024-04-12  9:11             ` Daire Byrne
2024-04-12 10:21               ` Jeff Layton
2024-04-12 11:43                 ` Daire Byrne
2024-04-12 14:13                   ` Jeff Layton

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='CAPt2mGOnsA9pcmZQkr2q40d7A+NLj7=xr+dzFh7XwJPdGYW6Hw@mail.gmail.com' \
    --to=daire@dneg.com \
    --cc=linux-nfs@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 read-only IMAP folder(s) and NNTP newsgroup(s).