<?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: Hosting Rails is a bitch</title>
	<atom:link href="http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/feed/" rel="self" type="application/rss+xml" />
	<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/</link>
	<description>「偶然世界」で出逢い</description>
	<lastBuildDate>Sun, 14 Mar 2010 06:38:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Moshiur</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-39867</link>
		<dc:creator>Moshiur</dc:creator>
		<pubDate>Wed, 22 Jul 2009 13:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-39867</guid>
		<description>I have an application with 4 mongrel clusters of which 3 are running behind pound. The clusters stops responding. I have to restart those daily (in some days twice). 
Is there any issue related to the mysql connection breaking? Does it auto reconnect? Sometimes, expensive operations are executed spanning 3/4 hours, but it should keep only one instance busy. Why the other clusters stop responding. I run the expensive request from a separate cluster not used by the POUND.

Even if there&#039;s no expensive request, the clusters eventually stops responding after 1 day.</description>
		<content:encoded><![CDATA[<p>I have an application with 4 mongrel clusters of which 3 are running behind pound. The clusters stops responding. I have to restart those daily (in some days twice).<br />
Is there any issue related to the mysql connection breaking? Does it auto reconnect? Sometimes, expensive operations are executed spanning 3/4 hours, but it should keep only one instance busy. Why the other clusters stop responding. I run the expensive request from a separate cluster not used by the POUND.</p>
<p>Even if there&#8217;s no expensive request, the clusters eventually stops responding after 1 day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sho</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-17324</link>
		<dc:creator>Sho</dc:creator>
		<pubDate>Thu, 04 Oct 2007 23:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-17324</guid>
		<description>JRuby:

http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html

&lt;blockquote&gt;We perform well serving up Rails requests today, but only about 50-70% of Ruby 1.8&#039;s performance.&lt;/blockquote&gt;

Not quite there yet, but maybe something to hope for in the future.</description>
		<content:encoded><![CDATA[<p>JRuby:</p>
<p><a href="http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html" rel="nofollow">http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html</a></p>
<blockquote><p>We perform well serving up Rails requests today, but only about 50-70% of Ruby 1.8&#8217;s performance.</p></blockquote>
<p>Not quite there yet, but maybe something to hope for in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wincent Colaiuta</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-17320</link>
		<dc:creator>Wincent Colaiuta</dc:creator>
		<pubDate>Thu, 04 Oct 2007 21:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-17320</guid>
		<description>I can&#039;t find a truly explicit reference to explain the mod_php vs PHP command-line client difference, but &lt;a href=&quot;http://apache-server.com/tutorials/LPPHP.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; comes close. Check out this and the following paragraphs:

&lt;blockquote&gt;If you want to use embedded PHP code in your Web pages, you need to build it in one of two different ways, depending upon whether you want to load it dynamically or have it built permanently right into the Apache server. The only difference between the interpreter and dyanmic module builds is the configure command; the sequence for building it as a static module is considerably more complex.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>I can&#8217;t find a truly explicit reference to explain the mod_php vs PHP command-line client difference, but <a href="http://apache-server.com/tutorials/LPPHP.html" rel="nofollow">this page</a> comes close. Check out this and the following paragraphs:</p>
<blockquote><p>If you want to use embedded PHP code in your Web pages, you need to build it in one of two different ways, depending upon whether you want to load it dynamically or have it built permanently right into the Apache server. The only difference between the interpreter and dyanmic module builds is the configure command; the sequence for building it as a static module is considerably more complex.</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sho</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-17319</link>
		<dc:creator>Sho</dc:creator>
		<pubDate>Thu, 04 Oct 2007 21:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-17319</guid>
		<description>from http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html

&lt;blockquote&gt;We perform well serving up Rails requests today, but only about 50-70% of Ruby 1.8&#039;s performance.&lt;/blockquote&gt;

Not quite there yet, but maybe something to hope for in the future.</description>
		<content:encoded><![CDATA[<p>from <a href="http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html" rel="nofollow">http://headius.blogspot.com/2007/04/paving-road-to-jruby-10-performance.html</a></p>
<blockquote><p>We perform well serving up Rails requests today, but only about 50-70% of Ruby 1.8&#8217;s performance.</p></blockquote>
<p>Not quite there yet, but maybe something to hope for in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sho</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-17318</link>
		<dc:creator>Sho</dc:creator>
		<pubDate>Thu, 04 Oct 2007 21:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-17318</guid>
		<description>Thanks for the corrections. 

Mongrel: C, eh? Surprised to hear that. I was beginning to think it was written in PPC-native RealBasic, running under emulation of course. Regardless, the name mongrel is ironic, because it really is a fucking dog. I love how it stops responding if idle for more than a couple of hours!

PHP &amp; mod_php: Hm. You&#039;re shaking my preconceptions to the core here! Here&#039;s what I had believed:

I thought that mod_php basically encapsulates instances of PHP, as you say, in Apache memory space. Kind of like little PHP VMs. But I did think that mod_php parsed the page first, as I thought that would be faster, and it is Apache reading the page. The PHP instance would be loaded from /usr/bin - that&#039;s the one with MySQL linked into it, remember. The actual internals of it I have no idea about. Anyway, I&#039;m sure you&#039;re right and I&#039;m wrong - I just kind of assumed that&#039;s how it worked!

The whole of JRuby is the most ridiculous thing I ever heard. If you&#039;re going to be compiling it down, you may as well compile it properly and run it as object code! Why go to another intermediatory language&#039;s bytecode, which then needs to be run in yet another VM? And what does that mean for testing? What about Ruby plugins? Which DB adapter is used? Etc, etc. I have a lot of doubts about that &quot;solution&quot;. And one wonders what the point of using Rails at all will be. If you want to use Java, use Java, you could certainly do a lot worse.

And it&#039;s Ruby 1.9 that will apparently introduce the new VM, with a java-style JIT compiler. However, I have very low expectations that will be released anytime soon. It&#039;s been in development over 2 1/2 years now, and is supposedly due this December .. if so, shouldn&#039;t it be in RC&#039;s by now? But I don&#039;t hear any reports that it&#039;s anything like stable. I am actually kind of worried that Ruby is a bit .. ponderous in its development. 

Even so, testing I&#039;ve seen suggests a speedup of between 30-100% on average. While welcome, it&#039;s nowhere near enough. It needs to be 10 times faster, not 2.

While many people will argue that Rails can be tweaked to perform better, there&#039;s only so far you can go before you&#039;ve &quot;tweaked&quot; away so much of the development niceties that you may as well have not used it in the first place.</description>
		<content:encoded><![CDATA[<p>Thanks for the corrections. </p>
<p>Mongrel: C, eh? Surprised to hear that. I was beginning to think it was written in PPC-native RealBasic, running under emulation of course. Regardless, the name mongrel is ironic, because it really is a fucking dog. I love how it stops responding if idle for more than a couple of hours!</p>
<p>PHP &#038; mod_php: Hm. You&#8217;re shaking my preconceptions to the core here! Here&#8217;s what I had believed:</p>
<p>I thought that mod_php basically encapsulates instances of PHP, as you say, in Apache memory space. Kind of like little PHP VMs. But I did think that mod_php parsed the page first, as I thought that would be faster, and it is Apache reading the page. The PHP instance would be loaded from /usr/bin &#8211; that&#8217;s the one with MySQL linked into it, remember. The actual internals of it I have no idea about. Anyway, I&#8217;m sure you&#8217;re right and I&#8217;m wrong &#8211; I just kind of assumed that&#8217;s how it worked!</p>
<p>The whole of JRuby is the most ridiculous thing I ever heard. If you&#8217;re going to be compiling it down, you may as well compile it properly and run it as object code! Why go to another intermediatory language&#8217;s bytecode, which then needs to be run in yet another VM? And what does that mean for testing? What about Ruby plugins? Which DB adapter is used? Etc, etc. I have a lot of doubts about that &#8220;solution&#8221;. And one wonders what the point of using Rails at all will be. If you want to use Java, use Java, you could certainly do a lot worse.</p>
<p>And it&#8217;s Ruby 1.9 that will apparently introduce the new VM, with a java-style JIT compiler. However, I have very low expectations that will be released anytime soon. It&#8217;s been in development over 2 1/2 years now, and is supposedly due this December .. if so, shouldn&#8217;t it be in RC&#8217;s by now? But I don&#8217;t hear any reports that it&#8217;s anything like stable. I am actually kind of worried that Ruby is a bit .. ponderous in its development. </p>
<p>Even so, testing I&#8217;ve seen suggests a speedup of between 30-100% on average. While welcome, it&#8217;s nowhere near enough. It needs to be 10 times faster, not 2.</p>
<p>While many people will argue that Rails can be tweaked to perform better, there&#8217;s only so far you can go before you&#8217;ve &#8220;tweaked&#8221; away so much of the development niceties that you may as well have not used it in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wincent Colaiuta</title>
		<link>http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/comment-page-1/#comment-17317</link>
		<dc:creator>Wincent Colaiuta</dc:creator>
		<pubDate>Thu, 04 Oct 2007 19:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://fukamachi.org/wp/2007/10/05/hosting-rails-is-a-bitch/#comment-17317</guid>
		<description>While the factual details are a bit off the mark in places, the overall sentiment expressed in your post is spot-on and fully justified in my opinion.

Minor factual points:

- Mongrel may be written in Ruby but the performance-critical parts are written in C, and algorithmically speaking this is lightning-fast C at that (because they are largely an ultra-efficient DFA, or Deterministic Finite Automata, generated by Ragel).

- Your discussion of PHP makes it sound like it&#039;s just a command-line executable (in the same way that Ruby is) and although this is true, almost all use of PHP in the wild is actually done via an Apache module; I am no expert on Apache&#039;s dispatch mechanism but my primitive understand of it is that once loaded the module resides in and shares Apache&#039;s memory space so there&#039;s no expensive fork/exec operation for each request nor is there any complicated or slow Inter-Process Communication.

- You make it sound like Apache parses the requested files looking for PHP code blocks and only calls out to the PHP interpreter on hitting them; my understanding is that when it sees the file extension on the request it just passes the whole darn thing on to PHP and Apache doesn&#039;t do any parsing at all (the PHP interpreter then interpolates the PHP output with the non-PHP parts of the source).

As for the finer details of Apache&#039;s dispatch mechanism for Rails and PHP, can&#039;t really comment. But by and large I agree with everything you said.

There seems to be a lot of hope that JRuby will be a solution, but anything which involves compiled down to Java bytecode doesn&#039;t seem much of a solution to me, given that Java has its own deployment nightmares as well.

Ruby 2.0 looks promising, but we&#039;re still only talking about a modest speedup, and Ruby is only one of the links in the chain. I really don&#039;t know what the answer is.</description>
		<content:encoded><![CDATA[<p>While the factual details are a bit off the mark in places, the overall sentiment expressed in your post is spot-on and fully justified in my opinion.</p>
<p>Minor factual points:</p>
<p>- Mongrel may be written in Ruby but the performance-critical parts are written in C, and algorithmically speaking this is lightning-fast C at that (because they are largely an ultra-efficient DFA, or Deterministic Finite Automata, generated by Ragel).</p>
<p>- Your discussion of PHP makes it sound like it&#8217;s just a command-line executable (in the same way that Ruby is) and although this is true, almost all use of PHP in the wild is actually done via an Apache module; I am no expert on Apache&#8217;s dispatch mechanism but my primitive understand of it is that once loaded the module resides in and shares Apache&#8217;s memory space so there&#8217;s no expensive fork/exec operation for each request nor is there any complicated or slow Inter-Process Communication.</p>
<p>- You make it sound like Apache parses the requested files looking for PHP code blocks and only calls out to the PHP interpreter on hitting them; my understanding is that when it sees the file extension on the request it just passes the whole darn thing on to PHP and Apache doesn&#8217;t do any parsing at all (the PHP interpreter then interpolates the PHP output with the non-PHP parts of the source).</p>
<p>As for the finer details of Apache&#8217;s dispatch mechanism for Rails and PHP, can&#8217;t really comment. But by and large I agree with everything you said.</p>
<p>There seems to be a lot of hope that JRuby will be a solution, but anything which involves compiled down to Java bytecode doesn&#8217;t seem much of a solution to me, given that Java has its own deployment nightmares as well.</p>
<p>Ruby 2.0 looks promising, but we&#8217;re still only talking about a modest speedup, and Ruby is only one of the links in the chain. I really don&#8217;t know what the answer is.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
