<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Racker Hacker &#187; iowait</title>
	<atom:link href="http://rackerhacker.com/tag/iowait/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:07:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Reduce disk I/O for small reads using memory</title>
		<link>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/</link>
		<comments>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 17:00:27 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[iowait]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=316</guid>
		<description><![CDATA[Many applications that are used on a standard server perform quite a few of small writes to the disk (like MySQL or Apache). These writes can pile up and limit the performance of your applications. If you have kernel 2.6.9 or later, you can adjust how these small writes are handled to allow for better [...]<p><a href="http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/">Reduce disk I/O for small reads using memory</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Many applications that are used on a standard server perform quite a few of small writes to the disk (like MySQL or Apache).  These writes can pile up and limit the performance of your applications.  If you have kernel 2.6.9 or later, you can adjust how these small writes are handled to allow for better performance.</p>
<p>There's two main kernel variables to know:</p>
<p><strong>vm.dirty_ratio</strong> - The highest % of your memory that can be used to hold dirty data.  If you set this to a low value, the kernel will flush small writes to the disk more often.  Higher values allow the small writes to stack up in memory.  They'll go to the disk in bigger chunks.</p>
<p><strong>vm.dirty_background_ratio</strong> - The lowest % of your memory where pdflush is told to stop when it is writing dirty data.  You'll want to keep this set as low as possible.</p>
<p>These might confuse you.  In short, when your memory begins filling with little pieces of data that needs to be written to the disk, it will keep filling until it reaches the dirty_ratio.  At that point, pdflush will start up, and it will write data until it reduces the dirty data to the value set by dirty_background_ratio.</p>
<p>Stock 2.6.9 kernels have a dirty_background_ratio of 10% and a dirty_ratio of 40%.  Some distributions tweak these defaults to something different, so you may want to review the settings on your system.  On a system with heavy disk I/O, you can increase the dirty_ratio and reduce the dirty_background_ratio.  A little experimentation may be necessary to find the perfect setting for your server.</p>
<p>If you want to play with the variables, just use your standard echo:</p>
<p><code>echo 5 &gt; /proc/sys/vm/dirty_background_ratio<br />
echo 60 &gt; /proc/sys/vm/dirty_ratio</code></p>
<p>Once you've found the right setting, you can set it permanently by adding lines to your /etc/sysctl.conf:</p>
<p><code>vm.dirty_background_ratio = 5<br />
vm.dirty_ratio = 60</code></p>
<p>If you have a reliable server with a good RAID card and power supply, you could set the dirty_ratio to 100 and the dirty_background_ratio to 1.  This was recommended by a buddy of mine who runs quite a few servers running virtual machines.</p>
<p><a href="http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/">Reduce disk I/O for small reads using memory</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reduce iowait in Plesk: put qmail&#039;s queue on a ramdisk</title>
		<link>http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/</link>
		<comments>http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 18:16:57 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[iowait]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/</guid>
		<description><![CDATA[I really dislike qmail. But, since I use Plesk, I'm stuck with it. However, I found a way to improve it's awful mail queue performance by putting the mail queue onto a ramdisk. This is actually pretty darned easy to do. First, toss a line like this into your /etc/fstab: none /mailqueue tmpfs defaults,size=100m,nr_inodes=999k,mode=775 0 [...]<p><a href="http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/">Reduce iowait in Plesk: put qmail's queue on a ramdisk</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I really dislike qmail.  But, since I use Plesk, I'm stuck with it.  However, I found a way to improve it's awful mail queue performance by putting the mail queue onto a ramdisk.  This is actually pretty darned easy to do.</p>
<p>First, toss a line like this into your /etc/fstab:</p>
<p><code>
<pre>none    /mailqueue      tmpfs   defaults,size=100m,nr_inodes=999k,mode=775      0       0</pre>
<p></code></p>
<p>This will make a 100MB ramdisk on /mailqueue.  Now, just symlink /var/qmail/mqueue to /mailqueue and move your e-mail over:</p>
<p># mount /mailqueue<br />
# chmod 750 /mailqueue<br />
# chown qmailq:qmail /mailqueue<br />
# mv /var/qmail/mqueue /var/qmail/mqueue-old<br />
# ln -s /mailqueue /var/qmail/mqueue<br />
# rsync -av /var/qmail/mqueue-old /mailqueue</p>
<p>This has significantly cut the iowait on my server during heavy e-mail periods.  In addition, tools like <a href="http://sourceforge.net/projects/qmhandle">qmHandle</a> now fly through my mail queue and give me reports very quickly.</p>
<p><a href="http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/">Reduce iowait in Plesk: put qmail's queue on a ramdisk</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/03/14/reduce-iowait-in-plesk-put-qmails-queue-on-a-ramdisk/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hunting down elusive sources of iowait</title>
		<link>http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/</link>
		<comments>http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 18:00:18 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[iowait]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/</guid>
		<description><![CDATA[A question I'm asked daily is "How can I find out what is generating iowait on my server?" Sure, you can dig through pages of lsof output, restart services, or run strace, but it can be a frustrating process. I saw a process on this blog post, and I changed the regexes to fit Red [...]<p><a href="http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/">Hunting down elusive sources of iowait</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>A question I'm asked daily is "How can I find out what is generating iowait on my server?"  Sure, you can dig through pages of lsof output, restart services, or run strace, but it can be a frustrating process.  I saw a process on <a href="http://blog.eikke.com/index.php/ikke/2007/03/22/who_s_abusing_my_sata_controller">this blog post</a>, and I changed the regexes to fit Red Hat and CentOS systems a bit better:</p>
<p><code># /etc/init.d/syslog stop<br />
# echo 1 > /proc/sys/vm/block_dump<br />
# dmesg | egrep "READ|WRITE|dirtied" | egrep -o '([a-zA-Z]*)' | sort | uniq -c | sort -rn | head<br />
   1526 mysqld<br />
    819 httpd<br />
    429 kjournald<br />
     35 qmail<br />
     27 in<br />
      7 imapd<br />
      6 irqbalance<br />
      5 pop<br />
      4 pdflush<br />
      3 spamc</code></p>
<p>In my specific situation, it looks like MySQL is the biggest abuser of my disk, followed by Apache and the filesystem journaling.  As expected, qmail is a large contender, too.</p>
<p><strong>Don't forget to set things back to their normal state when you're done!</strong></p>
<p><code># echo 0 > /proc/sys/vm/block_dump<br />
# /etc/init.d/syslog start</code></p>
<p><a href="http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/">Hunting down elusive sources of iowait</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/03/11/hunting-down-elusive-sources-of-iowait/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>High iowait on RHEL 4 with Plesk and SpamAssassin</title>
		<link>http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/</link>
		<comments>http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 18:38:58 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[iowait]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/</guid>
		<description><![CDATA[One of my biggest complaints on RHEL 4 is the large resource usage by the version of SpamAssassin that is installed. When it runs, it uses a ton of CPU time and causes a lot of disk I/O as well. When running top, you may see multiple spamd processes. For a high-volume e-mail server (like [...]<p><a href="http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/">High iowait on RHEL 4 with Plesk and SpamAssassin</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of my biggest complaints on RHEL 4 is the large resource usage by the version of SpamAssassin that is installed.  When it runs, it uses a ton of CPU time and causes a lot of disk I/O as well.  When running top, you may see multiple spamd processes.  For a high-volume e-mail server (like the one I administer), this is simply unacceptable.</p>
<p>I decided to do something about it, and here are the steps:</p>
<p><strong>First,</strong> you will need two RPMs:<br />
Latest <a href="http://dag.wieers.com/rpm/packages/spamassassin/">SpamAssassin RPM from Dag</a><br />
The <a href="http://autoinstall.plesk.com/">psa-spamassassin RPM from SWSoft/Parallels</a>.</p>
<p>Once you have them both on the server, install the new SpamAssassin package from Dag:</p>
<p><code># rpm -Uvh spamassassin-(version).el4.rf.(arch).rpm</code></p>
<p>At this point, Plesk's spamassassin scripts will be non-functional, but the next step will fix it:</p>
<p><code># rpm -Uvh --force psa-spamassassin-(version).(arch).rpm</code></p>
<p><strong>NOTE: DO NOT REMOVE the psa-spamassassin RPM.  This will begin stripping your system of all SpamAssassin configurations and it cannot be reversed!</strong></p>
<p>Plesk's SpamAssassin scripts have been restored at this point in the process.  Now, we need to do the part that really makes SpamAssassin work efficiently:</p>
<p><code># sa-update; sa-compile;</code></p>
<p>This will update the SpamAssassin rules, and it will compile the rules with re2c (you may also need to <a href="http://dag.wieers.com/rpm/packages/re2c/">get this RPM from Dag</a>).  This compilation means less disk access, and less CPU time being used to process e-mails.</p>
<p>To activate the compiled rules within SpamAssassin, uncomment the plugin line in /etc/mail/spamassassin/v320.pre:</p>
<p><code># Rule2XSBody - speedup by compilation of ruleset to native code<br />
#<br />
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody</code></p>
<p>Please bear in mind that this process is done <em>at your own risk</em>.  This may cause issues getting support from SWSoft or your hosting company.  This has been tested on Red Hat Enterprise Linux 4 64-bit with Plesk 8.1.1, 8.2.0, and 8.2.1 with SpamAssassin 3.2.3 and 3.2.4. </p>
<p><a href="http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/">High iowait on RHEL 4 with Plesk and SpamAssassin</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/01/31/high-iowait-on-rhel-4-with-plesk-and-spamassassin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

