<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>AV-Looks: Optimizing Rails</title>
    <link>http://avlooks.net/articles/2006/01/31/optimizing-rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Watching and Wondering</description>
    <item>
      <title>Optimizing Rails</title>
      <description>&lt;p&gt;For web hosts and developers, this is a big issue. If Rails is not managed well, it can become a huge drain on system resources.&lt;/p&gt;


	&lt;p&gt;Here are some &lt;a href="http://weblog.textdrive.com/article/175/rails-optimizing-resource-usage"&gt;excellent guidelines&lt;/a&gt; to review.  We welcome comments!&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;&lt;span class="caps"&gt;NOTE&lt;/span&gt;:  We suggest putting all of the following in a daily cronjob to keep your ruby runtime environment fresh.  In this script you should stop apache and/or lighttpd first, then start them up after the cleanup operations are complete.&lt;/em&gt;&lt;/p&gt;


	&lt;h3&gt;Get rid of stale dispatch processes&lt;/h3&gt;


	&lt;p&gt;Whether you are running Apache or Lighttpd, dispatch.fcgi processes, once started, don&amp;#8217;t clean themselves up.  Therefore it is a good idea when restarting Apache and/or Lighttpd to check for any stale dispatch.fcgi processes, and get rid of them:&lt;/p&gt;


&lt;pre&gt;
## Kill stale dispatch.fcgi processes 
killall -9 dispatch.fcgi
&lt;/pre&gt;

	&lt;h3&gt;Purge old ruby sessions&lt;/h3&gt;


&lt;pre&gt;
## Purge Ruby sessions 1 day (24 hours) old and over
find /tmp/ -name 'ruby_sess*' -ctime -1|xargs rm -rf
&lt;/pre&gt;</description>
      <pubDate>Tue, 31 Jan 2006 18:47:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:9176d922edb8ec1b73d1925148eac60a</guid>
      <author>av@avlux.net (Andrew)</author>
      <link>http://avlooks.net/articles/2006/01/31/optimizing-rails</link>
      <category>System Admin</category>
      <category>Ruby on Rails</category>
      <category>rubyonrails</category>
      <category>howto</category>
      <category>sysadmin</category>
    </item>
    <item>
      <title>"Optimizing Rails" by Andrew vonderLuft</title>
      <description>&lt;p&gt;Thanks Nathaniel.  Points well taken!&lt;/p&gt;</description>
      <pubDate>Sun, 26 Feb 2006 01:53:34 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:49f142ab-da6f-470e-804d-452aa850fd6f</guid>
      <link>http://avlooks.net/articles/2006/01/31/optimizing-rails#comment-9</link>
    </item>
    <item>
      <title>"Optimizing Rails" by Nathaniel</title>
      <description>&lt;p&gt;-1 means everything newer than 24 hours.&lt;/p&gt;


	&lt;p&gt;You want&amp;#8230;&lt;/p&gt;


	&lt;p&gt;find /tmp/ -name &amp;#8216;ruby_sess*&amp;#8217; -ctime +1|xargs rm -f&lt;/p&gt;


	&lt;p&gt;Also, you will note that I left out the -r flag. For deleting files, it is definately overkill to do a -r (recursive) delete.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Feb 2006 00:36:33 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:feb4b0a0-caad-48b4-a43a-561e59d6a7b1</guid>
      <link>http://avlooks.net/articles/2006/01/31/optimizing-rails#comment-8</link>
    </item>
  </channel>
</rss>
