{"id":722,"date":"2010-10-24T21:30:36","date_gmt":"2010-10-24T20:30:36","guid":{"rendered":"http:\/\/vmdamentals.com\/?p=722"},"modified":"2011-12-29T11:41:17","modified_gmt":"2011-12-29T10:41:17","slug":"vscsistats-into-the-third-dimension-surface-charts","status":"publish","type":"post","link":"https:\/\/www.vmdamentals.com\/?p=722","title":{"rendered":"vscsiStats into the third dimension: Surface charts!"},"content":{"rendered":"<blockquote><p>How could I ever have missed it&#8230; vscsiStats. A great tool within vSphere which enables you to see VM disk statistics. And not only latency and number of IOPs&#8230; But actually very cool stuff like blocksizes, seekdistances and so on! This information in not to be found in esxtop or vCenter performance graphs&#8230; So we have to rely on once more on the console&#8230;\n<\/p><\/blockquote>\n<p><BR><br \/>\nUPDATE: Available now: <a href=\"http:\/\/vmdamentals.com\/?p=823\" target=\"_blanc\">vscsiStats in 3D part 2: VMs fighting over IOPS<\/a> !<br \/>\nUPDATE2: Build your own 3D graphs! Check out <a href=\"http:\/\/vmdamentals.com\/?p=1022\" target=\"_blanc\">vscsiStats 3D surface graph part 3: Build your own!<\/a><!--more--><br \/>\n<BR><br \/>\nI will not be going into the details of setting up how to use vscsistats. There are plenty of blogposts on that, for example this great post on <a href=\"http:\/\/www.gabesvirtualworld.com\/using-vscsistats-the-full-how-to\/\" target=\"_blanc\">Gabes Virtual World<\/a><\/p>\n<p>vscisStats is a REALLY cool tool. Though exciting as vscsistats may be, it is and remains a tool which measures over time and then outputs a number of histograms of a certain virtual disk. All are basically mean values over time.<\/p>\n<p>Those who have read my performance report on the Sun 7000 storage (see <a href=\"http:\/\/vmdamentals.com\/?p=569\" target=\"_blanc\">Breaking VMware Views sound barrier with Sun Open Storage<\/a>) will know I am a big fan of surface charts. Basically vscsiStats is a perfect tool for integration into 3D graphs. <\/p>\n<p>The idea is that vscsistats should be used to create the histograms over let&#8217;s say 30 seconds. Then shoot another 30 seconds, then another&#8230; After 20 &#8220;samples&#8221; we put all histograms into a surface area chart and voila! We have disk statistics visible as time passes by.<br \/>\n<BR><BR><br \/>\n<strong>TO THE LAB!<\/strong><\/p>\n<p>It is once again testing time! After getting the first results out of vscsiStats, I wrote a very basic piece of script to get several measurements right behind each other. Just call it using three parameters (WorldGroupID, HandleID, sampletime):<\/p>\n<blockquote><p><code><br \/>\necho Recreating the output file<br \/>\nrm -f out1.csv<br \/>\ntouch out1.csv<\/p>\n<p>echo Running stats<br \/>\n\/usr\/lib\/vmware\/bin\/vscsiStats -w $1 -i $2 -s<br \/>\nfor i in $(seq 1 1 21)<br \/>\ndo<br \/>\n&nbsp;&nbsp;&nbsp;sleep $3<br \/>\n&nbsp;&nbsp;&nbsp;\/usr\/lib\/vmware\/bin\/vscsiStats -w $1 -i $2 -p all -c >>out1.csv<br \/>\n&nbsp;&nbsp;&nbsp;\/usr\/lib\/vmware\/bin\/vscsiStats -w $1 -i $2 -r<br \/>\ndone<br \/>\n\/usr\/lib\/vmware\/bin\/vscsiStats -w $1 -i $2 -x<\/code>\n<\/p><\/blockquote>\n<p align=\"right\"><em><strong>EDIT<\/strong>: Thanks to NiTRo (from <a href=\"http:\/\/www.hypervisor.fr\">www.hypervisor.fr<\/a> ) for the edit in the &#8220;for&#8221; command to get it ESXi compatible!<\/em><\/p>\n<p><BR><br \/>\nBasically this script starts measurements on a single virtual disk, after 30 seconds the data is added to a file in the csv format and the statistics get a reset. This process is repeated 21 times. So I end up with 21 sets of histograms, each 30 seconds apart.<\/p>\n<p>Now the magic Excel comes in. Drawing the histograms right after each other makes them interconnect-able using a surface chart.<br \/>\n<BR><BR><br \/>\n<strong>ENOUGH TALK&#8230; ON TO THE OUTPUT!<\/strong><\/p>\n<p>Once the Excel is built, you can quickly import different vscsiStats outputs into the Excel form, and the 3D graphs will immediately show you the measured values in 3D! I have used standard colors for different graphs: blue for I\/O, green for READS and red for WRITES. Check it out:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/Linear-IO.png\" alt=\"Example of linear I\/O\" \/><\/p>\n<p>As you can see, through time there is a very clear &#8220;edge&#8221; along the +1 line. This indicates linear I\/O. Cool right! On to more examples&#8230;<br \/>\n<BR><BR><br \/>\n<strong>EXAMPLE 1: vCenter Bootdisk<\/strong><\/p>\n<p>This is what a vCenter server bootdisk is doing all day:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/vCenter-boot-reads.png\" alt=\"vCenter bootdisk reads\" \/><br \/>\nBasically the disk is idle for reads, but every 60 seconds there is a read burst of 8192 byte blocks, between 500 and 900 reads are performed.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/vCenter-boot-writes.png\" alt=\"vCenter bootdisk writes\" \/><br \/>\nWrites are significantly less, but more regular. Most writes appear to be 4096 byte blocks, some smaller.<br \/>\n<BR><BR><br \/>\nSo how about randomness of these reads\/writes? Well, check this out:<br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/vCenter-boot-readdist.png\" alt=\"vCenter bootdisk read distance\" \/><br \/>\n&#8230; You can clearly see the three recorded bursts laying in the graph. These reads are pretty much random, since almost all have a distance of around 1000 logical blocks.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/vCenter-boot-writedist.png\" alt=\"vCenter bootdisk write distance\" \/><br \/>\nWrites are more of a mishmash. Most writes are fully random (the edges around +500.000 and -500.000), but some of the writes are linear (the peaks in the center of the graph). Especially the peak in the center of the graph at 60 seconds. Now check out the previous writes graph at 60 seconds: There is a peak visible there also, at a very small blocksize of only 1024 byte blocks. My guess would be the system (for some reason) decided to write many small blocks sequentially to disk. This definitely shows the power of vscsiStats in 3D: in a single large data fetch and a single histogram this behavior would have been missed!<br \/>\n<BR><BR><br \/>\n<strong>EXAMPLE 2: Streaming a DVD from a fileserver<\/strong><\/p>\n<p>Let&#8217;s see what happens on a virtual disk which is streaming a DVD:<br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/Watch-DVD-reads.png\" alt=\"Watching a DVD\" \/><br \/>\nWhen streaming data from a file server you can see several block sizes are used. Peaks are visible at 4096, 16384 and 65536, exactly 4K, 16K and most at 64K blocks. It appears the blocks are neatly sized as-needed. I&#8217;d expect the reads to be sequential, but how sequential are they really?<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/Watch-DVD-readdist.png\" alt=\"Is watching a DVD linear or random?\" \/><br \/>\nHmm. The distance graph shows that there is a massive linear component (edge in the center of the graph at +1). But there are also two edges visible, one at -128 and one at +128 logical blocks.<\/p>\n<p><BR><BR><br \/>\n<strong>EXAMPLE 3: Large file reading and writing<\/strong><\/p>\n<p>Another example is heavy file writing and reading. In this example, I use my file server to copy a large file back and forth a few times between two virtual disks using a batch file:<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-io.png\" alt=\"I\/O when moving a file back and forth\" \/><br \/>\nThe file server is busy busy busy&#8230; I see a constant I\/O activity at 64K blocks&#8230;<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-reads.png\" alt=\"Reads when moving a file back and forth\" \/><br \/>\nHere you can see the reads&#8230; It now becomes clear the server reads, then appears to wait, then reads again.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-writes.png\" alt=\"Writes when moving a file back and forth\" \/><br \/>\nLooking at the writes we see the same behavior, but exactly when the reading is idle. Bingo, my batch file does writes-then-reads-then-writes-then-reads-then-writes&#8230;<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-readdist.png\" alt=\"Read distance when moving a file back and forth\" \/><br \/>\nNot much exciting to see in the read distance&#8230; reads are 100% sequential.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-writedist.png\" alt=\"Write distance when moving a file back and forth\" \/><br \/>\nWrites are a 100% sequential as well&#8230;<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-readlatency.png\" alt=\"Read latency when moving a file back and forth\" \/><br \/>\nRead latency is at a very stable 5 [ms]&#8230;<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-writelatency.png\" alt=\"Write latency when moving a file back and forth\" \/><br \/>\nUhm! Write latency is around 50 [ms]. It is apparent my storage device is not the fastest around (anyone got an unused EMC AX4-5 somewhere? \ud83d\ude09 )<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/files-RW-outIO.png\" alt=\"Outstanding I\/O when moving a file back and forth\" \/><br \/>\nNow this one is funny&#8230; Because the write latency is much higher, so are the number of outstanding I\/Os for writes&#8230; In the combined I\/O graph (blue!) it is clearly visible.<\/p>\n<p><BR><BR><br \/>\n<strong>EXAMPLE 4: Generating a random read\/write using IOmeter<\/strong><\/p>\n<p>Just because I can&#8230; I decided to run an IOmeter load on 4K blocks, 50% reads 50% writes, 100% random. This is what I got:<br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-IO.png\" alt=\"IOmeter workload 50%random IO\" \/><br \/>\nInterestingly, IOmeter is not showing a sustained I\/O bandwidth, probably because I choose to have no outstanding I\/Os in this test. All performed I\/Os are neatly at 4096 byte blocks though, as specified within IOmeter.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-readdist1.png\" alt=\"IOmeter workload 50%random read distance\" \/><br \/>\nThe read distance is exactly what was to be expected: at 50% sequential and 50% random, the edges in the center and in the corners are clearly visible.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-writedist.png\" alt=\"IOmeter workload 50%random write distance\" \/><br \/>\nFor writes, the same story as for the reads: at 50% sequential and 50% random this is expected behavior.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-writelatency.png\" alt=\"IOmeter workload 50%random write latency\" \/><br \/>\nWrite Latency is low. This is probably because the number of outstanding I\/Os was set to zero, effectively not performing writes if another write is pending. As a result, latency in writes is low in this test.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-readlatency.png\" alt=\"IOmeter workload 50%random read latency\" \/><br \/>\nReads are more of a mixed bag: Some reads appear to finish quicker than other, it is either 0,5 [ms] or 10[ms]. This is probably due to the fact that 50% of the reads are performed sequential, 50% is random (slower). Cool!<br \/>\n<BR><BR><br \/>\n<strong>EXAMPLE 4b: Example 4, but with 12 outstanding I\/O&#8217;s<\/strong><\/p>\n<p>I just HAD to run one other test! It is basically the same test as above, but now I tell IOmeter to use up to 12 outstanding I\/O&#8217;s:<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-outstanding-IO.png\" alt=\"IOmeter workload 50%random I\/O's at 12 outstanding I\/Os\" \/><br \/>\nNow that we allow some I\/O to be outstanding, you can clearly see much more data is moved, and also in a more regular fashion when compared to example 4.<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-outstandingreads.png\" alt=\"IOmeter workload 50%random number of outstanding reads\" \/><br \/>\nLooking at the outstanding reads, we see that the virtual disk actually is crammed with reads: At almost all times it has 12 reads outstanding (IOmeter just keeps filling the buffer)<br \/>\n<BR><br \/>\n<img decoding=\"async\" src=\"http:\/\/vmdamentals.com\/wp-content\/uploads\/2011\/12\/IOmeter-outstandingwrites.png\" alt=\"IOmeter workload 50%random number of outstanding writes\" \/><br \/>\nIn writes, we see less outstanding I\/O&#8217;s. Really up to 12 outstanding, but most of the time there are less outstanding I\/O than the maximum configured.<br \/>\n<BR><BR><br \/>\n<strong>CONCLUSION<\/strong><\/p>\n<p>The vscsiStats command is a really really great tool to examine disk-workloads on virtual servers. From there on you could potentially optimize your stripe\/segment sizes on storage arrays, for example when you are tuning RAID5 sets for optimizing writes (also see <a href=\"http:\/\/vmdamentals.com\/?p=296\" target=\"_blanc\">Throughput part2: RAID types and segment sizes<\/a>&#8220;). <\/p>\n<p>But adding the third dimension gives an insight about varying behavior through time. Not always needed (like some VMs which perform very steady through time), but especially when workloads vary on a virtual disk it might be worthwhile to look at things with a little more depth! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>How could I ever have missed it&#8230; vscsiStats. A great tool within vSphere which enables you to see VM disk statistics. And not only latency and number of IOPs&#8230; But actually very cool stuff like blocksizes, seekdistances and so on! This information in not to be found in esxtop or vCenter performance graphs&#8230; So we [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77,5],"tags":[120,80,122,123,121,632,119,99],"class_list":["post-722","post","type-post","status-publish","format-standard","hentry","category-storage","category-vmware","tag-disk-io","tag-latency","tag-lbn","tag-lbns","tag-seek-distance","tag-vmware","tag-vscsistats","tag-vsphere"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=722"}],"version-history":[{"count":80,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/722\/revisions"}],"predecessor-version":[{"id":3575,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/722\/revisions\/3575"}],"wp:attachment":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}