smartcp Performance Testing (DRAFT)

Overview

This article shows how you can use the smartcp command to gauge the benefits of sparse reads. In a sparse read, data is not read while being written.

 

This article consists of the following sections:

 


Using smartcp --help to List Command Options

 

The following options are taken from the smartcp --help as a reference for the following three examples, Sparse writes on, Sparse writes off, and Doing a full Read/Write.  The output of the --help command have been truncated to provide clarity.

 

Output from smartcp --help comamnd:

 

Usage: smartcp [OPTION] source  destination
   or: smartcp [OPTION] source [more source] directory
........ -s <when>, --sparse=<when>
         Specify sparse output support.
         Valid values for <when> are 'always' and 'never'.  Default is 'always'.
........ -v, --verbose
         Dump internal information for diagnostic purposes.
........ -g, --debug
         Dump more detailed internal information for diagnostic purposes.
         This option can be on only when verbose option is also on.
......... -T <format>, --stats-output=<format>
         Statistics output format.
         Valid values for <format> are 'json' and 'none'.  Default is 'none'.

 -S <use>, --use-smartread=<use>
         Utilize SmartRead if <use> is 'yes'.
         Valid values for <use> are 'yes' and 'no'.  Default is 'yes'

NEEDS FORMATED LIKE THE OTHERS -JM

 

 

 

         Utilize SmartRead if <use> is 'yes'.
         Valid values for <use> are 'yes' and 'no'. Default is 'yes'.

Source and Destination Files (with the exception of read or write only mode):
    1) <source filename> <desitination filename>
       The destination file may or may not exist. If one exist, it will be
       overwritten.
    2) <source filename> [more source filenames] <desitination directory>
       One or multiple source filenames are specified along with a
       destination directory. In this case, the directory must exist.


Turning Sparse Output ON

Headers look good.  The 'long' verions of the coomand --sparse=<when> illustrates this option better, although -s <when>, the short hand does the same thing. -JM

 

 

Here, we we skip read/writes, by using the -s always parameter (which is the default). 

 

The Command:

time smartcp -vg --sparse=always -T json  /export/LinuxLab/Fedora/Fedora-flat.vmdk /storage/dxi\ 7500/


The Output:

--------------------------

Options: smart read   : on
         sparse output: yes
         md5 checksum : no
         buffer size  : 131072
         bypass vmp   : no
         zero scanning: yes
