From: Piavlo <piavka@cs.bgu.ac.il>
To: linux-btrfs@vger.kernel.org
Subject: Re: high cpu load for random write
Date: Wed, 01 Jul 2009 11:30:23 +0300 [thread overview]
Message-ID: <4A4B1E9F.1070201@cs.bgu.ac.il> (raw)
In-Reply-To: <20090630134103.GB8345@think>
Hi Chris,
I've tried a test with mount -o nodatacow and see no noticeable
difference in cpu load.
Results with -o nodatacow (dmesg confirms "btrfs: setting nodatacow")
Tiotest results for 1 concurrent io threads:
,----------------------------------------------------------------------.
| Item | Time | Rate | Usr CPU | Sys CPU |
+-----------------------+----------+--------------+----------+---------+
| Write 9000 MBs | 195.7 s | 45.984 MB/s | 0.8 % | 39.2 % |
| Random Write 59 MBs | 23.7 s | 2.470 MB/s | 0.1 % | 91.6 % |
| Read 9000 MBs | 189.3 s | 47.538 MB/s | 0.6 % | 11.6 % |
| Random Read 59 MBs | 124.8 s | 0.470 MB/s | 0.0 % | 1.0 % |
`----------------------------------------------------------------------'
Tiotest latency results:
,-------------------------------------------------------------------------.
| Item | Average latency | Maximum latency | % >2 sec | % >10 sec |
+--------------+-----------------+-----------------+----------+-----------+
| Write | 0.079 ms | 3521.734 ms | 0.00009 | 0.00000 |
| Random Write | 0.021 ms | 0.449 ms | 0.00000 | 0.00000 |
| Read | 0.082 ms | 308.059 ms | 0.00000 | 0.00000 |
| Random Read | 8.318 ms | 31.541 ms | 0.00000 | 0.00000 |
|--------------+-----------------+-----------------+----------+-----------|
| Total | 0.107 ms | 3521.734 ms | 0.00004 | 0.00000 |
`--------------+-----------------+-----------------+----------+-----------'
Resutls without -o nodatacow
Tiotest results for 1 concurrent io threads:
,----------------------------------------------------------------------.
| Item | Time | Rate | Usr CPU | Sys CPU |
+-----------------------+----------+--------------+----------+---------+
| Write 9000 MBs | 199.4 s | 45.130 MB/s | 0.6 % | 39.1 % |
| Random Write 59 MBs | 23.8 s | 2.457 MB/s | 0.1 % | 92.1 % |
| Read 9000 MBs | 187.1 s | 48.110 MB/s | 0.5 % | 11.9 % |
| Random Read 59 MBs | 125.7 s | 0.466 MB/s | 0.0 % | 1.1 % |
`----------------------------------------------------------------------'
Tiotest latency results:
,-------------------------------------------------------------------------.
| Item | Average latency | Maximum latency | % >2 sec | % >10 sec |
+--------------+-----------------+-----------------+----------+-----------+
| Write | 0.081 ms | 3608.655 ms | 0.00026 | 0.00000 |
| Random Write | 0.021 ms | 1.032 ms | 0.00000 | 0.00000 |
| Read | 0.081 ms | 252.264 ms | 0.00000 | 0.00000 |
| Random Read | 8.376 ms | 192.319 ms | 0.00000 | 0.00000 |
|--------------+-----------------+-----------------+----------+-----------|
| Total | 0.107 ms | 3608.655 ms | 0.00013 | 0.00000 |
`--------------+-----------------+-----------------+----------+-----------'
Alex
Chris Mason wrote:
> There are two causes of the high CPU load. The first is data
> checksumming (which is constant for creating the file and for random
> writes) and the second is the cost of maintaining back references for
> the file data extent.
>
> In btrfs, we track the owners of each extent, which makes repair, volume
> management and other things much easier. Small random writes make for a
> lot of extents, and so they also make for a lot of tracking.
>
> In general, you'll find that mount -o ssd will be faster here, just
> because it forces the allocator into more sequential allocations for
> this workload.
>
> You'll find that mount -o nodatacow uses much less CPU time, but this
> disables checksumming and a few other advanced features.
>
> -chris
>
next prev parent reply other threads:[~2009-07-01 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 12:54 high cpu load for random write Piavlo
2009-06-30 13:41 ` Chris Mason
2009-07-01 8:30 ` Piavlo [this message]
2009-07-01 15:53 ` Chris Mason
2009-07-01 8:51 ` Piavlo
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=4A4B1E9F.1070201@cs.bgu.ac.il \
--to=piavka@cs.bgu.ac.il \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox