<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: Disk performance]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?disk_performance</link>
<description></description>
<pubDate>Sat, 31 Jan 2009 10:41:19 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[Disk performance]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?disk_performance</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: virtualization</div><hr/><div class="wiki">
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#speed">Dobrica Pavlinušić's random unstructured stuff (Speed)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Speed} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#disk_platter_transfer_speed">Dobrica Pavlinušić's random unstructured stuff (Disk platter transfer speed)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Disk platter transfer speed} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#individial_disks">Dobrica Pavlinušić's random unstructured stuff (Individial disks)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Individial disks} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#software_raid">Dobrica Pavlinušić's random unstructured stuff (Software RAID)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Software RAID} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#temperature">Dobrica Pavlinušić's random unstructured stuff (Temperature)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Temperature} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#data_security">Dobrica Pavlinušić's random unstructured stuff (Data security)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Data security} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#smart">Dobrica Pavlinušić's random unstructured stuff (Smart)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Smart} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#raid">Dobrica Pavlinušić's random unstructured stuff (RAID)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] RAID} --></span></li>
</ul></ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><p>
Have many disks. More disk spindles brings more than capacity alone! (Same as in databases)</p>
<h1 id="speed">Speed</h1>
<h2 id="disk_platter_transfer_speed">Disk platter transfer speed</h2>
<p>
If you think that disk has constant transfer speed, <a target="_blank" title="(external link)" href="http://www.coker.com.au/bonnie++/zcav/results.html">ZCAV has interesting graphs<!-- wiki-renamed-hyperlink "ZCAV has interesting graphs"<http://www.coker.com.au/bonnie++/zcav/results.html> --></a></p>
<h2 id="individial_disks">Individial disks</h2>
<p>
Slow laptop 2.5&quot; 5400 disk</p>
<pre>
dpavlin@llin:~$ sudo hdparm -i /dev/sda

/dev/sda:

 Model=FUJITSU MHV2080BH                       , FwRev=00840028, SerialNo=        NW05T6B29HM5
 Config={ HardSect NotMFM HdSw&gt;15uSec Fixed DTR&gt;10Mbs }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=?16?
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 
 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-3,4,5,6,7

 * signifies the current active mode

dpavlin@llin:~$ sudo hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   1566 MB in  2.00 seconds = 782.85 MB/sec
 Timing buffered disk reads:   66 MB in  3.03 seconds =  21.79 MB/sec
</pre>
<br /><p>
Interesting numbers are <tt>BuffSize</tt> (cache in disk) and <tt>MaxMultSect</tt> which we want to use for read-ahead param:</p>
<pre>
hdparm -m 16 -a 16 /dev/sda
</pre>
<br /><p>
This will <strong>decrease</strong> a bit speed of linerar buffer reads which <tt>hdparm</tt> uses, but we will pull from disk only blocks which are allready in cache, improving random read/write performance.</p>
<p>
To find optimal readahead for your drive using hdparm access pattern you can use <a target="_blank" title="(external link)" href="http://svn.rot13.org/index.cgi/scripts/view/trunk/hdparm-readahead.pl">hdparm-readahead.pl<!-- wiki-renamed-hyperlink "hdparm=-readahead.pl"<http://svn.rot13.org/index.cgi/scripts/view/trunk/hdparm=-readahead.pl> --></a> which will try different combinations for you.</p>
<p>
Faster (!) external 3.5 USB disk (no <tt>hdparm -i</tt> on USB), but just because it's <strong>another</strong> disk not loaded by system.</p>
<pre>
dpavlin@llin:~$ sudo hdparm -tT /dev/sdb

/dev/sdb:
 Timing cached reads:   1508 MB in  2.00 seconds = 753.72 MB/sec
 Timing buffered disk reads:   56 MB in  3.03 seconds =  18.48 MB/sec
</pre>
<br /><h2 id="software_raid">Software RAID</h2>
<span class="nlw_phrase"><div class="wiki-include-page">
<div class="wiki-include-title"><a href='https://saturn.ffzg.hr/rot13/index.cgi?home_made_raid_disk_holder' >Home-made RAID disk holder</a> </div>
<div class="wiki-include-content">
<p>
Home-made software md RAID 5 array from SATA drives:</p>
<div class="nlw_phrase"><div class="fetchrss_box">
  <div class="fetchrss_titlebox">
    
 <div class="fetchrss_title">
     fetchrss: http://api.flickr.com/services/feeds/photoset.gne?set=72157603375109805&nsid=46217738@N00&lang=en-us
 </div>

  </div>
  
<ul class="fetchrss_item">
  <li class="fetchrss_item">
    There was an error: 500 SSL negotiation failed: 

  </li>
</ul>

</div>
















