<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>schuerrer.org Weblog: Tag apache</title>
    <link>http://blog.schuerrer.org/articles/tag/apache</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Martin Schuerrer's perspective</description>
    <item>
      <title>F still comes before S</title>
      <description>&lt;p&gt;Some time ago &lt;a href="http://www.karmiccoding.com/pages/about"&gt;David Felstead&lt;/a&gt;, a &lt;em&gt;senior &lt;a href="http://www.site5.com"&gt;Site5&lt;/a&gt; engineer&lt;/em&gt;, said that Site5 was &lt;a href="http://www.karmiccoding.com/articles/2005/09/23/s-is-the-new-f-let-the-age-of-scgi-rails-begin"&gt;considering switching from FastCGI to &lt;span class="caps"&gt;SCGI&lt;/span&gt;&lt;/a&gt; and so I decided that if Site5 was considering it, I could simply do it.&lt;/p&gt;


He wrote about some major pains in the proverbial with FastCGI:
	&lt;ul&gt;
	&lt;li&gt;It&amp;#8217;s hard to set up&lt;/li&gt;
		&lt;li&gt;It&amp;#8217;s hard to monitor&lt;/li&gt;
		&lt;li&gt;It requires dedicated tasks to keep working (reaper, spawner, spinner anyone?)&lt;/li&gt;
		&lt;li&gt;Currently no one is actively developing the Apache module.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;According to him &lt;span class="caps"&gt;SCGI&lt;/span&gt; is better, because it only took him 15 minutes to set up properly. And now for the &lt;strong&gt;but&lt;/strong&gt;:&lt;/p&gt;


	&lt;p&gt;As you, dear well informed reader, of course know one feature of FastCGI is to keep &lt;em&gt;multiple&lt;/em&gt; instances of the Rails dispatcher open. &lt;span class="caps"&gt;SCGI&lt;/span&gt; in combination with the Apache module supports exactly &lt;em&gt;one&lt;/em&gt; instance of the dispatcher. There is &lt;a href="http://article.gmane.org/gmane.comp.lang.ruby.rails/33836"&gt;one obscure and in reality impossible way of changing that&lt;/a&gt; but believe me you don&amp;#8217;t want to do this.&lt;/p&gt;


	&lt;p&gt;For me monitoring seemed easier because &lt;a href="http://wiki.rubyonrails.com/rails/pages/LighttpdWithProcessScripts"&gt;reaper, spawner and spinner&lt;/a&gt; already exist for FastCGI opposed to my self-written Ruby script that tries to do the same for &lt;span class="caps"&gt;SCGI&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;And if that wouldn&amp;#8217;t be enough &lt;span class="caps"&gt;SCGI&lt;/span&gt; also simply delegates every request below a defined path to Rails, which of course sucks if you have static content in your application. You can try to work around that, but once you generate .js or .css files through Rails, you pretty much start hating &lt;span class="caps"&gt;SCGI&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;But uninformed as I was, I just went ahead and let &lt;span class="caps"&gt;SCGI&lt;/span&gt; handle my requests. Till today. Today I made &lt;a href="http://inlet-media.de/the-perfect-ruby-on-rails-with-apache2-and-fastcgi-setup-on-debian-sarge"&gt;Rails use FastCGI&lt;/a&gt;. I didn&amp;#8217;t exactly follow the instructions in that article, instead of compiling anything myself I just let apt and RubyGems do all the hard work:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;sudo apt-get install libfcgi-dev
sudo gem install fcgi&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;For me switching from &lt;span class="caps"&gt;SCGI&lt;/span&gt; to FastCGI brought nothing but relieve: My requests seem to get handled faster (probably because of the multiple instances running concurrently) and I no longer have to breach &lt;span class="caps"&gt;DRY&lt;/span&gt;, as my .htaccess doesn&amp;#8217;t need to exclude non all rails handled requests.&lt;/p&gt;
</description>
      <pubDate>Sat, 07 Jan 2006 21:24:00 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:84013910-a073-4e76-952c-a552613bf4d0</guid>
      <author>MSch</author>
      <link>http://blog.schuerrer.org/articles/2006/01/07/f-still-comes-before-s</link>
      <category>rails</category>
      <category>apache</category>
      <category>fastcgi</category>
      <trackback:ping>http://blog.schuerrer.org/articles/trackback/17</trackback:ping>
    </item>
  </channel>
</rss>
