jakelandis / fsync_compare

Simple little application to compare fsync time between mmap vs. channel io for sequential writes
1 stars 3 forks source link

Test results: Hyper-V vm, Linux, Fedora 23, xfs. Write size 4096 bytes. #2

Open jordansissel opened 7 years ago

jordansissel commented 7 years ago

From this branch: https://github.com/jordansissel/fsync_compare/commit/65c9ad684cb72827ffff295d699cb30e10e47bba

I use perf trace to track syscall times specifically. I don't check block storage calls yet.

channel + 4096-ish byte writes

% sudo perf trace -s java -Djava.io.tmpdir=$HOME/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar channel 4096
Running channel test
Buffer contains 26 events and has byte size is 4096
Did 262144 writes. Wrote 1073741824 bytes total

   syscall            calls    total       min       avg       max      stddev
                               (msec)    (msec)    (msec)    (msec)        (%)
   --------------- -------- --------- --------- --------- ---------     ------
   fdatasync           6553 73263.906     7.055    11.180    77.751      0.40%
   write             262165  4110.643     0.000     0.016     8.970      0.53%

mmap + 4096-ish bytes

% sudo perf trace -s java -Djava.io.tmpdir=$HOME/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar mmap 4096
Running mmap test
Buffer contains 26 events and has byte size is 4096
Did 262144 writes. Wrote 1073741824 bytes total

   syscall            calls    total       min       avg       max      stddev
                               (msec)    (msec)    (msec)    (msec)        (%)
   --------------- -------- --------- --------- --------- ---------     ------
   msync               6553 78229.751     7.455    11.938   104.196      0.34%
jordansissel commented 7 years ago

channel, 4096, perf stat

% perf stat java -Djava.io.tmpdir=$HOME/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar channel 4096
Running channel test
Buffer contains 26 events and has byte size is 4096
Did 262144 writes. Wrote 1073741824 bytes total

 Performance counter stats for 'java -Djava.io.tmpdir=/home/jls/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar channel 4096':

       2154.081520      task-clock (msec)         #    0.027 CPUs utilized
            21,968      context-switches          #    0.010 M/sec
               145      cpu-migrations            #    0.067 K/sec
             3,514      page-faults               #    0.002 M/sec
   <not supported>      cycles
   <not supported>      instructions
   <not supported>      branches
   <not supported>      branch-misses

      78.914619110 seconds time elapsed

mmap, 4096, perf stat

% perf stat java -Djava.io.tmpdir=$HOME/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar mmap 4096
Running mmap test
Buffer contains 26 events and has byte size is 4096
Did 262144 writes. Wrote 1073741824 bytes total

 Performance counter stats for 'java -Djava.io.tmpdir=/home/jls/build/tmp -jar target/fsync_compare-0.1-SNAPSHOT.jar mmap 4096':

       3029.917143      task-clock (msec)         #    0.037 CPUs utilized
            21,716      context-switches          #    0.007 M/sec
                44      cpu-migrations            #    0.015 K/sec
           265,472      page-faults               #    0.088 M/sec
   <not supported>      cycles
   <not supported>      instructions
   <not supported>      branches
   <not supported>      branch-misses

      81.840550774 seconds time elapsed