<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: Keeping your RHEL VMs from crushing your storage at 4:02am</title>
	<atom:link href="http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/</link>
	<description>qstat -u aleonard -s z</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:27:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: AskApache Apache</title>
		<link>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/comment-page-1/#comment-323</link>
		<dc:creator>AskApache Apache</dc:creator>
		<pubDate>Tue, 16 Mar 2010 05:40:16 +0000</pubDate>
		<guid isPermaLink="false">http://andyleonard.com/?p=315#comment-323</guid>
		<description>This causes sleep to sleep for at a minimum, 10 minutes, at a maximum 2hours 10m - if you use s you can really get specific.
&lt;code&gt;sleep $(( $RANDOM % 120 +10 ))m;&lt;/code&gt;

That plus this turns it into 1 command, so at least you aren&#039;t just creating processes that are just hanging out all day *shudder*.  

( renice +19 -p $$ &amp;&gt;/dev/null; ( sleep $(( $RANDOM % 120 + 10 ))m; /usr/bin/updatedb --prunefs=&quot;$(&lt; /proc/filesystems awk &#039;$1 == &quot;nodev&quot; { print $2 }&#039;)&quot;; ) &amp; )


sleep $(( $RANDOM % 120 + 10 ))m &amp;&amp; /usr/bin/updatedb --prunefs=&quot;`sed -e /nodev/!d; s/nodev[\t\ ]*\(.*\)/\1/ &lt; /proc/filesystems`&quot;


Or you can do this -
nice -n 19 sh -c ( ( sleep $(( $RANDOM % 120 + 10 ))s; /usr/bin/updatedb --prunefs=&quot;`sed -e /nodev/!d; s/nodev[\t\ ]*\(.*\)/\1/ &lt; /proc/filesystems`&quot;; ) &amp; )

Also make sure to put the correct limits on the slocate group in /etc/security/limits.conf, or use ionice also.

Since locate is only used by interactive users, I have it setup to run with /etc/cron.hourly - before it starts running it tests if the user is logged in and active (within the past hour), if not it just exits.   Having this program run every night regardless of whether anyone even uses the command is dumb.  On top of running every hour, I also run updatedb on login (again checking the last login time, to make sure it&#039;s not repeatedly running).

And I also use this alias:

alias updatedb=&#039;( ( nice -n 19 updatedb &amp;&gt;/dev/null ) &amp; )&#039; 


locate has been one of my favorite utils since day 1 on unix, sadly it&#039;s come to the point where a simple find command can do much better than locate (part of the findutils after all).</description>
		<content:encoded><![CDATA[<p>This causes sleep to sleep for at a minimum, 10 minutes, at a maximum 2hours 10m &#8211; if you use s you can really get specific.<br />
<code>sleep $(( $RANDOM % 120 +10 ))m;</code></p>
<p>That plus this turns it into 1 command, so at least you aren&#8217;t just creating processes that are just hanging out all day *shudder*.  </p>
<p>( renice +19 -p $$ &amp;&gt;/dev/null; ( sleep $(( $RANDOM % 120 + 10 ))m; /usr/bin/updatedb &#8211;prunefs=&#8221;$(&lt; /proc/filesystems awk &#039;$1 == &quot;nodev&quot; { print $2 }&#039;)&quot;; ) &amp; )</p>
<p>sleep $(( $RANDOM % 120 + 10 ))m &amp;&amp; /usr/bin/updatedb &#8211;prunefs=&#8221;`sed -e /nodev/!d; s/nodev[\t\ ]*\(.*\)/\1/ &lt; /proc/filesystems`&quot;</p>
<p>Or you can do this -<br />
nice -n 19 sh -c ( ( sleep $(( $RANDOM % 120 + 10 ))s; /usr/bin/updatedb &#8211;prunefs=&#8221;`sed -e /nodev/!d; s/nodev[\t\ ]*\(.*\)/\1/ &lt; /proc/filesystems`&quot;; ) &amp; )</p>
<p>Also make sure to put the correct limits on the slocate group in /etc/security/limits.conf, or use ionice also.</p>
<p>Since locate is only used by interactive users, I have it setup to run with /etc/cron.hourly &#8211; before it starts running it tests if the user is logged in and active (within the past hour), if not it just exits.   Having this program run every night regardless of whether anyone even uses the command is dumb.  On top of running every hour, I also run updatedb on login (again checking the last login time, to make sure it&#8217;s not repeatedly running).</p>
<p>And I also use this alias:</p>
<p>alias updatedb=&#8217;( ( nice -n 19 updatedb &amp;&gt;/dev/null ) &amp; )&#8217; </p>
<p>locate has been one of my favorite utils since day 1 on unix, sadly it&#8217;s come to the point where a simple find command can do much better than locate (part of the findutils after all).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/comment-page-1/#comment-255</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 20 Nov 2009 23:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://andyleonard.com/?p=315#comment-255</guid>
		<description>Thanks for the comment, Nate.  I hadn&#039;t considered makewhatis when I wrote this article, but I believe that it is called with the &quot;-u&quot; flag which greatly reduces its I/O load; a couple quick experiments on my workstation seem to bear this out, but, obviously, test in your own environment.

Adding the random delay loop in a separate file in /etc/cron.daily - say &quot;1randomdelay&quot; so it runs after the &quot;0*&quot; files - may also be effective (and cleaner) and will stagger all the files after it, sorted by the glob in run-parts.</description>
		<content:encoded><![CDATA[<p>Thanks for the comment, Nate.  I hadn&#8217;t considered makewhatis when I wrote this article, but I believe that it is called with the &#8220;-u&#8221; flag which greatly reduces its I/O load; a couple quick experiments on my workstation seem to bear this out, but, obviously, test in your own environment.</p>
<p>Adding the random delay loop in a separate file in /etc/cron.daily &#8211; say &#8220;1randomdelay&#8221; so it runs after the &#8220;0*&#8221; files &#8211; may also be effective (and cleaner) and will stagger all the files after it, sorted by the glob in run-parts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nate</title>
		<link>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/comment-page-1/#comment-253</link>
		<dc:creator>nate</dc:creator>
		<pubDate>Fri, 20 Nov 2009 22:45:12 +0000</pubDate>
		<guid isPermaLink="false">http://andyleonard.com/?p=315#comment-253</guid>
		<description>also disable the makewhatis cron I found that to be expensive as well.

I just checked my configs and it turns out I don&#039;t have updatedb disabled on my VMs, I thought I did, suppose I should go and disable it. I do have my cfengine installation push out a version of the makewhatis cron file that just has an exit 0 at the top of it.</description>
		<content:encoded><![CDATA[<p>also disable the makewhatis cron I found that to be expensive as well.</p>
<p>I just checked my configs and it turns out I don&#8217;t have updatedb disabled on my VMs, I thought I did, suppose I should go and disable it. I do have my cfengine installation push out a version of the makewhatis cron file that just has an exit 0 at the top of it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

