From: Andi Kleen <andi@firstfloor.org>
To: "Martin A. Fink" <fink@mpe.mpg.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SATA-performance: Linux vs. FreeBSD
Date: 12 Feb 2007 18:04:57 +0100 [thread overview]
Message-ID: <p73abzji9xi.fsf@bingen.suse.de> (raw)
In-Reply-To: <200702121502.17130.fink@mpe.mpg.de>
"Martin A. Fink" <fink@mpe.mpg.de> writes:
>
> What I did:
> I wrote blocks of 1 MB size to file. Each 1 GB I made a fsync and took the
> time. For those tests with filesystems I wrote files of 1 GB size, otherwise
> I just wrote to the raw device.
Newer Linux versions depending on the disk and the file system will tell
the disk to flush the buffers to disk on fsync. FreeBSD might or might not
do that, but if it doesn't it would explain the difference.
>
> Results: -1-
>
> Test OpenSuSE(AHCI) FreeBSD(AHCI)
> ---------------------------------------------------------------------------------------------------------------------------------------
> SSD(vfat 25GB) 41+/-2 MB/s at 4-10% 15+/-0 MB/s at 2% CPU
vfat is certainly not a performance optimized file system.
> SSD(raw 25GB) 26+/-1 MB/s at 4-10% CPU 48+/-0 MB/s at 1% CPU
> SSD(ext3 25GB) 39+/-5 MB/s at 10-15% CPU 34+/-0 MB/s at 14% CPU
> SSD(ext2 25GB) 42+/-1 MB/s at 10-15% CPU 32+/-0 MB/s at 10% CPU
You could use oprofile (http://oprofile.sourceforge.net) to find out
where the CPU is being used.
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> Test OpenSuSE (AHCI off) FreeBSD (AHCI off)
> ---------------------------------------------------------------------------------------------------------------------------------------
> SSD(vfat 25GB) 22+/-4 MB/s at 6-19% CPU --
> SSD(raw 25GB) 33+/-4 MB/s at 7-14% CPU 41+/-0 MB/s at 1% CPU
I remember vaguely (but I might be wrong here) the standard block
character devices on FreeBSD are buffered, while raw is truly
unbuffered on Linux. Naive programs (no optimized IO threads or aio)
on truly unbuffered devices tend to perform poorly because they
don't do any write behind.
It might also useful if you post the libata related parts of your
boot log.
>
> Question 2:
> Can anybody explain to me, why writing to a solid state disk (a kind of memory
> that always has the same constant bandwidth) has such big standard errors in
> writing rate using Linux (between 1 to 6 MB/s error) while FreeBSD gives an
> almost constant writing rate (as one would expect it for a SSD) ?
Could be buffered vs unbuffered. Unbuffered single threaded writes
tend to be quite variable.
> Question 3:
> Why is writing to a raw device in Linux slower than using e.g. ext2 ? And why
> is Linux writing rate much lower (-12.5 % for the best case) compared to
> writing rate of FreeBSD?
It's really hard to make raw io perform well without complicated
efforts because nobody will hide the IO latencies. That is why
buffered IO is normally recommend
-Andi
next prev parent reply other threads:[~2007-02-12 16:04 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-12 14:02 SATA-performance: Linux vs. FreeBSD Martin A. Fink
2007-02-12 17:04 ` Andi Kleen [this message]
2007-02-12 16:27 ` Martin A. Fink
2007-02-12 18:41 ` Andi Kleen
2007-02-12 17:56 ` Martin A. Fink
2007-02-12 18:17 ` Ray Lee
2007-02-12 19:08 ` Alan
2007-02-12 20:34 ` Nigel Cunningham
2007-02-13 9:34 ` Martin A. Fink
2007-02-13 11:25 ` Alan
2007-02-13 12:32 ` Martin A. Fink
2007-02-13 14:47 ` Theodore Tso
2007-02-13 15:03 ` Alan
2007-02-13 17:12 ` Jeff Garzik
2007-02-12 23:31 ` Matthias Schniedermeyer
2007-02-13 9:25 ` Martin A. Fink
2007-02-13 10:08 ` Arjan van de Ven
2007-02-13 11:18 ` Andi Kleen
2007-02-13 10:25 ` Arjan van de Ven
2007-02-13 11:27 ` Alan
2007-02-13 11:59 ` Jörn Engel
2007-02-13 19:54 ` Jeffrey Hundstad
2007-02-13 10:16 ` Matthias Schniedermeyer
2007-02-13 10:29 ` Martin A. Fink
2007-02-13 12:04 ` Jörn Engel
2007-02-13 12:24 ` Matthias Schniedermeyer
2007-02-13 12:49 ` Martin A. Fink
2007-02-13 13:53 ` Matthias Schniedermeyer
2007-02-12 16:37 ` Martin A. Fink
2007-02-12 18:19 ` Stefan Richter
2007-02-13 19:09 ` Jeff Carr
2007-02-12 17:42 ` Martin A. Fink
2007-02-15 5:48 ` Tejun Heo
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=p73abzji9xi.fsf@bingen.suse.de \
--to=andi@firstfloor.org \
--cc=fink@mpe.mpg.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox