<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Notes</title>
	<atom:link href="http://www.abisen.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.abisen.com/blog</link>
	<description>So that I don't forget ....</description>
	<pubDate>Thu, 14 May 2009 17:07:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Matrix on WinXP</title>
		<link>http://www.abisen.com/blog/?p=138</link>
		<comments>http://www.abisen.com/blog/?p=138#comments</comments>
		<pubDate>Fri, 01 May 2009 09:25:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Humor]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.abisen.com/blog/?p=138</guid>
		<description><![CDATA[Just stumbled across this video, it&#8217;s hilarious.


]]></description>
			<content:encoded><![CDATA[<p>Just stumbled across this video, it&#8217;s hilarious.</p>
<p style="text-align: center;"><object width="640" height="360" data="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1886349&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><param name="AllowScriptAccess" value="true" /><param name="src" value="http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=1886349&amp;fullscreen=1" /></object></p>
<p style="text-align: center;"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abisen.com/blog/?feed=rss2&amp;p=138</wfw:commentRss>
		</item>
		<item>
		<title>OSX iSCSI Initiators Compared (OpenSolaris Targets)</title>
		<link>http://www.abisen.com/blog/?p=127</link>
		<comments>http://www.abisen.com/blog/?p=127#comments</comments>
		<pubDate>Sat, 11 Apr 2009 07:49:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Networking]]></category>

		<category><![CDATA[OpenSolaris]]></category>

		<category><![CDATA[Storage]]></category>

		<category><![CDATA[iSCSI]]></category>

		<category><![CDATA[OSX]]></category>

		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.abisen.com/blog/?p=127</guid>
		<description><![CDATA[As it should be evident from my recent posts, I have been playing with iSCSI and ZFS a lot lately. And the only OS in my home that I work on is OS-X on my laptops.  And so started my quest to find a perfect iSCSI solution (based on OpenSolaris) for my OSX environment.
 [...]]]></description>
			<content:encoded><![CDATA[<p>As it should be evident from my recent posts, I have been playing with iSCSI and ZFS a lot lately. And the only OS in my home that I work on is OS-X on my laptops.  And so started my quest to find a perfect iSCSI solution (based on OpenSolaris) for my OSX environment.</p>
<p> Apple does not provide any iSCSI initiator with Leopard, it’s been rumored that with Snow Leopard Apple might release iSCSI initiator. But till then there are at least 3 iSCSI initiators that exists for OS X users.</p>
<p><center></center></p>
<p> I have been told that iSCSI is a very complex specification and the success with a particular (initiator / target) combination depends upon how comprehensive they are (and how lucky you are). And that’s exactly what I found.</p>
<p> As my first test I just downloaded the globalSAN iSCSI initiator and used it to connect to the “iscsitgt” based target from my OpenSolaris 2008.11 Workstation. I was able to connect to the target the read performance was great, write kinda sucked but this was the first time I was playing with iSCSI and i liked the idea of block level access over Wi-Fi <img src='http://www.abisen.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p> Then I started becoming inquisitive (greedy), and wanted to share multiple thin provisioned iSCSI devices to be used as TimeMachine, iTunes Library, iPhoto Library across my home network to be shared between multiple laptops. And for achieving that i started playing with advanced features like “Access Control List”,  “CHAP Authentication” et. al.</p>
<p> So globalSAN iSCSI initiator was able to scan the target’s but as soon as I tried connecting to the target’s, the iSCSI initiator went into some sort of infinite loop and hung.</p>
<p> I came to know about this latest iSCSI implementation by Sun Microsystem which is written from scratch and is blazing fast. I had to try it and I did. Unfortunately with globalSAN iSCSI initiator I was unable to format the block devices.</p>
<p> Then I concentrated the next week getting access to different iSCSI initiators available for OSX and came across three: </p>
<ul>
<li> globalSAN (www.studionetworksolutions.com) </li>
<li> Small-Tree (www.small-tree.com) </li>
<li> Atto Xtend SAN (www.attotech.com) </li>
</ul>
<p> I have not performed extensive tests (as of now) so I will just present my finding in form of a small table.</p>
<p> I would also like to state that compatibility table only represents the compatibility between these initiators with OpenSolaris based targets and does not talks about performance only compatibility. </p>
<p><img src="http://www.abisen.com/blog/wp-content/uploads/2009/04/04112009-osx_iscsi_initiators_compatability_report.png" alt="04112009-osx_iscsi_initiators_compatability_report" title="04112009-osx_iscsi_initiators_compatability_report" width="527" height="291" class="aligncenter size-full wp-image-129" /></p>
<p> As it’s visible from the table above Atto’s Xtend SAN was the only initiator that has so far been able to connect and access both the iSCSI subsystem’s with all variations (that I have tested so far). It’s also the one that costs the most ~200$ per seat, but hey it’s the only one which works so can’t complain. </p>
<p><center></center></p>
<p> If the requirements are not for using ACL’s or COMSTAR globalSAN has the best interface integration with the OSX preferences pane. On the other hand ATTO’s interface show’s age but also has many tunable options available. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.abisen.com/blog/?feed=rss2&amp;p=127</wfw:commentRss>
		</item>
		<item>
		<title>BrandZ: DLNA Streaming Server (UPnP Server)</title>
		<link>http://www.abisen.com/blog/?p=115</link>
		<comments>http://www.abisen.com/blog/?p=115#comments</comments>
		<pubDate>Fri, 10 Apr 2009 06:36:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[OpenSolaris]]></category>

		<category><![CDATA[BrandZ]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[Fedora 10]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Solaris]]></category>

		<category><![CDATA[UPnP]]></category>

		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.abisen.com/blog/?p=115</guid>
		<description><![CDATA[Solaris offers a very sophisticated and lightweight method for virtualizing multiple instances of Solaris OS using Zones. Multiple zones can be defined on the host operating system (“which in itself is a zone, called global zone”).
These multiple zones provides isolation, security, between each other and yet are very lightweight. Unlike a traditional virtual machines which [...]]]></description>
			<content:encoded><![CDATA[<p>Solaris offers a very sophisticated and lightweight method for virtualizing multiple instances of Solaris OS using Zones. Multiple zones can be defined on the host operating system (“which in itself is a zone, called global zone”).</p>
<p>These multiple zones provides isolation, security, between each other and yet are very lightweight. Unlike a traditional virtual machines which requires a complete instance of OS running for each instance, the instances of Zones uses the same running kernel efficiently.</p>
<p>This is one of the major motivation behind this exercise, because the resources required for supporting individual instances are equivalent to the primary application that would be running on these zones. But since there is only one kernel instance interpreting all the system calls, it’s not possible to run instances of other operating systems like Windows XP, Vista, OSX et. al.</p>
<p><center></center></p>
<p>However there is an interesting project called “BrandZ” which extends Zones, which allows the use of non-native binaries (os). As of the writing (04/09) Linux Zones works pretty well (I don’t think non Unix OS would be supported anytime soon).</p>
<p>I have been using OpenSolaris based workstation as a feature rich, flexible and stable home NAS for serving iSCSI, SMB, NFS et. al. But there are many applications which are either not supported on Solaris but are under Linux. One such application is a DLNA compliant UPnP server.</p>
<p>In this article I will detail all the steps required to:</p>
<ul>
<li>Setup a Fedora-10 based Branded Zone on OpenSolaris 2008.11, And</li>
<li>Configure “Media-Tomb” for streaming content to a PS3 (DLNA Client)</li>
</ul>
<p>Setting up a zone is fairly straightforward. The command “zonecfg” is used to create zone by specifying the characteristics of the zone. This command creates an xml file under “/etc/zones” which contains all the details that were entered using “zonecfg”.</p>
<h2>Creating The Branded Zone</h2>
<p><strong>Step 1:</strong> Starting a new configuration.</p>
<pre class="programlisting"># zonecfg -z Fedora-10
Fedora-10: No such zone configured
Use 'create' to begin configuring a new zone.</pre>
<p>Step 2: Using a template to inherit some basic information. SUNWlx refers to Linux based Branded Zones.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; create -t SUNWlx</pre>
<p><strong>Step 3: </strong>Specifying the location where the files would be installed. The path need not exist as it would be automatically created in the installation phase with the proper permissions.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; set zonepath=/tank/Zones/Fedora-10</pre>
<p><strong>Step 4: </strong>Setting the autoboot parameter, if set to true the zone would be started automatically whenever the machine is rebooted.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; set autoboot=true</pre>
<p><strong>Step 5: </strong>Setting the network parameters. And associating the network IP address with the physical Ethernet NIC. In the example below the physical NIC interface “bge0” would be used for networking. The list of available NIC on the system can be probed by using the command “ifconfig”.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; add net
zonecfg:Fedora-10:net&gt; set address=192.168.0.29/24
zonecfg:Fedora-10:net&gt; set physical=bge0
zonecfg:Fedora-10:net&gt; end</pre>
<p><strong>Step 6: </strong>Adding a local file system to the zone and providing a mount point within the zone. In the example below the local file system “/tank/Content/Media/Videos” would be mounted within the zone at “/local_zfs_volume”</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; add fs
zonecfg:Fedora-10:fs&gt; set dir=/local_zfs_volume
zonecfg:Fedora-10:fs&gt; set special=/tank/Content/Media/Videos
zonecfg:Fedora-10:fs&gt; set type=lofs
zonecfg:Fedora-10:fs&gt; end</pre>
<p><strong>Step 7: </strong>Setting Linux 2.6 kernel parameter. By default OpenSolaris 2008.11 Zones only support 2.4 kernels. For 2.6 there is a template which could be downloaded inside /etc/zones or the following parameters could be changed from the “zonecfg” interface. I chose the latter:</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; add attr
zonecfg:Fedora-10:attr&gt; set name=kernel-version
zonecfg:Fedora-10:attr&gt; set type=string
zonecfg:Fedora-10:attr&gt; set value=2.6
zonecfg:Fedora-10:attr&gt; end</pre>
<p><strong>Step 8: </strong>Setting the upper limit on the CPU utilization by the zone. The example below would cap the maximum CPU utilization at 50% of one CPU on the physical machine. For example my workstation is a dual core 3.0GHz machine, so effectively in worst case scenario the zone would not be allowed to use more than 1.5GHz of processing power.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; add capped-cpu
zonecfg:Fedora-10:capped-cpu&gt; set ncpus=0.5
zonecfg:Fedora-10:capped-cpu&gt; end</pre>
<p><strong>Step 9: </strong>Capping the maximum memory. This is also neat since there is no actual kernel running for this virtual machines the footprint is actually the size of the applications running inside the zone. So the memory required for supporting a Zone is pretty less.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; add capped-memory
zonecfg:Fedora-10:capped-memory&gt; set physical=512m
zonecfg:Fedora-10:capped-memory&gt; set swap=512m
zonecfg:Fedora-10:capped-memory&gt; end</pre>
<p><strong>Step 10: </strong>Finishing the configuration, verifying and saving the new changes.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; commit
zonecfg:Fedora-10&gt; info

zonename: Fedora-10
zonepath: /tank/Zones/Fedora-10
brand: lx
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
fs:
        dir: /local_zfs_volume
        special: /tank/Content/Media/Videos
        raw not specified
        type: lofs
        options: []
net:
        address: 192.168.0.29/24
        physical: bge0
        defrouter: 192.168.0.1
capped-cpu:
        [ncpus: 0.50]
capped-memory:
        physical: 512M
        [swap: 512M]
attr:
        name: kernel-version
        type: string
        value: 2.6
rctl:
        name: zone.cpu-cap
        value: (priv=privileged,limit=50,action=deny)
rctl:
        name: zone.max-swap
        value: (priv=privileged,limit=536870912,action=deny)</pre>
<p></p>
<p><strong>Step 11: </strong>Exiting the interface.</p>
<pre class="programlisting">zonecfg:Fedora-10&gt; exit</pre>
<p>The flexibility of specifying the amount of resource allocated to a zone comes very handy in providing Quality of Service to different zones. And also saves the other zones in case, if there is a rouge process trying to consume all of the resources. And since there is no or very little overhead in creating/managing a zone itself it might be a good idea to run several application like Web Server, MySQL, Media Server, et. al. in their own separate zones <img src='http://www.abisen.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  With the help of capped-cpu and memory constructs one zone could be heavily thrashing it’s share of resource without even affecting the process on the other zones.</p>
<p>Now that we have the Zone defined it’s time to perform the actual installation inside this Branded Zone.</p>
<h2>Installing BrandZ: Linux (Fedora-10)</h2>
<p>Linux OS can be installed on a Branded Zone using two methods:</p>
<ul>
<li>Using the installer CD/DVD/ISO</li>
<li>Using a “tarball” of an installed system</li>
</ul>
<p>I chose the second option as there are known issues with the first option, and only selected few distributions are known to work. So I created a virtual machine on my “vmware” workstation, installed Fedora-10_i386, and created a tarball using the following command:</p>
<pre class="programlisting"># cd /
# tar -jcf fedora-10.tar.bz2 --exclude fedora-10.tat.bz2 \
      --exclude dev --exclude proc --exclude sys --exclude boot *</pre>
<p>Remember to unmount any NFS or CIFS share, if you are planning to create a tarball of an existing installation. I have also made the tarball available for download from here [ http://www.abisen.com/pub/fedora-10-brandZ/fedora10.tar.bz2 ].</p>
<p>You’ll also notice that we are excluding all of the device, kernel and sys directories, validating that there won’t be any separate instance of an OS running, only the applications and the system call’s would be interpreted and serviced by the solaris kernel.</p>
<p>These are the steps that I took for installing the linux tarball on my Branded Zone.</p>
<p><strong>Step 1: </strong>Installing the OS from the tarball inside the newly created Zone.</p>
<pre class="programlisting"># zoneadm -z Fedora-10 install -d /tmp/fedora10.tar.bz2
A ZFS file system has been created for this zone.
Installing zone 'Fedora-10' at root directory '/tank/Zones/Fedora-10'
from archive '/tmp/fedora10.tar.bz2'

This process may take several minutes.

Setting up the initial lx brand environment.
System configuration modifications complete.
Setting up the initial lx brand environment.
System configuration modifications complete.

Installation of zone 'Fedora-10' completed successfully.

Details saved to log file:
    "/tank/Zones/Fedora-10/root/var/log/Fedora-10.install.1075.log"</pre>
<p><strong>Note: </strong>The above command would also create a new ZFS file system with appropriate permissions.</p>
<p><strong>Step 2: </strong>Verify the presence of the newly created zone and all the other installed zones and their current state</p>
<pre class="programlisting"># zoneadm list -iv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   2 Fedora-9         running    /tank/Zones/Fedora-9           lx       shared
   3 Fedora-10        installed  /tank/Zones/Fedora-10          lx       shared
   - centos52         installed  /tank/Zones/centos52           lx       shared</pre>
<p><strong>Step 3: </strong>Booting the newly installed zone. One handy tip is to open a new terminal instance and connect to the console of the installed zone “Fedora-10” using the command “zlogin -C Fedora-10”. This would act as a monitor for all the activities taking place inside the zone while it’s booting up. Following screenshot shows that I mean:</p>
<pre class="programlisting"># zoneadm -z Fedora-10 boot</pre>
<p><strong>Step 4: </strong>Logging into the zone. Also notice that the console of my installation is clean and there are no error messages. In reality the first time you boot there would be many error messages. Which we will fix in the later steps. The following command would get us logged into a terminal session of the zone.</p>
<pre class="programlisting"># zlogin Fedora-10</pre>
<p><strong>Step 5: </strong>In this step we will clean the installation for error free bootup. Also I noticed that for some reason the startup scripts are not getting executed in my installation.  Which is fine as one of the positive side effect is that unnecessary services are not started by default :).</p>
<p>So upon further investigation it was found that the culprit for all the error message during bootup were also the init scripts (actually one script in particular: “/etc/rc.d/rc.sysinit”). I won’t go in detail but there were a lot of reference to /dev/urandom, loadable modules for device-mapper et. al. which are not eactly required in a Branded Zone (remember no kernel only applications). So I cleaned my /etc/rc.d/rc.sysinit and at the end I am also using this script to call all the other services that I would like to start during boot sequence.</p>
<p>My modified scrip can be downloaded from the following location [ http://www.abisen.com/pub/rc.sysinit ].</p>
<p><strong>Step 6: </strong>Configuring the yum with the rpmfusion [ www.rpmfusion.org ] repository and updating the system.</p>
<pre class="programlisting"># rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm \ 
           http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm</pre>
<pre class="programlisting"># yum update

# yum install media-tomb ffmpeg mplayer vlc-nox</pre>
<p><strong>Step 7: </strong>Modifying the startup script for media-tomb. The ethernet interface is a fake interface which is basically tied up to the global zone’s NIC. And there is no kernel/os running so some interfaces don’t respond the way they are supposed to in a real environment. And this prevents the media tomb to probe the ethernet nice (in my case bge0). So I modified the file “/etc/mediatomb.conf”, kept everything same but added the following line:</p>
<pre class="programlisting">IFACE_IP="192.168.0.29"</pre>
<p>And modified the startup by modifying the following lines:</p>
<pre class="programlisting"># [ ${NETWORKING} = "no" ] &amp;&amp; exit 0
daemon $NICELEVEL mediatomb $MEDIATOMB -i $IFACE_IP $MT_OPTIONS</pre>
<p>My version of media tomb startup script can be downloaded from [ http://www.abisen.com/pub/mediatomb ]</p>
<p><strong>Step 8: </strong>This sets everything in order for running media tomb. The interface can be accessed using http://IP(of the zone):50500.</p>
<p>In the next part I will talk about customization of media-tomb such that it could be used for real-time transcoding of the format’s that a UPnP player does not understands natively.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abisen.com/blog/?feed=rss2&amp;p=115</wfw:commentRss>
		</item>
		<item>
		<title>Analyzing iSCSI Performance (ZFS Intnet Log) - Part II</title>
		<link>http://www.abisen.com/blog/?p=95</link>
		<comments>http://www.abisen.com/blog/?p=95#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:04:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Networking]]></category>

		<category><![CDATA[OpenSolaris]]></category>

		<category><![CDATA[Storage]]></category>

		<category><![CDATA[iSCSI]]></category>

		<category><![CDATA[Networks]]></category>

		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.abisen.com/blog/?p=95</guid>
		<description><![CDATA[Disabling ZIL (Intent Log)
Before actually investing in some kind of Solid State Device, it would be nice to actually quantify how much improvement in write performance is possible. That is if I separate the ZIL to a dedicated, fast, transactional device. 

A quick and clean test would be to run a similar IOzone benchmark on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disabling ZIL (Intent Log)</strong></p>
<p>Before actually investing in some kind of Solid State Device, it would be nice to actually quantify how much improvement in write performance is possible. That is if I separate the ZIL to a dedicated, fast, transactional device. </p>
<p><center></center></p>
<p>A quick and clean test would be to run a similar IOzone benchmark on the iSCSI device and turning off the Intent Log completely from the ZFS file system. This should give me the extreme best case as it would take away the entire overhead of ZIL.
</p>
<p><b>Note:</b> Keeping the ZIL disabled is not at all recommended in any production system as it could severely damage the file system. And the file system is prone to corruption in the event of any crash.
</p>
<p>In order to turn off the ZIL dynamically the following command can be executed. I personally feel it’s a nice idea to restart the machine after making such change, especially if I am benchmarking. But I am too lazy so I followed the following steps:
</p>
<p><b>Step I:</b> Disable the ZFS Intent Log</p>
<pre class="programlisting"># echo zil_disable/W0t1 | mdb -kw</pre>
<p><b>Step II:</b> Unmount the ZFS file system in the concerned pool</p>
<pre class="programlisting"># zfs unmount /tank</pre>
<p><b>Step III:</b> Export the zpool</p>
<pre class="programlisting"># zpool export tank</pre>
<p><b>Step IV:</b> Import the zpool back, which would also mount all the file systems</p>
<pre class="programlisting"># zpool import tank</pre>
<p><b>Step V:</b> Execute the benchmarking applications</p>
<pre class="programlisting"># iozone -ac -s8G -i0 -i1 -y4k -q1M</pre>
<p><center></center><br />
<strong>Results</strong></p>
<p>The results were very interesting, as thought there was a big improvement in writes. But I didn’t expect the performance to increase by 26x on average. The following graph shows the numbers that I got after turning off the ZIL.</p>
<p><img src="http://www.abisen.com/blog/wp-content/uploads/2009/04/04052009-iscsi_performance_read_and_write_with_zil_disabled.png" alt="04052009-iscsi_performance_read_and_write_with_zil_disabled" title="04052009-iscsi_performance_read_and_write_with_zil_disabled" width="481" height="265" class="aligncenter size-full wp-image-90" /></p>
<p>Also notice that the Read performance also increased big time, ~110MB/s which is an improvement of around 12%. But it’s hard to say that the bottleneck is the back-end (solaris/zfs/iscsi) or the network itself since the performance is near-wire speed. The results from the perevious tests are mentioned in this <a href="http://www.abisen.com/blog/?p=9">entry</a></p>
<p><strong>Summary</strong></p>
<p>Summarizing all the pervious tests the following graphs shows the improvement I achieved with the two changes:</p>
<p><img src="http://www.abisen.com/blog/wp-content/uploads/2009/04/04052009-comparing_iscsi_write_performance_8k_to_128k_fs_block.png" alt="04052009-comparing_iscsi_write_performance_8k_to_128k_fs_block" title="04052009-comparing_iscsi_write_performance_8k_to_128k_fs_block" width="444" height="265" class="aligncenter size-full wp-image-89" /><br />
<img src="http://www.abisen.com/blog/wp-content/uploads/2009/04/04052009-comparing_iscsi_read_performance_8k_to_128k_fs_block.png" alt="04052009-comparing_iscsi_read_performance_8k_to_128k_fs_block" title="04052009-comparing_iscsi_read_performance_8k_to_128k_fs_block" width="446" height="266" class="aligncenter size-full wp-image-88" /></p>
<ol>
<li>Moving the file system block size from 8k to 128k</li>
<li>Running the tests with ZFS intent log disabled (case for SSD)</li>
</ol>
<p>There is still a lot to work on getting a perfect working system. The next step would be to insert a USB Flash Disk and see where does the performance lands (esp. on writes)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abisen.com/blog/?feed=rss2&amp;p=95</wfw:commentRss>
		</item>
		<item>
		<title>Analyzing iSCSI on ZFS (Playing With ZIL)</title>
		<link>http://www.abisen.com/blog/?p=76</link>
		<comments>http://www.abisen.com/blog/?p=76#comments</comments>
		<pubDate>Sat, 04 Apr 2009 08:32:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Networking]]></category>

		<category><![CDATA[OpenSolaris]]></category>

		<category><![CDATA[Storage]]></category>

		<category><![CDATA[iSCSI]]></category>

		<category><![CDATA[Networks]]></category>

		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.abisen.com/blog/?p=76</guid>
		<description><![CDATA[In the previous entry, I showed some performance numbers that I was able to achieve from my ZFS backed iSCSI targets. The read performance that I was able to achieve were great, unfortunately I was only able to touch max around 1MB/s on writes. 
After much discussions, I was inclining towards the theory that the [...]]]></description>
			<content:encoded><![CDATA[<p>In the previous <a href="http://www.abisen.com/blog/?p=9">entry</a>, I showed some performance numbers that I was able to achieve from my ZFS backed iSCSI targets. The read performance that I was able to achieve were great, unfortunately I was only able to touch max around 1MB/s on writes. </p>
<p>After much discussions, I was inclining towards the theory that the culprit is the high latency and low IO performance of my 5 x SATA-II RAID-Z, which is shared between the data, metadata and the ZFS Intent Log. ZFS Intent Log is the logging system for ZFS file system, responsible for maintaining the file system consistent in the event of crashes etc. ZIL is also used by the file system for providing synchronous writes, for POSIX compliancy. For a good performing system it is recommended that the device that hold’s the log is very fast (in terms of latency for handling many small random writes). Neelakanth’s <a href="http://blogs.sun.com/realneel/entry/the_zfs_intent_log">blog entry</a> has some very good info on ZIL.</p>
<h2>Playing with ZFS Intent Log (ZIL)</h2>
<p>So as next step, I will try to identify and more importantly quantify the kind of IO operations that are taking place during writes.</p>
<p>Typically Solid State Disks (SSD) with high transactional performance are recommended to be used for the ZFS Intent Logs. The only problem is that the cost of buying an expensive SSD disk would be prohibitively expensive esp. for my home brew NAS.</p>
<p>I still want to not only see how much a SSD device can really help (which is an easy part), but also to optimize the performance of my iSCSI targets for write performance.</p>
<p>In order to have fast Apple Time Machine backups I would need faster iSCSI devices. This would get better once Apple moves to ZFS as their native file system and the backup would truly mean sending the incremental snapshots using “zfs send”.</p>
<p>So I started by monitoring the activity on the logging subsystem using “dtrace”. Dtrace is one of the most exposing tool for realtime analysis, that I have come across.</p>
<p><center></center></p>
<p>So I planned a small experiment, where I would write (and re-write) a 128MB file with 256k block size using IOzone on the iSCSI device. And during this time would monitor all the activities on the ZIL. This requires setting two probes on the Solaris workstation before starting the IOzone test.</p>
<h2>Setting Probes on OpenSolaris</h2>
<p><strong>Probe 1:</strong> To collect information on all the ZIL activity.</p>
<pre class="programlisting">
<strong># dtrace -n zil\*:entry'{@[probefunc]=count();}' -n zio_free_blk:entry'{@[probefunc]=count();}' </strong>
dtrace: description 'zil*:entry' matched 44 probes
dtrace: description 'zio_free_blk:entry' matched 1 probe
^C

  zil_itx_clean                                                     4
  zil_clean                                                        16
  zil_header_in_syncing_context                                    82
  zil_sync                                                         82
  zil_vdev_compare                                               1152
  zil_flush_vdevs                                               31617
  zil_commit_writer                                             32457
  zil_lwb_write_done                                            32764
  zil_lwb_write_start                                           32764
  zio_free_blk                                                  32764
  zil_add_block                                                 32769
  zil_commit                                                    32933
  zil_lwb_commit                                                33106
  zil_itx_assign                                                33585
  zil_itx_create                                                33585
  zil_lwb_write_init                                            34253
</pre>
<p><strong>Probe 2: </strong>To monitor block size of the log writes.</p>
<pre class="programlisting">
<strong># dtrace -n ::zil_lwb_commit:entry'{@[1] = quantize((lwb_t*)args[2]->lwb_sz);}'</strong>
dtrace: description '::zil_lwb_commit:entry' matched 1 probe
^C

        1
           value  ------------- Distribution ------------- count
            2048 |                                         0
            4096 |                                         58
            8192 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   31202
           16384 |@@                                       1643
           32768 |                                         203
           65536 |                                         0        
</pre>
<p><strong>Note:</strong> Notice the ^C character right below the probe; Once the IOzone run is finished the probe must be interrupted for getting the results.</p>
<p><img src="http://www.abisen.com/blog/wp-content/uploads/2009/04/04042009-iscsi-blog-2.png" alt="04042009-iscsi-blog-2" title="04042009-iscsi-blog-2" width="334" height="170" class="aligncenter size-full wp-image-79" /></p>
<p><center></center></p>
<p>Executing the IOzone test on the client: The following test would basically write 256MB of data to the iSCSI device.</p>
<pre class="programlisting">
<strong>$ ~/Downloads/iozone -r256k -s128m -i0 -w </strong>
     Iozone: Performance Test of File I/O
                Version $Revision: 3.321 $
                Compiled for 32 bit mode.
                Build: macosx
         .
         .
         .
        Record Size 256 KB
        File size set to 131072 KB
        Setting no_unlink
        Command line used: /Users/abisen/Downloads/iozone -r256k -s128m -i0 -w
        Output is in Kbytes/sec
        Time Resolution = 0.000001 seconds.
        Processor cache size set to 1024 Kbytes.
        Processor cache line size set to 32 bytes.
        File stride size set to 17 * record size.

              KB  reclen   write rewrite
          131072     256     872     869   

iozone test complete.
</pre>
<p>I still need to completely understand the output from the two ZFS probes, but it is clearly visible that for writing 256MB of data it requires a lot of activity on the logging subsystem. Now that we have quantified the number of commits and block size of commits on the ZIL. It would be very helpful to somehow see how our storage subsystem is performing from IOPS and latency perspective.</p>
<p>I performed a quick test again, using the same IOzone benchmarking tool and iostat. But this time I executed the benchmark locally on the Solaris workstation. Alternatively I also created a small ZFS file system on an old SanDisk Cruzr (512MB) USB Flash Disk. And ran the same test on this file system as well. Just to get an idea on how a USB Flash would fare against my 5 x SATA-II RAID-Z volume.</p>
<p>The video below shows what I noticed, Not only the service time (latency) on the USB Flash Disk was 4-5 times better than 5 x SATA HDD’s, even the IOPS that the old little USB flash could sustain were far greater than what 5 SATA disks could achieve.</p>
<p><center><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/WxQYnmmX7NM&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WxQYnmmX7NM&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></center></p>
<p>So a USB Flash Disk might have some potential for helping in improving the write performance of a home brew NAS. I am hesitant on trying this out right away because, it&#8217;s easy to add a new device to a ZFS file system, but I have not been able to find any information on deleting/removing a device from a Zpool. </p>
<p>Next steps:</p>
<ul>
<li>Testing the performance by disabling the ZIL completely. This would give an idea on how fast can these iSCSI device get if ZIL is taken out of the picture. A ZFS file system should never be used with ZIL disabled, but it&#8217;s a neat feature for testing if separating ZIL would give any performance benefits.</li>
<li>Testing the performance of the ZFS file system by using a USB based Flash Disk.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.abisen.com/blog/?feed=rss2&amp;p=76</wfw:commentRss>
		</item>
	</channel>
</rss>
