From: Matthias Schniedermeyer <ms@citd.de>
To: Steve Bergman <sbergman27@gmail.com>
Cc: linux-xfs@oss.sgi.com
Subject: Re: Questions about XFS
Date: Tue, 11 Jun 2013 23:57:16 +0200 [thread overview]
Message-ID: <20130611215716.GA6935@citd.de> (raw)
In-Reply-To: <CAO9HMNEt4XKdV6+jfKwHVPrDaVNytx65MQDK52Uckcy-O6YikQ@mail.gmail.com>
On 11.06.2013 14:55, Steve Bergman wrote:
> Hi Ben,
>
> /usr/local/data - Ext3 (Cobol doesn't know about fsync. I need
> pony-magic in this LV.)
You COULD do a little magic external of the program to expedite writing
to stable storage.
- fsync_test.pl -
#!/usr/bin/perl
use File::Sync qw(fsync);
open my $fh, '<', 'testfile' or die ("Can't open: $!");
fsync($fh) or die ("Can't fsync: $!");
close $fh;
- fsync_test.pl -
- fsync_test.sh -
rm -f testfile
echo -n sync: ; time sync
echo ; echo -n dd: ; time dd if=/dev/zero of=testfile bs=1M count=1k
echo ; echo -n fsync_test.pl: ; time ./fsync_test.pl
echo ; echo -n sync: ; time sync
- fsync_test.sh -
The result on my machine against a HDD:
- result -
sync:
real 0m0.048s
user 0m0.000s
sys 0m0.046s
dd:
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.317354 s, 3.4 GB/s
real 0m0.318s
user 0m0.001s
sys 0m0.316s
fsync_test.pl:
real 0m10.237s
user 0m0.012s
sys 0m0.133s
sync:
real 0m0.047s
user 0m0.000s
sys 0m0.045s
- result -
This tells me that a program can fsync a file i didn't write itself.
I choose 1GB because it can be created fast enough to not trigger any
automatic writebacks (And with 32GB of RAM it is well within default
limits) and still long enough to be easily visible with simple
'time'ing.
With secret ingredient number 2, inotify, you COULD write a program that
does 'fsync'(s) after the program that can't do it itself. Of course
that can only expedite matters, it doesn't give you the same consistency
guarantees as the original program isn't the one waiting for the
fsync(s) to complete and happily continues dirtying more data in the
mean time.
And there also is syncfs which is relativly new (man-page says it was
introduced with kernel 2.6.39). 'syncfs' is a lighter version of 'sync'
that only syncs a single filesystem. So you could make a program that
does a syncfs every second or so (with the help of inotify you could do
it after something "interesting" was written), without impacting other
filesystems like 'sync' does.
--
Matthias
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-06-11 21:57 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 9:56 Questions about XFS Steve Bergman
2013-06-11 13:10 ` Emmanuel Florac
2013-06-11 13:35 ` Stefan Ring
2013-06-11 13:52 ` Ric Wheeler
2013-06-11 13:59 ` Ric Wheeler
2013-06-11 16:12 ` Steve Bergman
2013-06-11 17:19 ` Ric Wheeler
2013-06-11 17:27 ` Stefan Ring
2013-06-11 17:31 ` Ric Wheeler
2013-06-11 17:41 ` Stefan Ring
2013-06-11 18:03 ` Eric Sandeen
2013-06-11 19:30 ` Steve Bergman
2013-06-11 21:03 ` Dave Chinner
2013-06-11 21:43 ` Steve Bergman
2013-06-11 17:59 ` Ben Myers
2013-06-11 17:28 ` Eric Sandeen
2013-06-11 19:17 ` Steve Bergman
2013-06-11 21:47 ` Dave Chinner
2013-07-22 14:59 ` Steve Bergman
2013-07-22 15:16 ` Steve Bergman
2013-06-12 8:26 ` Roger Oberholtzer
2013-06-12 10:34 ` Ric Wheeler
2013-06-12 13:52 ` Roger Oberholtzer
2013-06-12 12:12 ` Stan Hoeppner
2013-06-12 13:48 ` Roger Oberholtzer
2013-06-13 0:48 ` Dave Chinner
2013-06-11 19:35 ` Ben Myers
2013-06-11 19:55 ` Steve Bergman
2013-06-11 20:08 ` Ben Myers
2013-06-11 21:57 ` Matthias Schniedermeyer [this message]
2013-06-11 22:18 ` Steve Bergman
-- strict thread matches above, loose matches on Subject: below --
2013-10-25 14:28 harryxiyou
2013-10-25 14:42 ` Emmanuel Florac
2013-10-25 14:57 ` Eric Sandeen
2013-10-25 16:24 ` harryxiyou
2013-10-25 16:44 ` harryxiyou
2013-10-26 10:41 ` Stan Hoeppner
2013-10-27 3:29 ` Eric Sandeen
2013-10-25 16:13 ` harryxiyou
2013-10-25 16:16 ` Eric Sandeen
2007-03-13 13:40 clflush
2007-03-13 15:36 ` Klaus Strebel
2007-03-13 15:53 ` Stein M. Hugubakken
2007-03-13 15:55 ` Eric Sandeen
2007-03-14 16:33 ` Stewart Smith
2007-03-15 4:26 ` Taisuke Yamada
2007-03-15 9:07 ` clflush
2007-03-15 14:41 ` Geir A. Myrestrand
2007-03-16 10:36 ` Martin Steigerwald
2007-03-17 0:47 ` Jason White
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=20130611215716.GA6935@citd.de \
--to=ms@citd.de \
--cc=linux-xfs@oss.sgi.com \
--cc=sbergman27@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox