From: arlie@worldash.org (Arlie Stephens)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Work (really slow directory access on ext4)
Date: Thu, 31 Jul 2014 16:36:01 -0700 [thread overview]
Message-ID: <20140731233601.GA21240@worldash.org> (raw)
In-Reply-To: <CAPDOMVgsCR+UPmxuyYg6ytkLfmv5-G41xYFUV=LjLf05LWGRRg@mail.gmail.com>
Hi Nick,
[Context - directory ls taking 4-15 seconds; directory large, with
long filenames, but nowhere near as huge as Valdis' mail directory.]
I've now discovered a really bizarre pattern, and I'm inclined to stop
blaming the file system until some clarity develops. If I ever get it
to the point where I can produce a high quality bug report - with or
without patch - I will do so - but what I have now is anything but
clear and high quality.
On Jul 30 2014, Nick Krause wrote:
> On Wed, Jul 30, 2014 at 3:48 PM, <Valdis.Kletnieks@vt.edu> wrote:
> > On Wed, 30 Jul 2014 10:38:13 -0700, Arlie Stephens said:
> >
> >> On the good side, Vladis' observations of his mail directory have been
> >> a great help.
> >
> > And remember, that's on a single laptop-class hard drive, no fancy raid or
> > anything. (Though it *is* a hybrid, with 32G of flash cache on the front end).
> >
> > You throw some *real* hardware at it, it of course would go even faster.
>
> Just send me the logs and anything else you think may help me.
> Please note cc the ext4 mailing list as this will also let the other
> ext4 developers and maintainers known about your problem.
> Cheers Nick
I'm now in a state of complete bafflement.
It turns out we have a whole collection of misbehaving directories,
making this testable without waiting for caches to clear.
I have a couple of strace's of fast ls's, and a function ftrace that
captured about half of a 7 second ls. (The latter is huge, and
probably not suitable for posting.)
I also have a really bizarre observation, the kind that makes you
wonder whether you are actually dreaming. It appears that the
misbehaviour is strongly influenced by the choice of "time" function.
The problem only occurs when using the shell built-in. /usr/bin/time
always produces a fast response.
Stranger still - flat out impossible, I'd have said before seeing it -
a "fast" ls, run with /usr/bin/time can be followed *immediately*
by a slow "ls", run with bash' time. It's as if the first one doesn't
warm the cache, which is completely absurd - except I've been able to
make this happen 5 times in a row, first with strace and then
without.
# with /usr/bin/time the ls is fast
$ time -p ls bad_dir
...
real 0.21
user 0.00
sys 0.00
# with the builtin time, right *after* the strace run, the time can be
# horrible.
$ time -p ls bad_dir
...
real 5.60
user 0.00
sys 0.17
# run it again, and the directory is in cache as expected.
$ time -p ls bad_dir
...
real 0.11
user 0.00
sys 0.02
This is not an artefact of one or other time reporting incorrectly -
I'm noticing a long pause before output occurs, but only on the middle
test of the three.
I can't imagine any sane way for this to be happening, short of
coincidence or user error - and I've now seen this sequence 5 times in
a row, on 5 different directories created and populated by the same
app. (Three times with strace, twice without.)
--
Arlie
(Arlie Stephens arlie at worldash.org)
next prev parent reply other threads:[~2014-07-31 23:36 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 16:38 Work Nick Krause
2014-07-24 16:43 ` Work Kristofer Hallin
2014-07-24 16:44 ` Work Lucas Tanure
2014-07-24 16:47 ` Work Nick Krause
2014-07-26 21:13 ` Work Yi Li
2014-07-26 21:55 ` Work Lucas Tanure
2014-07-24 16:51 ` Work Andev
2014-07-24 17:10 ` Work Nick Krause
2014-07-25 2:23 ` Work Nick Krause
2014-07-25 5:33 ` Work ravi ranjan Mishra
2014-07-25 11:44 ` Work Lucas Tanure
2014-07-25 12:17 ` Work Robert P. J. Day
2014-07-25 15:19 ` Work Nick Krause
2014-07-25 17:18 ` Work Robert P. J. Day
2014-07-25 17:28 ` Work Valdis.Kletnieks at vt.edu
2014-07-25 17:42 ` Work Valdis.Kletnieks at vt.edu
2014-07-25 21:54 ` Work Nick Krause
2014-07-25 22:23 ` Work Arlie Stephens
2014-07-25 23:02 ` Work Nick Krause
2014-07-25 23:35 ` Work Valdis.Kletnieks at vt.edu
2014-07-25 23:44 ` Work Nick Krause
2014-07-26 1:08 ` Work (really slow directory access on ext4) Arlie Stephens
2014-07-26 1:22 ` Nick Krause
2014-07-30 2:34 ` Nick Krause
2014-07-30 17:38 ` Arlie Stephens
2014-07-30 19:48 ` Valdis.Kletnieks at vt.edu
2014-07-30 20:45 ` Nick Krause
2014-07-31 23:36 ` Arlie Stephens [this message]
2014-07-31 23:41 ` Henry Hallam
2014-08-01 1:47 ` Nick Krause
-- strict thread matches above, loose matches on Subject: below --
2014-08-06 14:49 Theodore Ts'o
2014-08-06 18:26 ` Arlie Stephens
2014-08-06 19:29 ` Nick Krause
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=20140731233601.GA21240@worldash.org \
--to=arlie@worldash.org \
--cc=kernelnewbies@lists.kernelnewbies.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).