From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com, viro@ZenIV.linux.org.uk,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 00/45] Permit filesystem local caching [ver #41]
Date: Tue, 25 Nov 2008 00:09:04 +0000 [thread overview]
Message-ID: <5124.1227571744@redhat.com> (raw)
In-Reply-To: <20081121002847.c8fe7aef.akpm@linux-foundation.org>
Andrew Morton <akpm@linux-foundation.org> wrote:
> We would want to know the performance benefits in some detail before even
> looking at the code, no? Maybe they're in here somewhere but I missed it..
Okay... You wanted some benchmarks, here are some. I should try and automate
the procedure since it's pretty straightforward, just time consuming to do by
hand.
ENVIRONMENT
===========
I'm using a pair of computers, one an NFS server, the other an NFS client,
connected by ZyXEL PL-100 ethernet-over-mains adapters to throttle the network
bandwidth.
As far as I can tell, the TCP bandwidth as seen by a pair of netcats communing
with each other maxes out at about 890KB/s or 6.95 Mbits/s. Amazon rates the
PL-100's as up to 85Mbits/s, but I don't seem to be getting anything like that.
The client was rebooted after each test, but the server wasn't. The server was
persuaded to pull the entire working set for each test into RAM to eliminate
disk I/O latencies at that end.
The Ext3 partition used for the cache was tuned to have 4096-byte blocks.
During each run, a watch was put on the FS-Cache statistics on the client
machine:
watch -n0 cat /proc/fs/fscache/stats
This went over SSH to my desktop machine by GigE ethernet.
FIRST BENCHMARK
===============
The first benchmark involved pulling a 100MB file by NFS to the client using
cat to /dev/zero run under time as a test. The 'Time taken' reported by time
was logged. The benchmark was repeated three times and the average was taken:
Cache RUN #1 RUN #2 RUN #3 AVG
======= =============== =============== =============== ===============
SERVER 0m0.062s
NONE 1m59.462s 1m59.948s 2m1.852s 2.007 mins
COLD 1m58.448s 1m59.436s 2m5.746s 2.020 mins
HOT 0m2.235s 0m2.154s 0m2.171s 0.036 mins
PGCACHE 0m0.040s
Firstly the test was run on the server twice and the second result logged
(SERVER).
Secondly, the client was rebooted and the test was run with the cachefilesd not
started and that was logged (NONE). After rebooting, the cache contents were
erased (mke2fs) and cachefilesd was started and the test run again, which
loaded the cache (COLD). Then the box was rebooted, cachefilesd was started
and the test run a third time, this time with a populated cache (HOT). This
was repeated twice.
Finally, for reference, the client test was run again without unmounting,
stopping or rebooting anything so that the client's pagecache would act as the
cache (PGCACHE).
SECOND BENCHMARK
================
The second benchmark involved pulling a 256MB (as reported by du -s) kernel
tree or 1185 directories containing 19258 files using a single tar to /dev/zero
as a tesk. The 'Time taken' reported by time was logged. The benchmark was
repeated three times and the average was taken:
Cache RUN #1 RUN #2 RUN #3 AVG
======= =============== =============== =============== ===============
SERVER 0m0.348s
NONE 7m35.335s 7m42.075s 7m32.797s 7.612 mins
COLD 7m45.117s 7m54.774s 8m2.172s 7.900 mins
HOT 7m14.970s 7m10.953s 7m16.390s 7.235 mins
PGCACHE 3m10.864s
The procedure was as for the first benchmark.
For the second benchmark I also gathered data from the /proc/$$/mountstats file
to determine the network loading of run #3. The following table shows the
counts of three different RPC operations issued, and the number of bytes read
over the network as part of READ RPC operations:
Cache GETATTR (N) ACCESS (N) READ (N) READ (BYTES)
======= =============== =============== =============== ===============
NONE 22371 20486 21402 221252168
COLD 22411 20486 21402 221252168
HOT 22495 20481 0 0
CONCLUSION
==========
As can be seen, the network link I have between my test server and test client
is at about the break-even point for a large quantity of medium-small files (as
might be found in a source tree) with respect to the total time it takes to
completely read the files over NFS.
However, for those medium-small files, the reduction in network loading is huge
for repeat mass reads. The time went from 7.6mins to 7.2mins, which is nice
but not hugely significant, but the network loading dropped by ~21,000 RPC
operations at a grand total of >220MB of data on the wire, allowing for network
metadata, within those 7 minutes.
For fewer but much larger files the cache has a proportionately greater effect
as the client incurs lower costs from Ext3 lookups as it is doing many fewer of
them, but gains greatly from Ext3's ability to glue large groups of contiguous
reads together and to do lookahead. Similarly to the previous case, having
this data in the cache will reduce the network loading for repeat reads.
A comparison of the second benchmark test run against the server's pagecache
versus that test run against the client's pagecache is quite interesting. The
server can perform the tar in a third of a second, but the client takes over
three minutes.
That would indicate that something on the order of just over 3 minutes's worth
of time is spent by each of the NONE, COLD and HOT test runs doing things other
than reads. That would be GETATTR, ACCESS, and READDIRPLUS ops.
Another way of looking at it is that the NONE test or the second test spends a
little over 4 minutes doing READ ops from the network, and that the HOT test
spends almost as much time doing lookup, getxattr and read ops against Ext3.
It's also worth noting that the neither benchmark did the COLD test take very
much more time than the NONE test, despite doing lookups, mkdirs, creates,
setxattrs and writes in the background.
Of course, these two benchmarks are very much artificial: there was no other
significant loading on the network between the client and the server; there was
no other significant load on either machine; the cache started out empty and
probably got loaded in optimal order; the cache was large enough to never need
culling; only one program (cat or tar) was run at once.
David
next prev parent reply other threads:[~2008-11-25 0:09 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 14:41 [PATCH 00/45] Permit filesystem local caching [ver #41] David Howells
2008-11-20 14:41 ` [PATCH 01/45] Create a dynamically sized pool of threads for doing very slow work items " David Howells
2008-11-21 8:09 ` Andrew Morton
2008-11-21 10:24 ` David Howells
2008-11-21 18:17 ` Andrew Morton
2008-11-22 0:38 ` David Howells
2008-12-19 4:14 ` Serge E. Hallyn
2008-12-19 4:19 ` Serge E. Hallyn
2008-12-19 7:15 ` Andrew Morton
2008-12-19 11:42 ` David Howells
2008-12-19 11:44 ` David Howells
2008-12-19 12:12 ` David Howells
2008-12-19 16:52 ` Serge E. Hallyn
2008-12-19 12:54 ` David Howells
2008-11-20 14:41 ` [PATCH 02/45] Make slow-work thread pool actually dynamic " David Howells
2008-12-19 17:58 ` Serge E. Hallyn
2008-11-20 14:41 ` [PATCH 03/45] Make the slow work pool configurable " David Howells
2008-12-19 18:33 ` Serge E. Hallyn
2008-11-20 14:42 ` [PATCH 04/45] Document the slow work thread pool " David Howells
2008-11-20 14:42 ` [PATCH 05/45] FS-Cache: Release page->private after failed readahead " David Howells
2008-11-21 8:12 ` Andrew Morton
2008-11-21 10:27 ` David Howells
2008-11-20 14:42 ` [PATCH 06/45] FS-Cache: Recruit a couple of page flags for cache management " David Howells
2008-11-21 8:17 ` Andrew Morton
2008-11-21 10:31 ` David Howells
2008-11-20 14:42 ` [PATCH 07/45] FS-Cache: Provide an add_wait_queue_tail() function " David Howells
2008-11-21 8:17 ` Andrew Morton
2008-11-21 13:32 ` David Howells
2008-11-20 14:42 ` [PATCH 08/45] FS-Cache: Add the FS-Cache netfs API and documentation " David Howells
2008-11-20 14:42 ` [PATCH 09/45] FS-Cache: Add the FS-Cache cache backend " David Howells
2008-11-20 14:42 ` [PATCH 10/45] FS-Cache: Add main configuration option, module entry points and debugging " David Howells
2008-11-20 14:42 ` [PATCH 11/45] FS-Cache: Add use of /proc and presentation of statistics " David Howells
2008-11-21 0:15 ` Alexey Dobriyan
2008-11-21 2:17 ` David Howells
2008-11-21 2:34 ` Alexey Dobriyan
2008-11-21 15:32 ` David Howells
2008-11-20 14:42 ` [PATCH 12/45] FS-Cache: Root index definition " David Howells
2008-11-20 14:42 ` [PATCH 13/45] FS-Cache: Add cache tag handling " David Howells
2008-11-20 14:42 ` [PATCH 14/45] FS-Cache: Add cache management " David Howells
2008-11-20 14:42 ` [PATCH 15/45] FS-Cache: Provide a slab for cookie allocation " David Howells
2008-11-20 14:43 ` [PATCH 16/45] FS-Cache: Add netfs registration " David Howells
2008-11-20 14:43 ` [PATCH 17/45] FS-Cache: Bit waiting helpers " David Howells
2008-11-20 14:43 ` [PATCH 18/45] FS-Cache: Object management state machine " David Howells
2008-11-20 14:43 ` [PATCH 19/45] FS-Cache: Implement the cookie management part of the netfs API " David Howells
2008-11-20 14:43 ` [PATCH 20/45] FS-Cache: Add and document asynchronous operation handling " David Howells
2008-11-20 14:43 ` [PATCH 21/45] FS-Cache: Implement data I/O part of netfs API " David Howells
2008-11-20 14:43 ` [PATCH 22/45] CacheFiles: Add missing copy_page export for ia64 " David Howells
2008-11-20 14:43 ` [PATCH 23/45] CacheFiles: Be consistent about the use of mapping vs file->f_mapping in Ext3 " David Howells
2008-11-22 17:38 ` Andreas Dilger
2008-11-26 14:40 ` David Howells
2008-11-20 14:43 ` [PATCH 24/45] CacheFiles: Add a hook to write a single page of data to an inode " David Howells
2008-11-21 8:23 ` Andrew Morton
2008-11-21 12:43 ` David Howells
2008-11-21 13:00 ` Jamie Lokier
2008-11-21 17:15 ` Valdis.Kletnieks
2008-11-21 17:36 ` Randy Dunlap
2008-11-21 18:31 ` Andrew Morton
2008-11-22 0:48 ` David Howells
2008-11-20 14:43 ` [PATCH 25/45] CacheFiles: Permit the page lock state to be monitored " David Howells
2008-11-20 14:43 ` [PATCH 26/45] CacheFiles: Export things for CacheFiles " David Howells
2008-11-20 14:43 ` [PATCH 27/45] CacheFiles: A cache that backs onto a mounted filesystem " David Howells
2008-11-20 14:44 ` [PATCH 28/45] FS-Cache: Make kAFS use FS-Cache " David Howells
2008-11-20 14:44 ` [PATCH 29/45] NFS: Add comment banners to some NFS functions " David Howells
2008-11-20 14:44 ` [PATCH 30/45] NFS: Add FS-Cache option bit and debug bit " David Howells
2008-11-20 14:44 ` [PATCH 31/45] NFS: Permit local filesystem caching to be enabled for NFS " David Howells
2008-11-20 14:44 ` [PATCH 32/45] NFS: Register NFS for caching and retrieve the top-level index " David Howells
2008-11-20 14:44 ` [PATCH 33/45] NFS: Define and create server-level objects " David Howells
2008-11-20 14:44 ` [PATCH 34/45] NFS: Define and create superblock-level " David Howells
2008-11-20 14:44 ` [PATCH 35/45] NFS: Define and create inode-level cache " David Howells
2008-11-20 14:44 ` [PATCH 36/45] NFS: Use local disk inode cache " David Howells
2008-11-20 14:44 ` [PATCH 37/45] NFS: Invalidate FsCache page flags when cache removed " David Howells
2008-11-20 14:44 ` [PATCH 38/45] NFS: Add some new I/O counters for FS-Cache doing things for NFS " David Howells
2008-11-20 14:45 ` [PATCH 39/45] NFS: FS-Cache page management " David Howells
2008-11-20 14:45 ` [PATCH 40/45] NFS: Add read context retention for FS-Cache to call back with " David Howells
2008-11-20 14:45 ` [PATCH 41/45] NFS: nfs_readpage_async() needs to be accessible as a fallback for local caching " David Howells
2008-11-20 14:45 ` [PATCH 42/45] NFS: Read pages from FS-Cache into an NFS inode " David Howells
2008-11-20 14:45 ` [PATCH 43/45] NFS: Store pages from an NFS inode into a local cache " David Howells
2008-11-20 14:45 ` [PATCH 44/45] NFS: Display local caching state " David Howells
2008-11-20 14:45 ` [PATCH 45/45] NFS: Add mount options to enable local caching on NFS " David Howells
2008-11-21 8:28 ` [PATCH 00/45] Permit filesystem local caching " Andrew Morton
2008-11-22 1:11 ` David Howells
2008-11-25 0:09 ` David Howells [this message]
2008-11-25 13:39 ` FS-Cache Benchmarks David Howells
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=5124.1227571744@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).