Reiserfs is order of magnitude faster for fsync of large files than ext2

Hans Reiser (reiser@idiom.com)
Mon, 22 Feb 1999 11:08:31 -0800


This is a multi-part message in MIME format.
--------------B391F69E27AFD0A6D5B0BF4C
Content-Type: multipart/alternative;
boundary="------------5B978330EAEF258EAE4229C4"

--------------5B978330EAEF258EAE4229C4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I know this has been a linux-kernel topic recently, so I asked Yura to test it.

Yura, I like your method of flushing the cache, maybe we should use it in other benchmarks.....

Best,

Hans

--
Don't be locked out of the source, and doomed to life in the slow lane.
Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS
 (http://devlinux.org/namesys).  If you sell an OS or
internet appliance, buy a port of ReiserFS!
Speed matters.  Trees are fast.  Go faster!

--------------5B978330EAEF258EAE4229C4 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> I know this has been a linux-kernel topic recently, so I asked Yura to test it.

Yura, I like your method of flushing the cache, maybe we should use it in other benchmarks.....

Best,

Hans

-- 
Don't be locked out of the source, and doomed to life in the slow lane.
Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS
 (http://devlinux.org/namesys).  If you sell an OS or
internet appliance, buy a port of ReiserFS!
Speed matters.  Trees are fast.  Go faster!
  --------------5B978330EAEF258EAE4229C4-- --------------B391F69E27AFD0A6D5B0BF4C Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: yura@namesys.botik.ru Received: from select.botik.ru (root@select.botik.ru [193.232.174.49]) by idiom.com (8.8.8/8.8.5) with ESMTP id FAA09552 for ; Mon, 22 Feb 1999 05:50:10 -0800 (PST) Received: from namesys.botik.ru (really [127.0.0.1]) by select.botik.ru via smail with esmtp (ident root using rfc1413) id (Debian Smail3.2.0.101) for ; Mon, 22 Feb 1999 17:29:08 +0300 (MSK) Sender: root@namesys.botik.ru Message-ID: <36D169A2.B4DAF12E@namesys.botik.ru> Date: Mon, 22 Feb 1999 17:28:51 +0300 From: "Yury Y.Rupasov" X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.2.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: Hans Reiser , vs@namesys.botik.ru Subject: Re: fsync on large files References: <36CC0AD0.E4C7D3C8@bibliotech.co.uk> <7ahnvm$4an$1@palladium.transmeta.com> <36CC71BB.BCD4A086@step.es> <36CD2E45.F2EF418F@idiom.com> <36CDA9E3.B4A04F18@namesys.botik.ru> <36CF896D.E1DDD886@idiom.com> Content-Type: multipart/alternative; boundary="------------2DD0F3558B5E0D45D7EB2B2A" X-Mozilla-Status2: 00000000 --------------2DD0F3558B5E0D45D7EB2B2A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hans Reiser wrote: > This is not what I meant. I meant what is the time to use the system > call fsync on a 500mb file when a few of its blocks are dirty. > This affects database performance, syslog performance, etc. Here is the fsync time of 500mb file when any file parts are out of cache. reiserfs 1.768 seconds ext2 15.625 seconds ext2fs_fsync_time / reiserfs_fsync_time = 8.838 Fsync time are almost the same for both file systems when file has been accessed recently. So, for the case, when there are only few dirty blocks of file the results will be between these points. I wrote the program fsync, did mkreiserfs, mount, make_file f500 (size=500MB), then : $cat /dev/hda5 >/dev/null $time fsync /testfs/f500 Then I did the same for ext2fs. Without "cat /dev/hda5 >/dev/null " reiserfs and ext2fs do fsync < 1 second (reiserfs=0.273, ext2fs=0.554). fsync.c int main(int argc, char** argv) { int fd; fd = open (argv[1], O_RDWR, 0777); printf("time_before_fsync: %u\n",time(NULL)); fsync(fd); printf("time_after_fsync: %u\n",time(NULL)); close(fd); } best, Yura. > > >> Hello, Hans >> >> See attached files for test source. >> >> reiserfs create 500mb file >> real 159.42 >> user 19.08 >> sys 59.83 >> >> reiserfs remove 500mb file >> real 0.78 >> user 0.03 >> sys 0.35 >> >> ext2fs create 500mb file >> real 161.10 >> user 29.46 >> sys 71.53 >> >> ext2fs remove 500mb file >> real 2.30 >> user 0.04 >> sys 0.61 >> >> best, >> Yura. >> >> Hans Reiser wrote: >> >> > Yura, would you measure our performance when doing fsync on a 500mb >> > file, and compare it to ext2? >> > fsync performance is a current linux kernel thread.... >> > I have no idea what it is for reiserfs.... >> > >> > Thanks, >> > >> > Hans >> > >> > "Manuel J. Galan" wrote: >> > >> >> What happened with ReiserFS ? >> >> >> >> - >> >> To unsubscribe from this list: send the line "unsubscribe >> >> linux-kernel" in >> >> the body of a message to majordomo@vger.rutgers.edu >> >> Please read the FAQ at http://www.tux.org/lkml/ >> > >> > Hans >> > >> > -- >> > Don't be locked out of the source, and doomed to life in the slow lane. >> > Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS >> > (http://devlinux.org/namesys). If you sell an OS or >> > internet appliance, buy a port of ReiserFS! >> > Speed matters. Trees are fast. Go faster! >> > >> > >> >> -------------------------------------------------------------- >> #!/bin/bash >> >> if [ $# -lt 1 ] >> then >> echo Usage: sync_test log_file_name >> exit >> fi >> >> LOGFILE=$1 >> >> umount /testfs >> mkreiserfs /dev/hda5 >> mount -t reiserfs /dev/hda5 /testfs >> >> echo "reiserfs create 500mb file">> $LOGFILE >> (time -p create_file )>> $LOGFILE 2>&1 >> >> echo "reiserfs remove 500mb file">> $LOGFILE >> (time -p remove_file )>> $LOGFILE 2>&1 >> >> sleep 30 >> umount /testfs >> mke2fs /dev/hda5 >> mount -t ext2 /dev/hda5 /testfs >> >> echo "ext2fs create 500mb file">> $LOGFILE >> (time -p create_file )>> $LOGFILE 2>&1 >> >> echo "ext2fs remove 500mb file">> $LOGFILE >> (time -p remove_file )>> $LOGFILE 2>&1 >> >> -------------------------------------------------------------- >> #!/bin/bash >> mkfile /testfs/f500mb 524288000 1048576 >> sync >> >> -------------------------------------------------------------- >> #!/bin/bash >> rm /testfs/f500mb >> sync >> > -- > Don't be locked out of the source, and doomed to life in the slow lane. > Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS > (http://devlinux.org/namesys). If you sell an OS or > internet appliance, buy a port of ReiserFS! > Speed matters. Trees are fast. Go faster! > > --------------2DD0F3558B5E0D45D7EB2B2A Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hans Reiser wrote:
This is not what I meant.  I meant what is the time to use the system call fsync on a 500mb file when a few of its blocks are dirty.
This affects database performance, syslog performance, etc.
Here is the fsync time of 500mb file when any file parts are out of cache.

reiserfs    1.768 seconds
ext2        15.625 seconds
ext2fs_fsync_time  /  reiserfs_fsync_time = 8.838

Fsync time are almost the same for both file systems when file has been accessed recently.
So, for the case, when there are only few dirty blocks of file the results will be between these points.

I wrote the program fsync,  did mkreiserfs, mount, make_file f500 (size=500MB), then  :

$cat  /dev/hda5 >/dev/null
$time fsync /testfs/f500

Then I did the same for ext2fs.

Without  "cat  /dev/hda5  >/dev/null "  reiserfs and ext2fs do fsync  < 1 second (reiserfs=0.273, ext2fs=0.554).

fsync.c
int main(int argc, char** argv)
{
  int fd;
  fd = open (argv[1], O_RDWR, 0777);
 
  printf("time_before_fsync: %u\n",time(NULL));
  fsync(fd);
  printf("time_after_fsync: %u\n",time(NULL));

  close(fd);
}

best,
Yura.

 
Hello, Hans

See attached files for test source.

reiserfs create 500mb file
real 159.42
user 19.08
sys 59.83

reiserfs remove 500mb file
real 0.78
user 0.03
sys 0.35

ext2fs create 500mb file
real 161.10
user 29.46
sys 71.53

ext2fs remove 500mb file
real 2.30
user 0.04
sys 0.61

best,
Yura.

Hans Reiser wrote:

Yura, would you measure our performance when doing fsync on a 500mb file, and compare it to ext2?
fsync performance is a current linux kernel thread....
I have no idea what it is for reiserfs....

Thanks,

Hans

"Manuel J. Galan" wrote:

What happened with ReiserFS ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

Hans
-- 
Don't be locked out of the source, and doomed to life in the slow lane.
Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS
 (http://devlinux.org/namesys).  If you sell an OS or
internet appliance, buy a port of ReiserFS!
Speed matters.  Trees are fast.  Go faster!
 

#!/bin/bash if [ $# -lt 1 ] then        echo Usage: sync_test log_file_name         exit fi LOGFILE=$1 umount /testfs mkreiserfs /dev/hda5 mount -t reiserfs /dev/hda5 /testfs echo "reiserfs create 500mb file">> $LOGFILE (time -p create_file )>> $LOGFILE 2>&1 echo "reiserfs remove 500mb file">> $LOGFILE (time -p remove_file )>> $LOGFILE 2>&1 sleep 30 umount /testfs mke2fs /dev/hda5 mount -t ext2 /dev/hda5 /testfs echo "ext2fs create 500mb file">> $LOGFILE (time -p create_file )>> $LOGFILE 2>&1 echo "ext2fs remove 500mb file">> $LOGFILE (time -p remove_file )>> $LOGFILE 2>&1

#!/bin/bash mkfile /testfs/f500mb 524288000 1048576 sync

#!/bin/bash rm /testfs/f500mb  sync
-- 
Don't be locked out of the source, and doomed to life in the slow lane.
Dump NT! Get Linux (http://www.kernel.org) plus ReiserFS
 (http://devlinux.org/namesys).  If you sell an OS or
internet appliance, buy a port of ReiserFS!
Speed matters.  Trees are fast.  Go faster!
 

--------------2DD0F3558B5E0D45D7EB2B2A--

--------------B391F69E27AFD0A6D5B0BF4C--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/