From: John Spray <john.spray@redhat.com>
To: Barclay Jameson <almightybeeij@gmail.com>,
Gregory Farnum <greg@gregs42.com>
Cc: "Yan, Zheng" <ukernel@gmail.com>,
"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: Slow file creating and deleting using bonnie ++ on Hammer
Date: Tue, 26 May 2015 16:40:42 +0100 [thread overview]
Message-ID: <556493FA.3020600@redhat.com> (raw)
In-Reply-To: <CAMzumdZsGzykN4=t6QeqhG5Y=xge1+oWi-75PBUCi2xkE4NEbQ@mail.gmail.com>
On 26/05/2015 15:50, Barclay Jameson wrote:
> Thank you for the great explanation Zheng! That definitely shows what
> I was seeing with the bonnie++ test. What bad things would happen if I
> modified the config option mds_tick_interval to flush the journal to a
> second or less?
The MDS does various pieces of housekeeping according to that interval,
so setting it extremely low will cause some CPU cycles to be wasted, and
flushing the log more often will cause a larger number of smaller IOs to
get generated. I would be very surprised if decreasing it to approx 1s
was harmful though.
On a busy real world system, other metadata operations will often drive
log writes through faster than waiting for a tick.
> Does this also mean any custom code written should
> avoid use of fsync() if writing a large number of files?
You should call it only when your application requires it for
consistency, and always expect it to be a high latency operation. Add up
the latency from your client to your server and from the server to the
disk, and the length of the IO queue on the disk, and then the return
leg -- that is the *minimum* time you should expect to wait for an fsync.
For example, a real world workload creating N files in a directory would
hopefully call fsync on the directory once at the end, rather than in
between every file, unless you really do need to be sure that the dentry
for the preceding file will be persistent before you start writing the
next file.
Sometimes it's easier to reason about it in terms of concurrency: if you
have a bunch of IOs that you could safely run in parallel in a thread
each, then you shouldn't be fsyncing between them, just at the point you
join them.
John
next prev parent reply other threads:[~2015-05-26 15:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 18:15 Slow file creating and deleting using bonnie ++ on Hammer Barclay Jameson
2015-05-20 18:22 ` Gregory Farnum
2015-05-20 19:00 ` Barclay Jameson
2015-05-22 15:25 ` Barclay Jameson
2015-05-22 15:34 ` John Spray
2015-05-22 17:34 ` Barclay Jameson
2015-05-26 6:55 ` Yan, Zheng
2015-05-26 11:57 ` John Spray
2015-05-26 14:08 ` Mark Nelson
2015-05-26 14:30 ` Gregory Farnum
2015-05-26 14:50 ` Barclay Jameson
2015-05-26 15:40 ` John Spray [this message]
2015-05-26 15:54 ` Barclay Jameson
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=556493FA.3020600@redhat.com \
--to=john.spray@redhat.com \
--cc=almightybeeij@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=greg@gregs42.com \
--cc=ukernel@gmail.com \
/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.