From: "Aaron Wiebe" <epiphani@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "John Stoffel" <john@stoffel.org>
Subject: Re: slow open() calls and o_nonblock
Date: Sun, 3 Jun 2007 21:05:51 -0400 [thread overview]
Message-ID: <e7ca40f70706031805h56da4c3ag2dd0e902430785cc@mail.gmail.com> (raw)
In-Reply-To: <18019.21781.470399.393340@stoffel.org>
Hi John, thanks for responding. I'm using kernel 2.6.20 on a
home-grown distro.
I've responded to a few specific points inline - but as a whole,
Davide directed me to work that is being done specifically to address
these issues in the kernel, as well as a userspace implementation that
would allow me to sidestep this failing for the time being.
On 6/3/07, John Stoffel <john@stoffel.org> wrote:
>
> How large are these files? Are they all in a single directory? How
> many files are in the directory?
>
> Ugh. Why don't you just write to a DB instead? It sounds like you're
> writing small records, with one record to a file. It can work, but
> when you're doing thousands per-minute, the open/close overhead is
> starting to dominate. Can you just amortize that overhead across a
> bunch of writes instead by writing to a single file which is more
> structured for your needs?
In short, I'm distributing logs in realtime for about 600,000
websites. The sources of the logs (http, ftp, realmedia, etc) are
flexible, however the base framework was build around a large cluster
of webservers. The output can be to several hundred thousand files
across about two dozen filers for user consumption - some can be very
active, some can be completely inactive.
> Netapps usually scream for NFS writes and such, so it sounds to me
> that you've blown out the NVRAM cache on the box. Can you elaborate
> more on your hardware & Network & Netapp setup?
You're totally correct here - Netapp has told us as much about our
filesystem design, we use too much ram on the filer itself. Its true
that the application would handle just fine if our filesystem
structure were redesigned - I am approaching this from an application
perspective though. These units are capable of the raw IO, its the
simple fact that open calls are taking a while. If I were to thread
off the application (which Davide has been kind enough to provide some
libraries which will make that substantially easier), the problem
wouldn't exist.
> The problem is that O_NONBLOCK on files open doesn't make sense. You
> either open it, or you don't. How long it takes to comlete isn't part
> of the spec.
You can certainly open the file, but not block on the call to do it.
What confuses me is why the kernel would "block" for 415ms on an open
call. Thats an eternity to suspend a process that has to distribute
data such as this.
> But in this case, I think you're doing something hokey with your data
> design. You should be opening just a handful of files and then
> streaming your writes to those files. You'll get much more
> performance.
Except I cant very well keep 600,000 files open over NFS. :) Pool
and queue, and cycle through the pool. I've managed to achieve a
balance in my production deployment with this method - my email was
more of a rant after months of trying to work around a problem (caused
by a limitation in system calls), only to have it present an order of
magnitude worse than I expected. Sorry for not giving more
information off the line - and thanks for your time.
-Aaron
next prev parent reply other threads:[~2007-06-04 1:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-03 18:52 slow open() calls and o_nonblock Aaron Wiebe
2007-06-03 19:16 ` Davide Libenzi
2007-06-03 23:56 ` John Stoffel
2007-06-04 1:05 ` Aaron Wiebe [this message]
2007-06-04 1:20 ` Neil Brown
2007-06-04 13:59 ` Aaron Wiebe
2007-06-04 1:25 ` Bernd Eckenfels
2007-06-04 0:27 ` David Schwartz
2007-06-04 1:05 ` Al Viro
2007-06-04 1:19 ` Bernd Eckenfels
2007-06-04 13:49 ` Alan Cox
2007-06-04 14:04 ` Aaron Wiebe
2007-06-04 14:17 ` John Stoffel
2007-06-04 14:24 ` Aaron Wiebe
2007-06-04 14:20 ` Aaron Wiebe
2007-06-04 15:42 ` Trond Myklebust
2007-06-04 15:59 ` Aaron Wiebe
2007-06-04 16:26 ` Aaron Wiebe
2007-06-04 19:46 ` Trond Myklebust
2007-06-04 20:32 ` David Schwartz
2007-06-04 14:39 ` Aaron Wiebe
-- strict thread matches above, loose matches on Subject: below --
2007-06-04 3:57 Albert Cahalan
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=e7ca40f70706031805h56da4c3ag2dd0e902430785cc@mail.gmail.com \
--to=epiphani@gmail.com \
--cc=john@stoffel.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.