Copying: /export/LinuxLab/Fedora/Fedora-flat.vmdk
     To: /storage/dxi 7500/Fedora-flat.vmdk
         ---- time on open files: 21501 ms
         ---- 131072 bytes processed, zeros: 0, elapsed time: 22, time on scan: 0 ms, time on read: 3 ms, time on write: 0 ms
{ "r": "data", "v": 1, "t": "22", "total": "8589934592", "copied": "131072", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "23", "total": "8589934592", "copied": "9226240", "write_skipped": "10959872", "read_skipped": "5848064" }
{ "r": "data", "v": 1, "t": "24", "total": "8589934592", "copied": "30036994", "write_skipped": "109424638", "read_skipped": "99713024" }
{ "r": "data", "v": 1, "t": "25", "total": "8589934592", "copied": "36916230", "write_skipped": "247379962", "read_skipped": "225341440" }
{ "r": "data", "v": 1, "t": "26", "total": "8589934592", "copied": "56830986", "write_skipped": "481088502", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "27", "total": "8589934592", "copied": "92089354", "write_skipped": "481088502", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "28", "total": "8589934592", "copied": "122760202", "write_skipped": "481088502", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "29", "total": "8589934592", "copied": "141110282", "write_skipped": "481088502", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "30", "total": "8589934592", "copied": "158805002", "write_skipped": "481088502", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "31", "total": "8589934592", "copied": "175451146", "write_skipped": "486724598", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "32", "total": "8589934592", "copied": "199175178", "write_skipped": "490656758", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "33", "total": "8589934592", "copied": "223423498", "write_skipped": "492884982", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "34", "total": "8589934592", "copied": "248065034", "write_skipped": "493802486", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "35", "total": "8589934592", "copied": "267987978", "write_skipped": "506909686", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "36", "total": "8589934592", "copied": "267987980", "write_skipped": "545051636", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "37", "total": "8589934592", "copied": "267987982", "write_skipped": "587518962", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "38", "total": "8589934592", "copied": "267987986", "write_skipped": "631952366", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "39", "total": "8589934592", "copied": "267987988", "write_skipped": "667866092", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "40", "total": "8589934592", "copied": "267987990", "write_skipped": "702731242", "read_skipped": "454081536" }
         ---- 985792512 bytes processed, zeros: 263722986, elapsed time: 40, time on scan: 199 ms, time on read: 17707 ms, time on write: 300 ms

 

 ###Truncated for simplicity and length####         

 

         ---- 7845187584 bytes processed, zeros: 2003642226, elapsed time: 234, time on scan: 1307 ms, time on read: 210456 ms, time on write: 4896 ms
{ "r": "data", "v": 1, "t": "235", "total": "8589934592", "copied": "4161424526", "write_skipped": "3698180978", "read_skipped": "1694538752" }
{ "r": "data", "v": 1, "t": "236", "total": "8589934592", "copied": "4181068944", "write_skipped": "3733377904", "read_skipped": "1729735680" }
{ "r": "data", "v": 1, "t": "236", "total": "8589934592", "copied": "4193177234", "write_skipped": "4396757358", "read_skipped": "2391018496" }
         ---- time on copy contents: 214571 ms
         ---- time on close files: 726 ms
Stats:   file size    :   8589934592
         read skipped :   2391018496
         write skipped:   4396757358
         copied bytes :   4193177234
         total bytes  :   8589934592
         scanned zeros:   2005738862
         elapsed time :      237 s
         time on scan :     1308 ms
         time on read :   212812 ms
         time on write:     4962 ms
         enqueue r q  :   214070 ms
         dequeue r q  :    21573 ms
         enqueue w q  :      232 ms
         dequeue w q  :   230948 ms
------------------

real    3m56.807s
user    0m1.836s
sys     0m9.045s


Turning Sparse Output OFF 

Here, we use the -s never parameter. We don't skip writes, but reads are still skipped. 

 

The Command: 

bash-4.1# time smartcp -vg --sparse=never -T json  /export/LinuxLab/Fedora/Fedora-flat.vmdk /storage/dxi\ 7500/

 

The Output:

---------------------------------------------
Options: smart read   : on
         sparse output: no
         md5 checksum : no
         buffer size  : 131072
         bypass vmp   : no
         zero scanning: yes
