From: Shaohua Li <shaohua.li@intel.com>
To: linux-btrfs@vger.kernel.org
Cc: chris.mason@oracle.com, jens.axboe@oracle.com,
fengguang.wu@intel.com, shaohua.li@intel.com
Subject: btrfs: why default 4M readahead size?
Date: Thu, 18 Mar 2010 09:42:57 +0800 [thread overview]
Message-ID: <20100318014257.GA30963@sli10-desk.sh.intel.com> (raw)
Btrfs uses below equation to calculate ra_pages:
fs_info->bdi.ra_pages = max(fs_info->bdi.ra_pages,
4 * 1024 * 1024 / PAGE_CACHE_SIZE);
is the max() a typo of min()? This makes the readahead size is 4M by default,
which is too big.
I have a system with 16 CPU, 6G memory and 12 sata disks. I create a btrfs for
each disk, so this isn't a raid setup. The test is fio, which has 12 tasks to
access 12 files for each disk. The fio test is mmap sequential read. I measure
the performance with different readahead size:
ra size io throughput
4M 268288 k/s
2M 367616 k/s
1M 431104 k/s
512K 474112 k/s
256K 512000 k/s
128K 538624 k/s
The 4M default readahead size has poor performance.
I also does sync sequential read test, the test difference in't that big. But
the 4M case still has about 10% drop compared to the 512k case.
One might argue how about the case memory isn't tight. I tried only run a
one-disk setup with only one task. The 4M ra almost has no difference with the
128K ra. I guess the 128k default ra size for backing dev is carefuly choosed
to work with popular disks.
So my question is why we have a default 4M readahead size even with noraid case?
Thanks,
Shaohua
next reply other threads:[~2010-03-18 1:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-18 1:42 Shaohua Li [this message]
2010-03-18 12:53 ` btrfs: why default 4M readahead size? Chris Mason
2010-03-19 0:59 ` Shaohua Li
2010-03-19 2:56 ` Shaohua Li
2010-03-19 8:22 ` Jens Axboe
2010-03-19 9:29 ` Shaohua Li
2010-03-19 12:57 ` Jens Axboe
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=20100318014257.GA30963@sli10-desk.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=chris.mason@oracle.com \
--cc=fengguang.wu@intel.com \
--cc=jens.axboe@oracle.com \
--cc=linux-btrfs@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.