<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkIDQ3k9cSp7ImA9WhRaGUo.&quot;"><id>tag:blogger.com,1999:blog-4793880243486517617</id><updated>2012-02-23T15:29:32.769+09:00</updated><category term="ZFS" /><title>Days of a mirror admin</title><subtitle type="html">Various topics about a mirror server ftp.jaist.ac.jp very famous in Japan for  handling very heavy traffic.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://mirror-admin.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://mirror-admin.blogspot.com/" /><author><name>Kazuhiro Fujieda</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_g5sgABM6zvs/TEgmy2bl6_I/AAAAAAAAAIg/1ow3FfVgNcI/S220/twitter.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/CuriousScribblesOfAMirrorAdmin" /><feedburner:info uri="curiousscribblesofamirroradmin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUUMSX87eCp7ImA9WhRXF00.&quot;"><id>tag:blogger.com,1999:blog-4793880243486517617.post-2009716615970423145</id><published>2011-12-07T10:34:00.000+09:00</published><updated>2011-12-24T14:08:08.100+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-24T14:08:08.100+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ZFS" /><title>How to change the l2arc_write_max dynamically</title><content type="html">The ZFS sets the value of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;/span&gt; to the each cache device of the L2ARC only when you add it to a pool of the ZFS or restart the OS. If you want to change the value dynamically, you should follow the following steps with the mdb.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Start the mdb with the root privilege.&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdb -kw&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Print the list of the addresses of the actual write max for each device.&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;gt; L2ARC_dev_list::walk list | ::print -a l2arc_dev_t l2ad_write&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
30074670a00 l2ad_write = 0x800000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
300ebae8818 l2ad_write = 0x800000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
3014a4269b0 l2ad_write = 0x800000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
30164ae3be0 l2ad_write = 0x800000&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Set a proper value to these addresses.&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;gt; 0x30074670a00/Z c00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
0x30074670a00:  0x800000               =       0xc00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&amp;gt; 0x300ebae8818/Z c00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
0x300ebae8818:  0x800000               =       0xc00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&amp;gt; 3014a4269b0/Z c00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
0x3014a4269b0:  0x800000               =       0xc00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
&amp;gt; 30164ae3be0/Z c00000&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;
0x30164ae3be0:  0x800000               =       0xc00000&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
Changing the value dynamically may cause unexpected behavior. I don't recomend it though I have never experienced any problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4793880243486517617-2009716615970423145?l=mirror-admin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Zs22sGRLxnD0dLfj1XL-oTXL0eI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zs22sGRLxnD0dLfj1XL-oTXL0eI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Zs22sGRLxnD0dLfj1XL-oTXL0eI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zs22sGRLxnD0dLfj1XL-oTXL0eI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CuriousScribblesOfAMirrorAdmin/~4/l5XNjt0o_JM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mirror-admin.blogspot.com/feeds/2009716615970423145/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://mirror-admin.blogspot.com/2011/12/how-to-change-l2arcwritemax-dynamically.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/2009716615970423145?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/2009716615970423145?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CuriousScribblesOfAMirrorAdmin/~3/l5XNjt0o_JM/how-to-change-l2arcwritemax-dynamically.html" title="How to change the l2arc_write_max dynamically" /><author><name>Kazuhiro Fujieda</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_g5sgABM6zvs/TEgmy2bl6_I/AAAAAAAAAIg/1ow3FfVgNcI/S220/twitter.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mirror-admin.blogspot.com/2011/12/how-to-change-l2arcwritemax-dynamically.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEABR3c8eCp7ImA9WhRVFE0.&quot;"><id>tag:blogger.com,1999:blog-4793880243486517617.post-4662062666428087765</id><published>2011-12-06T17:51:00.000+09:00</published><updated>2012-01-13T06:12:36.970+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-13T06:12:36.970+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ZFS" /><title>How the L2ARC works</title><content type="html">The L2ARC of the ZFS is quite different from an ordinary L2 cache of a CPU. The following figure shows the structure of the caches of ZFS. The L2ARC caches only blocks in the ARC read from HDDs. It doesn't cache dirty blocks in the ARC written to HDDs. There is no data transfer between L2ARC and HDDs. When the ZFS doesn't cache a requested block in the ARC but&amp;nbsp; the L2ARC, it copy the block to the ARC and respond it.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; margin: 0px; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-BzuAaLMPzXY/TtxZ8O_yflI/AAAAAAAAAvk/d7OdpQPqLts/s1600/L2ARC2.png" imageanchor="1"&gt;&lt;img border="0" height="148" src="http://1.bp.blogspot.com/-BzuAaLMPzXY/TtxZ8O_yflI/AAAAAAAAAvk/d7OdpQPqLts/s320/L2ARC2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
The L2ARC caches blocks almost evicted from the ARC. ZFS periodically scans a limited range from the tail of a LRU in the ARC. It gathers blocks not cached yet in the L2ARC until the total size of them reaches the size defined by &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;/span&gt;. The default is 8MiB. The scan range equals the&amp;nbsp;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;/span&gt; times the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_headroom&lt;/span&gt;. The default of the 
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_headroom&lt;/span&gt; is 2. A higher value makes the total of the gathered blocks near to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;/span&gt;. The following figure based on &lt;a href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/fs/zfs/arc.c#3612"&gt;the comment in the arc.c&lt;/a&gt; shows this process. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; margin: 0px 0px 0px -25px; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-31S6dPU_ZaU/Tt28YVL2VvI/AAAAAAAAAwA/TnAxbDoeosY/s1600/L2ARC3.png" imageanchor="1"&gt;&lt;img border="0" height="195" src="http://3.bp.blogspot.com/-31S6dPU_ZaU/Tt28YVL2VvI/AAAAAAAAAwA/TnAxbDoeosY/s550/L2ARC3.png" width="550" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The L2ARC forms one or more ring buffers. ZFS copies a hit block in the L2ARC to the ARC, but it doesn't move this to the head of the L2ARC. It evicts old blocks from the L2ARC to make room to copy new blocks. If the L2ARC has multiple SSDs, each of them forms a separate ring buffer. The ZFS uses them in the round robin manner.&lt;br /&gt;
&lt;br /&gt;
There are some parameters to control the cycle of the scanning. The ZFS chooses one of two cycles by the total size of the gathered blocks. If the total size is equal to or smaller than the half of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;/span&gt;, it chooses the minutes of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_feed_secs&lt;/span&gt;. The default is 1. Otherwise it chooses the milliseconds of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_feed_min_ms&lt;/span&gt;. The default is 200. The cycle becomes slow if the L2ARC caches enough blocks and the total size of gathered blocks is small. Otherwise the cycle becomes fast.&lt;br /&gt;
&lt;br /&gt;
I investigated the behavior of the L2ARC on our server with the dtrace script shown below and found a few tips. A higher value of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_headroom&lt;/span&gt; increases the speed of filling the cache. A higher value of the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;l2arc_write_max&lt;span style="font-family: inherit;"&gt; also increases the speed if the cache isn't enough filled. &lt;/span&gt;&lt;/span&gt;Otherwise it slows down the speed because of the slow scanning cycle. &lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1422998.js?file=gistfile1.txt"&gt;
&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4793880243486517617-4662062666428087765?l=mirror-admin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IpGBIHE97wYq3npKKeYOK2C4o_k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IpGBIHE97wYq3npKKeYOK2C4o_k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IpGBIHE97wYq3npKKeYOK2C4o_k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IpGBIHE97wYq3npKKeYOK2C4o_k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CuriousScribblesOfAMirrorAdmin/~4/HMtbZHkLCwQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mirror-admin.blogspot.com/feeds/4662062666428087765/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://mirror-admin.blogspot.com/2011/12/how-l2arc-works.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/4662062666428087765?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/4662062666428087765?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CuriousScribblesOfAMirrorAdmin/~3/HMtbZHkLCwQ/how-l2arc-works.html" title="How the L2ARC works" /><author><name>Kazuhiro Fujieda</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_g5sgABM6zvs/TEgmy2bl6_I/AAAAAAAAAIg/1ow3FfVgNcI/S220/twitter.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-BzuAaLMPzXY/TtxZ8O_yflI/AAAAAAAAAvk/d7OdpQPqLts/s72-c/L2ARC2.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mirror-admin.blogspot.com/2011/12/how-l2arc-works.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIDQnw6fCp7ImA9WhRaGUo.&quot;"><id>tag:blogger.com,1999:blog-4793880243486517617.post-1787302753265698285</id><published>2011-12-04T00:26:00.001+09:00</published><updated>2012-02-23T15:29:33.214+09:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-23T15:29:33.214+09:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ZFS" /><title>Higher l2arc_write_max is considered harmful</title><content type="html">&lt;a href="http://storagetuning.wordpress.com/2011/12/01/zfs-tuning-for-ssds/"&gt;This post&lt;/a&gt; is completely wrong. It shows how to tune the L2ARC of the ZFS as follows.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Change the Record Size to a much lower value than 128 KB.&lt;/li&gt;
&lt;li&gt;Change the l2arc_write_max to a higher value.&lt;/li&gt;
&lt;li&gt; Set the l2arc_noprefetch=0.&lt;/li&gt;
&lt;/ul&gt;
All of them causes bad effects.
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
You &lt;b&gt;must not&lt;/b&gt; set the record size of the ZFS except you use the ZFS for DBMSs. The ZFS automatically chooses a proper record size of each file. Setting the record size spoils it.&lt;br /&gt;
&lt;br /&gt;
You shouldn't set the l2arc_write_max a higher value to boost filling the L2ARC. It causes an opposite effect. The ZFS uses this parameter to decide the cycle of the filling. It chooses 1 sec cycle if the size of data to fill the L2ARC is equal to or less than the half of this parameter. Otherwise it chooses 200 ms cycle. A higher value lets the ZFS choose 1 sec cycle and slows down the filling.&lt;br /&gt;
&lt;br /&gt;
If you want to boost it, you should set the l2arc_headroom a higher value. A proper value depends on the workloads of your ZFS. The default value 2 is too small in many cases. Higher value allows ZFS to gather data up to the l2arc_write_max and choose 200 ms cycle.&lt;br /&gt;
&lt;br /&gt;
You shouldn't set the l2arc_noprefetch 0. If you set 0, the ZFS tends to store unused&amp;nbsp; prefetched data to the L2ARC. This data unnecessarily evicts cached blocks from the L2ARC and lowers the efficiency of the L2ARC.&lt;br /&gt;
&lt;br /&gt;
That post shows the design of the L2ARC is based on the characteristics of SSDs in the old days. This is actually true. The L2ARC expects rather low IOPS and avoid writing much data. You can't however improve the performance of the ZFS by adjusting the parameters of the L2ARC to nowadays incredible SSDs. The L2ARC can't work effectively on such messed parameters by design.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4793880243486517617-1787302753265698285?l=mirror-admin.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qbvM3BzhSu1cxV6yTqvo3IWmr74/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qbvM3BzhSu1cxV6yTqvo3IWmr74/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qbvM3BzhSu1cxV6yTqvo3IWmr74/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qbvM3BzhSu1cxV6yTqvo3IWmr74/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CuriousScribblesOfAMirrorAdmin/~4/9lb9GwXQxVg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://mirror-admin.blogspot.com/feeds/1787302753265698285/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://mirror-admin.blogspot.com/2011/12/higher-l2arcwritemax-is-considered.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/1787302753265698285?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4793880243486517617/posts/default/1787302753265698285?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CuriousScribblesOfAMirrorAdmin/~3/9lb9GwXQxVg/higher-l2arcwritemax-is-considered.html" title="Higher l2arc_write_max is considered harmful" /><author><name>Kazuhiro Fujieda</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://3.bp.blogspot.com/_g5sgABM6zvs/TEgmy2bl6_I/AAAAAAAAAIg/1ow3FfVgNcI/S220/twitter.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://mirror-admin.blogspot.com/2011/12/higher-l2arcwritemax-is-considered.html</feedburner:origLink></entry></feed>