Copying: /export/LinuxLab/Fedora/Fedora-flat.vmdk
     To: /storage/dxi 7500/Fedora-flat.vmdk
         ---- time on open files: 118 ms
         ---- 131072 bytes processed, zeros: 0, elapsed time: 0, time on scan: 0 ms, time on read: 12 ms, time on write: 1 ms
{ "r": "data", "v": 1, "t": "0", "total": "8589934592", "copied": "131072", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "1", "total": "8589934592", "copied": "16253952", "write_skipped": "0", "read_skipped": "4585472" }
{ "r": "data", "v": 1, "t": "2", "total": "8589934592", "copied": "135267328", "write_skipped": "0", "read_skipped": "99713024" }
{ "r": "data", "v": 1, "t": "3", "total": "8589934592", "copied": "210764800", "write_skipped": "0", "read_skipped": "162627584" }
{ "r": "data", "v": 1, "t": "4", "total": "8589934592", "copied": "282067968", "write_skipped": "0", "read_skipped": "224996352" }
{ "r": "data", "v": 1, "t": "5", "total": "8589934592", "copied": "286917632", "write_skipped": "0", "read_skipped": "225995776" }
{ "r": "data", "v": 1, "t": "6", "total": "8589934592", "copied": "525336576", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "7", "total": "8589934592", "copied": "531365888", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "8", "total": "8589934592", "copied": "547225600", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "9", "total": "8589934592", "copied": "568328192", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "10", "total": "8589934592", "copied": "593625088", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "11", "total": "8589934592", "copied": "616693760", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "12", "total": "8589934592", "copied": "646578176", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "13", "total": "8589934592", "copied": "659685376", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "14", "total": "8589934592", "copied": "680001536", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "15", "total": "8589934592", "copied": "709099520", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "16", "total": "8589934592", "copied": "741212160", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "17", "total": "8589934592", "copied": "776470528", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "18", "total": "8589934592", "copied": "803471360", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "19", "total": "8589934592", "copied": "838991872", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "20", "total": "8589934592", "copied": "883556352", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "21", "total": "8589934592", "copied": "916848640", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "22", "total": "8589934592", "copied": "957218816", "write_skipped": "0", "read_skipped": "454081536" }
{ "r": "data", "v": 1, "t": "23", "total": "8589934592", "copied": "980287488", "write_skipped": "0", "read_skipped": "454081536" }
         ---- 985792512 bytes processed, zeros: -454081536, elapsed time: 23, time on scan: 0 ms, time on read: 21392 ms, time on write: 4116 ms

 

 ###Truncated for simplicity and length####

 

          ---- 7845187584 bytes processed, zeros: -1694538752, elapsed time: 236, time on scan: 0 ms, time on read: 230786 ms, time on write: 17411 ms
{ "r": "data", "v": 1, "t": "237", "total": "8589934592", "copied": "7855804416", "write_skipped": "0", "read_skipped": "1694538752" }
{ "r": "data", "v": 1, "t": "238", "total": "8589934592", "copied": "7913398272", "write_skipped": "0", "read_skipped": "1729735680" }
{ "r": "data", "v": 1, "t": "245", "total": "8589934592", "copied": "8585990144", "write_skipped": "0", "read_skipped": "2390658048" }
{ "r": "data", "v": 1, "t": "245", "total": "8589934592", "copied": "8589934592", "write_skipped": "0", "read_skipped": "2391018496" }
         ---- time on copy contents: 245103 ms
         ---- time on close files: 1268 ms
Stats:   file size    :   8589934592
         read skipped :   2391018496
         write skipped:            0
         copied bytes :   8589934592
         total bytes  :   8589934592
         scanned zeros:  -2391018496
         elapsed time :      246 s
         time on scan :        0 ms
         time on read :   233609 ms
         time on write:    24114 ms
         enqueue r q  :   238228 ms
         dequeue r q  :      198 ms
         enqueue w q  :     5246 ms
         dequeue w q  :   220784 ms
------------------

real    4m6.531s
user    0m0.567s
sys     0m15.354s

 

As shown in the highlighted real lines in the output of the two commands above, we saved 10 seconds by skipping the writes in this test.  Let's see what happens when we disable the read skipping as well.


Doing a Full Read/Write

Same deal here with long hand for smread -JM

 

Here, we'll do a full read/write with smartcp. 

  

The Command:

time smartcp -vg -s never  --use-smartread=no  -T json  /export/LinuxLab/Fedora/Fedora-flat.vmdk /storage/dxi\ 7500/ 

 

The Output:

-----------------------------------------------
Options: smart read   : off
         sparse output: no
         md5 checksum : no
         buffer size  : 131072
         bypass vmp   : no
         zero scanning: yes