<!-- wiki: {fetchrss: http://api.flickr.com/services/feeds/photoset.gne?set==72157603375109805&nsid==46217738@N00&lang==en-=us full}
--></div><br /><br /><p>
Note nice usage of construction metal stripes with holes which is usually used to hold fence. It has holes just the right size for screws to go through and hold disks nicely spaced (although a little bit more space would be ideal). It's soft enough to be bent at corners to produce nice and leveled space between it and case.</p>
<p>
Blog post <a target="_blank" title="(external link)" href="http://blog.rot13.org/2007/11/raid5_for_home.html">RAID5 for home<!-- wiki-renamed-hyperlink "RAID5 for home"<http://blog.rot13.org/2007/11/raid5_for_home.html> --></a> describes setup in some details.</p>
</div></div><!-- wiki: {include: [Home-=made RAID disk holder]} --></span><br /><br /><p>
Drive info:</p>
<pre>
dpavlin@brr:~$ sudo hdparm -i /dev/sdd

/dev/sdd:

 Model=WDC WD5000AAKS-00YGA0                   , FwRev=12.01C02, SerialNo=     WD-WCAS80929678
 Config={ HardSect NotMFM HdSw&gt;15uSec SpinMotCtl Fixed DTR&gt;5Mbs FmtGapReq }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
 BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=?16?
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: Unspecified:  ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode
</pre>
<br /><p>
Speed of individual drives in array:</p>
<pre>
dpavlin@brr:~$ sudo hdparm -tT /dev/sda /dev/sdb /dev/sdd

/dev/sda:
 Timing cached reads:   1982 MB in  2.00 seconds = 991.18 MB/sec
 Timing buffered disk reads:  232 MB in  3.03 seconds =  76.67 MB/sec

/dev/sdb:
 Timing cached reads:   2010 MB in  2.00 seconds = 1004.95 MB/sec
 Timing buffered disk reads:  228 MB in  3.01 seconds =  75.85 MB/sec

/dev/sdd:
 Timing cached reads:   2006 MB in  2.00 seconds = 1003.01 MB/sec
 Timing buffered disk reads:  230 MB in  3.01 seconds =  76.47 MB/sec
</pre>
<br /><p>
How are hey assembled into /dev/md0 RAID 5 array:</p>
<pre>
dpavlin@brr:~$ cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sdd1[0] sda1[2] sdb1[1]
      976767872 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
</pre>
<br /><p>
Speed of array</p>
<pre>
dpavlin@brr:~$ sudo hdparm -tT /dev/md0

/dev/md0:
 Timing cached reads:   1986 MB in  2.00 seconds = 993.20 MB/sec
 Timing buffered disk reads:  434 MB in  3.01 seconds = 144.41 MB/sec
</pre>
<br /><p>
As expected RAID 5 speed is 75 + 75 + 0 (parity disk) ~ 144 MB/sec</p>
<h1 id="temperature">Temperature</h1>
<p>
Disks don't like it hot!</p>
<pre>
root@brr:~# hddtemp /dev/sda /dev/sdb /dev/sdd
/dev/sda: WDC WD5000AAKS-00YGA0: 33°C
/dev/sdb: WDC WD5000AAKS-00YGA0: 32°C
/dev/sdd: WDC WD5000AAKS-00YGA0: 32°C
</pre>
<br /><p>
On output above, middle disk is <tt>/dev/sda</tt> so it's 1° hotter than other two. I could mitigate this with additional fan on front of case, but it's making enough noise already, so I'll leave it as is.</p>
<h1 id="data_security">Data security</h1>
<h2 id="smart">Smart</h2>
<pre>
root@brr:~# smartctl --all /dev/sda | head -20
smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Second Generation Serial ATA family
Device Model:     WDC WD5000AAKS-00YGA0
Serial Number:    WD-WCAS80815866
Firmware Version: 12.01C02
User Capacity:    500,107,862,016 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sat Oct 11 00:27:01 2008 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
</pre>
<br /><p>
Before you start to beleve in SMART as solution to all disk health problems, read <a target="_blank" title="(external link)" href="http://labs.google.com/papers/disk_failures.pdf">Failure Trends in a Large Disk Drive Population<!-- wiki-renamed-hyperlink "Failure Trends in a Large Disk Drive Population"<http://labs.google.com/papers/disk_failures.pdf> --></a></p>
<p>
<img alt="http://media.arstechnica.com/staff.media/failurehd.png" src="http://media.arstechnica.com/staff.media/failurehd.png" border="0" /></p>
<p>
See also <a href="https://saturn.ffzg.hr/rot13/index.cgi?bad_block_howto_for_smartmontools" title="(209 months) My transcript for fixing error based on original documentation http smartmontools.sourceforge.net ba...">Bad block HOWTO for smartmontools</a> if you ever get smart errors and don't just want to throw out your disk.</p>
<h2 id="raid">RAID</h2>
<p>
Also interesting is <a target="_blank" title="(external link)" href="http://etbe.coker.com.au/2008/10/14/some-raid-issues/">Some RAID Issues<!-- wiki-renamed-hyperlink "Some RAID Issues"<http://etbe.coker.com.au/2008/10/14/some=-raid=-issues/> --></a></p>
<p>
Read also <a target="_blank" title="(external link)" href="http://blogs.zdnet.com/storage/?p=162">Why RAID 5 stops working in 2009<!-- wiki-renamed-hyperlink "Why RAID 5 stops working in 2009"<http://blogs.zdnet.com/storage/?p=162> --></a></p>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>virtualization</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?disk_performance</guid>
<pubDate>Sat, 31 Jan 2009 10:41:19 -0000</pubDate>
</item>
</channel>
</rss>