From: Benjamin LaHaise <bcrl@kvack.org>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Matti Aarnio <matti.aarnio@zmailer.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: sendfile() with 100 simultaneous 100MB files
Date: Sat, 21 Jan 2006 22:46:38 -0500 [thread overview]
Message-ID: <20060122034638.GA1008@kvack.org> (raw)
In-Reply-To: <9e4733910601201943y77fb9a1fgf2a5f0d48eca1344@mail.gmail.com>
On Fri, Jan 20, 2006 at 10:43:44PM -0500, Jon Smirl wrote:
> 100 users at 500K each is 50MB of read ahead, that's not a huge amount of
> memory
The system might be overrunning the number of requests the disk elevator
has, which would result in the sort of disk seek storm you're seeing.
Also, what filesystem is being used? XFS would likely do substantially
better than ext3 because of its use of extents vs indirect blocks.
> Does using sendfile() set MADV_SEQUENTIAL and MADV_DONTNEED implicitly?
> If not would setting these help?
No. Readahead should be doing the right thing. Rik van Riel did some
work on drop behind for exactly this sort of case.
> I was following with you until this part. I thought sendfile() worked
> using mmap'd files and that readahead was done into the global page
> cache.
sendfile() uses the page cache directly, so it's like an mmap(), but it
does not carry the overhead associated with tlb manipulation.
> But this makes me think that read ahead is instead going into another
> pool. How large is this pool? The user space scheme is using 50MB of
> readahead cache, will the kernel do that much readahead if needed?
The kernel performs readahead using the system memory pool, which means
the VM gets involved and performs page reclaim to free up previously
cached pages.
> Does this scenario illustrate a problem with the current sendfile()
> implementation? I thought the goal of sendfile() was to always be the
> best way to send complete files. This is a case where user space is
> clearly beating sendfile().
Yes, this would be called a bug. =-)
-ben
--
"You know, I've seen some crystals do some pretty trippy shit, man."
Don't Email: <dont@kvack.org>.
next prev parent reply other threads:[~2006-01-22 3:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-20 21:53 sendfile() with 100 simultaneous 100MB files Jon Smirl
2006-01-21 2:22 ` Matti Aarnio
2006-01-21 3:43 ` Jon Smirl
2006-01-22 3:46 ` Benjamin LaHaise [this message]
2006-01-21 3:52 ` Phillip Susi
2006-01-22 14:24 ` Jim Nance
2006-01-22 17:31 ` Jon Smirl
2006-01-23 15:22 ` Jon Smirl
2006-01-24 16:30 ` Jon Smirl
2006-01-23 16:50 ` jerome lacoste
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=20060122034638.GA1008@kvack.org \
--to=bcrl@kvack.org \
--cc=jonsmirl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.aarnio@zmailer.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