Copying: /export/LinuxLab/Fedora/Fedora-flat.vmdk
     To: /storage/dxi 7500/Fedora-flat.vmdk
         ---- time on open files: 50 ms
         ---- 131072 bytes processed, zeros: 0, elapsed time: 0, time on scan: 0 ms, time on read: 9 ms, time on write: 0 ms
{ "r": "data", "v": 1, "t": "0", "total": "8589934592", "copied": "131072", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "1", "total": "8589934592", "copied": "33947648", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "2", "total": "8589934592", "copied": "74317824", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "3", "total": "8589934592", "copied": "117571584", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "4", "total": "8589934592", "copied": "141164544", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "5", "total": "8589934592", "copied": "164233216", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "6", "total": "8589934592", "copied": "199098368", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "7", "total": "8589934592", "copied": "228327424", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "8", "total": "8589934592", "copied": "252968960", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "9", "total": "8589934592", "copied": "283377664", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "10", "total": "8589934592", "copied": "310509568", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "11", "total": "8589934592", "copied": "349569024", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "12", "total": "8589934592", "copied": "374341632", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "13", "total": "8589934592", "copied": "403963904", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "14", "total": "8589934592", "copied": "435814400", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "15", "total": "8589934592", "copied": "474087424", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "16", "total": "8589934592", "copied": "509739008", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "17", "total": "8589934592", "copied": "530317312", "write_skipped": "0", "read_skipped": "0" }
         ---- 537001984 bytes processed, zeros: 0, elapsed time: 17, time on scan: 0 ms, time on read: 17133 ms, time on write: 564 ms

 

 ###Truncated for simplicity and length####

 

         ---- 8053194752 bytes processed, zeros: 0, elapsed time: 301, time on scan: 0 ms, time on read: 300340 ms, time on write: 9093 ms
{ "r": "data", "v": 1, "t": "302", "total": "8589934592", "copied": "8080982016", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "303", "total": "8589934592", "copied": "8101953536", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "304", "total": "8589934592", "copied": "8130002944", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "305", "total": "8589934592", "copied": "8154906624", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "306", "total": "8589934592", "copied": "8179154944", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "307", "total": "8589934592", "copied": "8211005440", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "308", "total": "8589934592", "copied": "8233287680", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "309", "total": "8589934592", "copied": "8252293120", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "310", "total": "8589934592", "copied": "8283226112", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "311", "total": "8589934592", "copied": "8316256256", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "312", "total": "8589934592", "copied": "8350334976", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "313", "total": "8589934592", "copied": "8374321152", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "314", "total": "8589934592", "copied": "8403156992", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "315", "total": "8589934592", "copied": "8433696768", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "316", "total": "8589934592", "copied": "8466595840", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "317", "total": "8589934592", "copied": "8498577408", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "318", "total": "8589934592", "copied": "8517320704", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "319", "total": "8589934592", "copied": "8542486528", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "320", "total": "8589934592", "copied": "8572502016", "write_skipped": "0", "read_skipped": "0" }
{ "r": "data", "v": 1, "t": "320", "total": "8589934592", "copied": "8589934592", "write_skipped": "0", "read_skipped": "0" }
         ---- time on copy contents: 320669 ms
         ---- time on close files: 959 ms
Stats:   file size    :   8589934592
         read skipped :            0
         write skipped:            0
         copied bytes :   8589934592
         total bytes  :   8589934592
         scanned zeros:            0
         elapsed time :      321 s
         time on scan :        0 ms
         time on read :   320017 ms
         time on write:     9667 ms
         enqueue r q  :   320452 ms
         dequeue r q  :      113 ms
         enqueue w q  :      423 ms
         dequeue w q  :   310804 ms
------------------

real    5m21.688s
user    0m0.749s
sys     0m15.688s
  

 

As shown by the highlighted real lines in the two output listings above, we see a difference of 1:25 (1 minute, 25 seconds),  from 3m56.807s (in the Turning Sparse Output ON section)  to 5m21.688s here. That's over a 25% performance difference.

 

On a small scale of this meager VM, it's not much.  Spread across 1TB we could save 250GB, which at 100MB/sec, could mean a 40min difference in a backup window.  Concrete example given.  DF command nto needed, no idea why i included that -JM

 

 



This page was generated by the BrainKeeper Enterprise Wiki, © 2018