summaryrefslogtreecommitdiffstats
path: root/results.txt
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2009-03-02 13:07:29 +0530
committerAmit Shah <amit.shah@redhat.com>2009-03-02 13:07:29 +0530
commit23bd4be5b74f227ceb073f8da213708d5ded2af8 (patch)
tree9a940b4bf03f2e8374fc84dcadacd5544a19e54a /results.txt
downloadalloc-perf-23bd4be5b74f227ceb073f8da213708d5ded2af8.tar.gz
alloc-perf-23bd4be5b74f227ceb073f8da213708d5ded2af8.tar.xz
alloc-perf-23bd4be5b74f227ceb073f8da213708d5ded2af8.zip
First version of file allocation perf measuring program
This program measures performance of creating a file and zeroing it using a few different methods: 1. using the posix_fallocate() syscall 2. using mmap() and then memset() 3. writing chunks to the file (currently 4k and 8k-sized chunks) directly calling the Linux fallocate() syscall doesn't yet work; a bug has been filed earlier for this in the Red Hat Bugzilla, #485487 A few results from running this program on my laptop and on my desktop are put in the results.txt file. Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'results.txt')
-rw-r--r--results.txt257
1 files changed, 257 insertions, 0 deletions
diff --git a/results.txt b/results.txt
new file mode 100644
index 0000000..3618ec5
--- /dev/null
+++ b/results.txt
@@ -0,0 +1,257 @@
+-- These tests conducted on a laptop --
+
+1st run, with only posix-fallocate on ext3
+$ ./test-file-zero-speed
+seconds:microseconds: 1235557175:156446
+seconds:microseconds: 1235557212:186703
+
+-------------------------------------------------------------------
+
+2nd run, same program as above
+$ ./test-file-zero-speed
+seconds:microseconds: 1235557363:187840
+seconds:microseconds: 1235557396:43475
+
+-------------------------------------------------------------------
+
+3rd run, same program (with no printf between gtod() and actual call)
+$ ./test-file-zero-speed
+posix-fallocate run time:
+ seconds:microseconds: 1235558782:292459
+ seconds:microseconds: 1235558816:331028
+ (approx 34s)
+$ sudo filefrag ../tmp/10gfile-pf
+../tmp/10gfile-pf: 134 extents found, perfection would be 9 extents
+
+-------------------------------------------------------------------
+
+With all three:
+$ ./test-file-zero-speed
+posix-fallocate run time:
+ seconds:microseconds: 1235569716:953548
+ seconds:microseconds: 1235569749:595276
+ (approx 33s)
+mmap run time:
+ seconds:microseconds: 1235569749:595577
+ seconds:microseconds: 1235569789:622942
+ (approx 40s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235569791:134534
+ seconds:microseconds: 1235569839:132586
+ (approx 48s)
+$ sudo filefrag ../tmp/*
+../tmp/file-chunk: 57 extents found, perfection would be 9 extents
+../tmp/file-mmap: 106 extents found, perfection would be 9 extents
+../tmp/file-pf: 132 extents found, perfection would be 9 extents
+
+-------------------------------------------------------------------
+
+Added free(), 8k-chunk, close(fd) in time calculation
+
+$ free -m
+ total used free shared buffers cached
+Mem: 1954 859 1095 0 7 388
+-/+ buffers/cache: 462 1491
+Swap: 4094 742 3351
+$ ./test-file-zero-speed
+posix-fallocate run time:
+ seconds:microseconds: 1235571071:797642
+ seconds:microseconds: 1235571104:428998
+ (approx 33s)
+mmap run time:
+ seconds:microseconds: 1235571104:429523
+ seconds:microseconds: 1235571147:770146
+ (approx 43s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235571149:318119
+ seconds:microseconds: 1235571187:731919
+ (approx 38s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235571189:614692
+ seconds:microseconds: 1235571228:355714
+ (approx 39s)
+$ free -m
+ total used free shared buffers cached
+Mem: 1954 853 1101 0 1 415
+-/+ buffers/cache: 436 1517
+Swap: 4094 742 3351
+$ sudo filefrag ../tmp/*
+[sudo] password for amit:
+../tmp/file-chunk4: 60 extents found, perfection would be 9 extents
+../tmp/file-chunk8: 86 extents found, perfection would be 9 extents
+../tmp/file-mmap: 117 extents found, perfection would be 9 extents
+../tmp/file-pf: 133 extents found, perfection would be 9 extents
+
+-------------------------------------------------------------------
+
+
+-- These tests conducted on a desktop --
+
+$ sudo ./test-file-zero-speed /mnt/btrfs/
+posix-fallocate run time:
+ seconds:microseconds: 1235757533:559903
+ seconds:microseconds: 1235757533:560119
+ (approx 0s)
+mmap run time:
+ seconds:microseconds: 1235757533:564220
+ seconds:microseconds: 1235757551:589402
+ (approx 18s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235757552:688346
+ seconds:microseconds: 1235757572:585343
+ (approx 20s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235757576:143821
+ seconds:microseconds: 1235757592:424030
+ (approx 16s)
+
+-------------------------------------------------------------------
+
+sudo ./test-file-zero-speed /mnt/ext4/
+posix-fallocate run time:
+ seconds:microseconds: 1235757627:972541
+ seconds:microseconds: 1235757642:159940
+ (approx 15s)
+mmap run time:
+ seconds:microseconds: 1235757643:901565
+ seconds:microseconds: 1235757646:690830
+ (approx 3s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235757647:879737
+ seconds:microseconds: 1235757668:701027
+ (approx 21s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235757670:722389
+ seconds:microseconds: 1235757686:780528
+ (approx 16s)
+
+-------------------------------------------------------------------
+[ Extents were not enabled]
+
+$ sudo ./test-file-zero-alloc-speed /mnt/ext4
+posix-fallocate run time:
+ seconds:microseconds: 1235977123:542643
+ seconds:microseconds: 1235977137:673307
+ (approx 14s)
+mmap run time:
+ seconds:microseconds: 1235977137:673494
+ seconds:microseconds: 1235977154:435404
+ (approx 17s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235977155:826068
+ seconds:microseconds: 1235977173:98883
+ (approx 18s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235977174:91821
+ seconds:microseconds: 1235977190:862035
+ (approx 16s)
+
+$ sudo filefrag /mnt/ext4/*
+/mnt/ext4/file-chunk4: 292 extents found, perfection would be 9 extents
+/mnt/ext4/file-chunk8: 282 extents found, perfection would be 9 extents
+/mnt/ext4/file-mmap: 295 extents found, perfection would be 9 extents
+/mnt/ext4/file-pf: 279 extents found, perfection would be 9 extents
+
+-------------------------------------------------------------------
+
+[After enabling extents]
+$ sudo ./test-file-zero-alloc-speed /mnt/ext4
+posix-fallocate run time:
+ seconds:microseconds: 1235979104:790662
+ seconds:microseconds: 1235979104:848372
+ (approx 0s)
+mmap run time:
+ seconds:microseconds: 1235979105:33407
+ seconds:microseconds: 1235979118:535711
+ (approx 13s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235979120:297221
+ seconds:microseconds: 1235979135:520910
+ (approx 15s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235979135:639915
+ seconds:microseconds: 1235979153:502270
+ (approx 18s)
+
+$ sudo filefrag /mnt/ext4/*
+File is stored in extents format
+/mnt/ext4/file-chunk4: 29 extents found
+File is stored in extents format
+/mnt/ext4/file-chunk8: 20 extents found
+File is stored in extents format
+/mnt/ext4/file-mmap: 38 extents found
+File is stored in extents format
+/mnt/ext4/file-pf: 1 extent found
+
+-------------------------------------------------------------------
+$ sudo ./test-file-zero-alloc-speed /mnt/xfs/
+posix-fallocate run time:
+ seconds:microseconds: 1235977241:411119
+ seconds:microseconds: 1235977241:469611
+ (approx 0s)
+mmap run time:
+ seconds:microseconds: 1235977241:469981
+ seconds:microseconds: 1235977255:687663
+ (approx 14s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235977256:603450
+ seconds:microseconds: 1235977274:549963
+ (approx 18s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235977274:649325
+ seconds:microseconds: 1235977293:365759
+ (approx 19s)
+
+$ sudo filefrag /mnt/xfs/*
+/mnt/xfs/file-chunk4: 3 extents found
+/mnt/xfs/file-chunk8: 4 extents found
+/mnt/xfs/file-mmap: 2 extents found
+/mnt/xfs/file-pf: 1 extent found
+-------------------------------------------------------------------
+$ sudo ./test-file-zero-alloc-speed /mnt/ext3/
+posix-fallocate run time:
+ seconds:microseconds: 1235977308:469496
+ seconds:microseconds: 1235977326:366806
+ (approx 18s)
+mmap run time:
+ seconds:microseconds: 1235977326:367325
+ seconds:microseconds: 1235977346:260276
+ (approx 20s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235977347:161513
+ seconds:microseconds: 1235977369:771397
+ (approx 22s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235977369:865221
+ seconds:microseconds: 1235977393:23403
+ (approx 24s)
+
+$ sudo filefrag /mnt/ext3/*
+/mnt/ext3/file-chunk4: 38 extents found, perfection would be 9 extents
+/mnt/ext3/file-chunk8: 9 extents found
+/mnt/ext3/file-mmap: 44 extents found, perfection would be 9 extents
+/mnt/ext3/file-pf: 9 extents found
+-------------------------------------------------------------------
+$ sudo ./test-file-zero-alloc-speed /mnt/btrfs/
+posix-fallocate run time:
+ seconds:microseconds: 1235977416:649716
+ seconds:microseconds: 1235977416:650009
+ (approx 0s)
+mmap run time:
+ seconds:microseconds: 1235977416:650118
+ seconds:microseconds: 1235977434:626664
+ (approx 18s)
+4096-sized chunk run time:
+ seconds:microseconds: 1235977435:634000
+ seconds:microseconds: 1235977452:208026
+ (approx 17s)
+8192-sized chunk run time:
+ seconds:microseconds: 1235977452:294473
+ seconds:microseconds: 1235977471:143672
+ (approx 19s)
+
+$ sudo /mnt/btrfs/*
+FIBMAP: Invalid argument
+...
+-------------------------------------------------------------------
+-------------------------------------------------------------------