<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Enjoying Rails</title>
	<atom:link href="http://blog.erichsen.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.erichsen.net</link>
	<description>I really do...</description>
	<pubDate>Fri, 05 Dec 2008 21:56:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/341b476daf96d74224be7d0677b91401?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Enjoying Rails</title>
		<link>http://blog.erichsen.net</link>
	</image>
			<item>
		<title>How REE and GC tuning reduced spec suite runtime to one third</title>
		<link>http://blog.erichsen.net/2008/12/05/how-ree-and-gc-tuning-reduced-spec-suite-runtime-to-one-third/</link>
		<comments>http://blog.erichsen.net/2008/12/05/how-ree-and-gc-tuning-reduced-spec-suite-runtime-to-one-third/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 21:50:29 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/?p=23</guid>
		<description><![CDATA[Or how my spec suite runtime went from 11 minutes and 10 seconds to 3 minutes and 29 seconds!
The Rails project I am currently working on is developed using BDD. This means that is has a big, fat spec suite. Or to be more specific it has 10033 examples!
This is very nice except for one [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>Or how my spec suite runtime went from 11 minutes and 10 seconds to 3 minutes and 29 seconds!</em></p>
<p>The Rails project I am currently working on is developed using BDD. This means that is has a big, fat spec suite. Or to be more specific it has 10033 examples!</p>
<p>This is very nice except for one thing: It is slooow  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>On my shiny (literally) new 2.4 GHz MacBook Pro the spec suite has a runtime of 670 seconds ie. 11 minutes and 10 seconds - yikes! This is with the ruby interpreter shipped with Mac OS X Leopard.</p>
<p>I have noticed running top that it seems to be mostly CPU bound. The ruby process hovers at around 95-100% CPU usage.</p>
<p><strong>Ruby Enterprise Edition to the rescue!</strong></p>
<p>Previously, I have tried to run the spec suite with the 1.8.6-20080810 version of REE and it did not change the runtime significantly.</p>
<p>The new 1.8.6-20081205 version has some interesting <a href="http://blog.phusion.nl/2008/12/05/ruby-enterprise-edition-186-20081205-released-thank-you-sponsors/">changes</a>. First of all, the tcmalloc memory allocator now works with Mac OS X. And second of all, it has integration with the <a href="http://railsbench.rubyforge.org/svn/trunk/railsbench/GCPATCH">RailsBench</a> garbage collector patches which allows for tweaking the GC settings of the ruby interpreter.</p>
<p>So what does mean in &#8220;real life&#8221;?</p>
<p>I downloaded and installed the new version of REE and ran the spec suite. The runtime with the new REE version was 436 seconds ie. 7 minutes and 16 seconds, chopping of nearly 4 minutes - VERY nice!</p>
<p><strong>RailsBench GC patches to the rescue!</strong></p>
<p>I decided to experiment a little with the GC settings ie.</p>
<p>export RUBY_GC_MALLOC_LIMIT=64000000</p>
<p>and reran the spec suite. The result: 221 seconds ie. 3 minutes and 41 seconds. Tried RUBY_GC_MALLOC_LIMIT=256000000 and the result: 209 seconds ie. 3 minutes and 29 seconds - holy Batman!</p>
<p><strong>Thank you guys!</strong></p>
<p>I suggest you go to <a href="http://www.workingwithrails.com/">workingwithrails.com</a> and recommend <a href="http://www.workingwithrails.com/person/11402-hongli-lai">Hongli Lai</a>, <a href="http://www.workingwithrails.com/person/12429-ninh-bui">Ninh Bui</a> and <a href="http://www.workingwithrails.com/person/6655-stefan-kaes">Stefan Kaes</a> like I just did - they deserve it.</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=23&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2008/12/05/how-ree-and-gc-tuning-reduced-spec-suite-runtime-to-one-third/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic Rails on Ubuntu 8.04 LTS</title>
		<link>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/</link>
		<comments>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:32:11 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[deployment]]></category>

		<category><![CDATA[passenger]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://enjoyingrails.wordpress.com/?p=17</guid>
		<description><![CDATA[A couple of weeks ago there was a post on the FiveRuns blog about automatically installing the Rails stack on an Ubuntu 8.04 VPS.
I prefer to use Passenger and Ruby Enterprise Edition when running my Rails app, so inspired by the FiveRuns script I wrote my own version - here is the gist on github.

#!/bin/bash
# [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A couple of weeks ago there was a <a href="http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost">post</a> on the FiveRuns blog about automatically installing the Rails stack on an Ubuntu 8.04 VPS.</p>
<p>I prefer to use Passenger and Ruby Enterprise Edition when running my Rails app, so inspired by the FiveRuns script I wrote my own version - here is the <a href="http://gist.github.com/16225">gist on github</a>.</p>
<p><code><br />
#!/bin/bash<br />
# Inspired by http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost</p>
<p>apt-get update<br />
apt-get upgrade -y<br />
apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev<br />
apt-get -y install mysql-server libmysqlclient15-dev mysql-client<br />
apt-get -y install ruby ruby1.8-dev irb ri rdoc libopenssl-ruby1.8 </p>
<p>RUBYGEMS=&#8221;rubygems-1.3.0&#8243;<br />
wget http://rubyforge.org/frs/download.php/43985/$RUBYGEMS.tgz<br />
tar xzf $RUBYGEMS.tgz<br />
cd $RUBYGEMS<br />
ruby setup.rb<br />
cd ..</p>
<p># Install Ruby Enterprise Edition<br />
wget http://rubyforge.org/frs/download.php/41040/ruby-enterprise-1.8.6-20080810.tar.gz<br />
tar xvzf ruby-enterprise-1.8.6-20080810.tar.gz<br />
yes &#8221; | ./ruby-enterprise-1.8.6-20080810/installer</p>
<p># Install Passenger<br />
/usr/bin/gem1.8 install -v=2.0.3 passenger &#8211;no-rdoc &#8211;no-ri<br />
apt-get -y install apache2-mpm-prefork apache2-prefork-dev<br />
yes &#8221; | passenger-install-apache2-module </p>
<p># Create sample Rails app<br />
/usr/bin/gem1.8 install rails &#8211;no-rdoc &#8211;no-ri<br />
cd /var/www<br />
rails -d mysql hello<br />
cd hello<br />
./script/generate controller welcome hello<br />
echo &#8220;Hello World&#8221; &gt; app/views/welcome/hello.html.erb<br />
rake db:create RAILS_ENV=production</p>
<p># Create the Apache2 Passenger module files<br />
cat &gt;&gt; /etc/apache2/mods-available/passenger.load &lt;&gt; /etc/apache2/mods-available/passenger.conf &lt;&lt;-EOF</p>
<p>  PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3<br />
  PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby</p>
<p>EOF<br />
a2enmod passenger</p>
<p># Create a site file for the sample Rails app<br />
IP_ADDRESS=`ifconfig eth0 | sed -n &#8217;s/.*dr:\(.*\)  Bc.*/\1/p&#8217;`<br />
cat &gt;&gt; /etc/apache2/sites-available/hello &lt;&lt;-EOF</p>
<p>      ServerName www.yourhost.com<br />
      DocumentRoot /var/www/hello/public</p>
<p>EOF<br />
a2ensite hello</p>
<p># That&#8217;s it!<br />
reboot<br />
</code></p>
<p>The script assumes that you have ssh access as root to a clean Ubuntu 8.04 install.</p>
<p>The script will install</p>
<ul>
<li>Ruby 1.8.6</li>
<li>RubyGems 1.3.0</li>
<li>Passenger 2.0.3</li>
<li>Ruby Enterprise Edition 20080810</li>
<li>Apache 2.2.8</li>
<li>MySQL 5.0.51a</li>
<li>A sample Rails app</li>
</ul>
<p>Note that the Passenger installer will install the latest Rails (2.1.1) and a bunch of other useful gems.</p>
<p>Assuming that your server IP address is 192.168.185.128 you can run it like this:<br />
<code><br />
ssh root@192.168.185.128 &#8220;wget -O - http://gist.github.com/raw/16225/a6a16b3a38cd3486679b96fa0f3446e58f3b8423 | sed -e s/$&#8217;\r&#8217;//g &gt; install.sh; /bin/bash install.sh; rm install.sh&#8221;<br />
</code><br />
Sit back and enjoy - in less than ten minutes you will have the full Rails stack and a sample Rails app running. Take a look at it on <a href="http://192.168.185.128/welcome/hello">http://192.168.185.128/welcome/hello</a></p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=17&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby Fools presentation slides</title>
		<link>http://blog.erichsen.net/2008/04/02/ruby-fools-presentation-slides/</link>
		<comments>http://blog.erichsen.net/2008/04/02/ruby-fools-presentation-slides/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 16:27:57 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[rails solr acts_as_solr]]></category>

		<guid isPermaLink="false">http://enjoyingrails.wordpress.com/?p=16</guid>
		<description><![CDATA[Today I gave a presentation at the Ruby Fools Copenhagen 2008 Conference.
The presentation was about adding full text search to a Rails app.
Here is a pdf with my presentation:
Adding Full Text Search to Your Rails App
The conference was arranged by the same crew doing the JAOO conference and most (all?) presentations were recorded on video. When [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I gave a presentation at the Ruby Fools Copenhagen 2008 Conference.</p>
<p>The presentation was about adding full text search to a Rails app.</p>
<p>Here is a pdf with my presentation:</p>
<p><a href="http://enjoyingrails.files.wordpress.com/2008/04/adding-full-text-search-to-your-rails-app.pdf" title="Adding Full Text Search to Your Rails App">Adding Full Text Search to Your Rails App</a></p>
<p>The conference was arranged by the same crew doing the JAOO conference and most (all?) presentations were recorded on video. When the videos are available online I will post a link.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=16&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2008/04/02/ruby-fools-presentation-slides/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>Benchmarking fun with JRuby 1.1 RC2, glassfish, and Rails 2.0.2</title>
		<link>http://blog.erichsen.net/2008/02/17/benchmarking-fun-with-jruby-11-rc2-glassfish-and-rails-202/</link>
		<comments>http://blog.erichsen.net/2008/02/17/benchmarking-fun-with-jruby-11-rc2-glassfish-and-rails-202/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 14:19:35 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[jruby glassfish rails benchmarks]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2008/02/17/benchmarking-fun-with-jruby-11-rc2-glassfish-and-rails-202/</guid>
		<description><![CDATA[Yesterday JRuby 1.1 RC2 was released and two days ago the glassfish gem v 0.1.1 was released. Lots of interesting stuff happening in JRuby land!
I decided to take JRuby and the glassfish gem for a spin with a simple Rails application.
Installing JRuby
First step was to download and install JRuby. This is pretty straightforward:
cd /tmp
wget http://dist.codehaus.org/jruby/jruby-src-1.1RC2.tar.gz
tar [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yesterday <a href="http://www.bloglines.com/blog/ThomasEEnebo?id=42">JRuby 1.1 RC2</a> was released and two days ago the <a href="http://weblogs.java.net/blog/arungupta/archive/2008/02/glassfish_v3_ge_1.html">glassfish gem v 0.1.1</a> was released. Lots of interesting stuff happening in JRuby land!</p>
<p>I decided to take JRuby and the glassfish gem for a spin with a simple Rails application.<br />
<b>Installing JRuby</b></p>
<p>First step was to download and install JRuby. This is pretty straightforward:<br />
<code>cd /tmp<br />
wget http://dist.codehaus.org/jruby/jruby-src-1.1RC2.tar.gz<br />
tar xvzf jruby-src-1.1RC2.tar.gz<br />
cd jruby-1.1RC2/<br />
ant<br />
export JRUBY_HOME=`pwd`<br />
export PATH=$JRUBY_HOME/bin:$PATH<br />
jruby &#8211;version<br />
ruby 1.8.6 (2008-02-17 rev 5944) [i386-jruby1.1RC2]</code><br />
Yep, seems to work.</p>
<p><b>Installing gems</b></p>
<p>Next step was to install the Rails and glassfish gems:<br />
<code>unset GEM_HOME<br />
unset GEM_PATH<br />
gem install rails<br />
gem install glassfish</code></p>
<p><b>Creating a Rails application</b></p>
<p>On to the Rails application&#8230; I used scaffold to have a simple application up and running quickly:<br />
<code>cd ..<br />
rails glassfishtest &#8211;database=mysql<br />
cd glassfishtest/<br />
export RAILS_ENV=production<br />
rake db:sessions:create<br />
script/generate scaffold Book title:string<br />
rake db:create<br />
rake db:migrate<br />
script/runner &#8220;Book.create(:title =&gt; &#8216;JRuby Rocks&#8217;)&#8221;</code></p>
<p>I use the database session store, so I added this line to the <code>config/environment.rb</code> file<br />
<code>config.action_controller.session_store = :active_record_store</code></p>
<p><b>Firing up glassfish</b></p>
<p>Let&#8217;s fire up the glassfish server:<br />
<code>cd ..<br />
glassfish_rails glassfishtest -n 2</code><br />
The <code>-n 2</code> option will make glassfish start 2 Rails instances.</p>
<p><b>Benchmark fun!</b></p>
<p><i><b></b>Glassfish</i><br />
I used the <code>ab</code> command to perform some simple benchmarks.<br />
Each <code>ab</code> command was run twice with a freshly started glassfish server. The first run warms up the JIT in the JVM. The results listed below are for the second run (and the fifth run for some). All benchmarks were performed on my 2.33GHz MacBook Pro running Leopard 10.5.2 with Java version 1.5.0_13-b05-237.</p>
<p>The performance with respect to static files is impressive:<br />
<code>ab -n 5000 -c 10 http://localhost:3000/<br />
Requests per second:    2705.63 [#/sec] (mean)</code></p>
<p>Now onto a page created by Rails:<br />
<code>ab -n 1000 -c 8 http://localhost:3000/books/1<br />
Requests per second:    54.10 [#/sec] (mean)</code></p>
<p>JRuby can be tweaked a little bit with the <code>-server</code> parameter:<br />
<code>JAVA_OPTS="-server" glassfish_rails glassfishtest -n 2<br />
ab -n 1000 -c 8 http://localhost:3000/books/1<br />
Requests per second:    53.82 [#/sec] (mean) 2nd run<br />
Requests per second:    63.06 [#/sec] (mean) 5th run<br />
</code><br />
After a little warmup the performance is approximately 20% better than without the <code>-server</code> option.</p>
<p>Let&#8217;s try adding more Rails instances:<br />
<code>JAVA_OPTS="-server" glassfish_rails glassfishtest -n 4<br />
Requests per second:    50.71 [#/sec] (mean) 2nd run<br />
Requests per second:    60.69 [#/sec] (mean) 5th run</code><br />
On my dual core machine this actually degrades performance a little bit. I guess it is a good idea to have the number of Rails instances match the number of cores in your server.</p>
<p>But what about one Rails instance:<br />
<code>JAVA_OPTS="-server" glassfish_rails glassfishtest -n 1<br />
Requests per second:    31.56 [#/sec] (mean) 2nd run<br />
Requests per second:    34.48 [#/sec] (mean) 5th run</code><br />
That hurts!</p>
<p><i>Mongrel</i></p>
<p>How does mongrel compare to glassfish?<br />
Single Mongrel - JRuby<br />
<code>JAVA_OPTS='-server' jruby script/server -e production<br />
Requests per second:    54.99 [#/sec] (mean) 2nd run<br />
Requests per second:    63.20 [#/sec] (mean) 5th run</code></p>
<p>Two Mongrels behind pen - JRuby<br />
<code>Requests per second:    58.39 [#/sec] 2nd run(mean)<br />
Requests per second:    69.16 [#/sec] (mean) 10th run</code></p>
<p>Static files:<br />
<code>Requests per second:    313.57 [#/sec] (mean)</code></p>
<p>Mongrel and the glassfish server have comparable performance with respect to Rails generated pages.<br />
With respect to serving static files, glassfish outperforms Mongrel significantly. That said, you shouldn&#8217;t really let Mongrel serve static content - it is better to leave that to nginx or Apache.</p>
<p><i>Mongrel - MRI</i></p>
<p>What is the performance when using MRI?<br />
Single Mongrel - MRI<br />
<code>Requests per second:    120.79 [#/sec] (mean)</code></p>
<p>Two Mongrels behind pen - MRI<br />
<code>Requests per second:    123.42 [#/sec] (mean)</code></p>
<p>The MRI Mongrel seems to have a lot better performance for this (admittedly simple) benchmark.</p>
<p><b>Conclusion</b></p>
<p>With respect to ease of running a server the JRuby/glassfish combo is very appealing:</p>
<ul>
<li>static files are served very fast</li>
<li>no need for a separate load balancer</li>
<li>the whole thing is started with just one command</li>
</ul>
<p>For this particular Rails application benchmark, the performance of the JRuby stack is only half of the performance of MRI, which is kind of sad. I am pretty sure that this is not the case for all Rails applications. In fact, evidence from Mingle seems to indicate that JRuby is faster than MRI. So I guess the best thing is to try it out on your own Rails app - and please blog about your findings. If you decide to benchmark your own Rails app I highly recommend <a href="http://peepcode.com/products/benchmarking-with-httperf">this peepcode screencast</a> about benchmarking.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=8&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2008/02/17/benchmarking-fun-with-jruby-11-rc2-glassfish-and-rails-202/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>My first Rails Contribution</title>
		<link>http://blog.erichsen.net/2007/12/28/my-first-rails-contribution/</link>
		<comments>http://blog.erichsen.net/2007/12/28/my-first-rails-contribution/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 19:00:30 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/12/28/my-first-rails-contribution/</guid>
		<description><![CDATA[Yeah! I am a Rails contributor!
In an application at work we are using a Rails REST application for the backend of the application and another Rails application as the frontend. The frontend application does not use the database at all but only the REST api provided by the backend application.
When sending lots of data between [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yeah! I am a Rails contributor!</p>
<p>In an application at work we are using a Rails REST application for the backend of the application and another Rails application as the frontend. The frontend application does not use the database at all but only the REST api provided by the backend application.</p>
<p>When sending lots of data between the two applications serializing to and from XML turned out to be a performance bottleneck. We turned to JSON and this improved performance significantly.</p>
<p>The JSON support in ActiveResource was added recently and there are still some areas where XML is better supported than JSON. So I submitted a <a href="http://dev.rubyonrails.org/ticket/10635" title="patch">patch</a> to improve the JSON support. The patch got submitted to trunk in this <a href="http://dev.rubyonrails.org/changeset/8502" title="changeset">changeset.</a></p>
<p>It feels really good to contribute back to Rails when Rails have brought me so many hours of joy  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=13&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/12/28/my-first-rails-contribution/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>Experimenting with Amazon S3 EU edition</title>
		<link>http://blog.erichsen.net/2007/11/06/experimenting-with-amazon-s3-eu-edition/</link>
		<comments>http://blog.erichsen.net/2007/11/06/experimenting-with-amazon-s3-eu-edition/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 21:42:03 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[amazon s3]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/11/06/experimenting-with-amazon-s3-eu-edition/</guid>
		<description><![CDATA[Today Amazon announced the availability of S3 in Europe.
Nice! Let&#8217;s play with it! Please notice that I am located in Denmark and that all tests were performed on my 2048/512 ADSL line.
Download the new version of Amazon S3 Authentication Tool for Curl
Unzip it and create an .s3curl file containing you AWS keys as described in [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today Amazon <a href="http://www.amazon.com/gp/redirect.html/ref=sc_fe_c_1_3435361_2/105-2989377-2334055?location=http://home.businesswire.com/portal/site/home/index.jsp%3fepi%252dcontent%3dNEWS%255fVIEW%255fPOPUP%255fTYPE%26newsId%3d20071106005061%26ndmHsc%3dv2%252aA1191754800000%252aB1194367060000%252aDgroupByDate%252aJ2%252aL1%252aN1000837%252aZamazons3%26newsLang%3den%26beanID%3d202776713%26viewID%3dnews%255fview%255fpopup&amp;token=01A6648B21DB9658C38BD04EDB5118949867F041">announced</a> the availability of S3 in Europe.</p>
<p>Nice! Let&#8217;s play with it! Please notice that I am located in Denmark and that all tests were performed on my 2048/512 ADSL line.</p>
<p>Download the new version of <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=128&amp;categoryID=47">Amazon S3 Authentication Tool for Curl</a></p>
<p>Unzip it and create an .s3curl file containing you AWS keys as described in the readme file.</p>
<p>Now let&#8217;s create some buckets - a US bucket and an EU bucket:<br />
<code><br />
s3curl.pl &#8211;id personal &#8211;createBucket &#8212;  http://s3.amazonaws.com/erichsen.net.us<br />
s3curl.pl &#8211;id personal &#8211;createBucket=EU &#8212;  http://s3.amazonaws.com/erichsen.net.eu<br />
</code></p>
<p>Fetch some test files a 50K file and a 10MB one:<br />
<code><br />
wget ftp://ftptest1.tele.dk/pub/50Ktest.rnd<br />
wget ftp://ftptest1.tele.dk/pub/10Mtestb.rnd<br />
</code></p>
<p>And upload them:<br />
<code><br />
s3curl.pl &#8211;id=personal &#8211;acl public-read &#8211;put 10Mtestb.rnd &#8212; http://erichsen.net.us.s3.amazonaws.com/10Mtestb.rnd<br />
s3curl.pl &#8211;id=personal &#8211;acl public-read &#8211;put  50Ktest.rnd &#8212; http://erichsen.net.us.s3.amazonaws.com/50Ktest.rnd<br />
s3curl.pl &#8211;id=personal &#8211;acl public-read &#8211;put 10Mtestb.rnd &#8212; http://erichsen.net.eu.s3.amazonaws.com/10Mtestb.rnd<br />
s3curl.pl &#8211;id=personal &#8211;acl public-read &#8211;put  50Ktest.rnd &#8212; http://erichsen.net.eu.s3.amazonaws.com/50Ktest.rnd<br />
</code></p>
<p>Try fetching the large file from the US bucket a couple of times<br />
<code><br />
ab -n 1 http://erichsen.net.us.s3.amazonaws.com/10Mtestb.rnd<br />
&#8230;<br />
Time taken for tests:   50.325 seconds<br />
&#8230;<br />
Transfer rate:          208.37 [Kbytes/sec] received</code></p>
<p>ab -n 1 http://erichsen.net.us.s3.amazonaws.com/10Mtestb.rnd<br />
&#8230;<br />
Time taken for tests:   48.351 seconds<br />
&#8230;<br />
Transfer rate:          216.87 [Kbytes/sec] received<br />
And the EU bucket<br />
<code><br />
ab -n 1 http://erichsen.net.eu.s3.amazonaws.com/10Mtestb.rnd<br />
&#8230;<br />
Time taken for tests:   47.907 seconds<br />
&#8230;<br />
Transfer rate:          218.88 [Kbytes/sec] received</code></p>
<p>ab -n 1 http://erichsen.net.eu.s3.amazonaws.com/10Mtestb.rnd<br />
&#8230;<br />
Time taken for tests:   50.943 seconds<br />
&#8230;<br />
Transfer rate:          205.84 [Kbytes/sec] received<br />
With respect to transfer rate they seem to perform about the same from my local machine&#8217;s point of view. But I guess that this is what is to expect. The EU bucket should give better response times and for large files the response times are only a small fraction of the total transfer time.</p>
<p>But what about the small file?</p>
<p>US bucket<br />
<code><br />
ab -n 50 http://erichsen.net.us.s3.amazonaws.com/50Ktest.rnd<br />
&#8230;<br />
Time taken for tests:   60.308 seconds<br />
&#8230;<br />
Time per request:       1206.16 [ms] (mean)<br />
&#8230;<br />
</code></p>
<p>EU bucket<br />
<code><br />
ab -n 50 http://erichsen.net.eu.s3.amazonaws.com/50Ktest.rnd<br />
&#8230;<br />
Time taken for tests:   26.676 seconds<br />
&#8230;<br />
Time per request:       533.52 [ms] (mean)<br />
</code></p>
<p>Now we&#8217;re talking!</p>
<p>Summary: For large files you could just as well use the US variant of S3. If you use S3 for serving the static files of your web site and most of your visitors come from Europe switching to the EU S3 should give your users significantly better load times.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=12&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/11/06/experimenting-with-amazon-s3-eu-edition/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating an Amazon EC2 Ubuntu 6.06 LTS server edition image</title>
		<link>http://blog.erichsen.net/2007/11/04/creating-an-amazon-ec2-ubuntu-606-lts-server-edition-image/</link>
		<comments>http://blog.erichsen.net/2007/11/04/creating-an-amazon-ec2-ubuntu-606-lts-server-edition-image/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 16:04:39 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Amazon EC2]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/11/04/creating-an-amazon-ec2-ubuntu-606-lts-server-edition-image/</guid>
		<description><![CDATA[Last week I decided to try out Amazon EC2 mainly for running and testing Rails applications and so far it has been great fun!
This blog posting describes how I created an Ubuntu 6.06 LTS server edition image for use with Amazon EC2.
Download and install the EC2 command line tools

curl -O http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
mkdir ~/.ec2
cd ~/.ec2
unzip ec2-api-tools.zip
ln -s [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last week I decided to try out Amazon EC2 mainly for running and testing Rails applications and so far it has been great fun!</p>
<p>This blog posting describes how I created an Ubuntu 6.06 LTS server edition image for use with Amazon EC2.</p>
<p>Download and install the EC2 command line tools<br />
<code><br />
curl -O http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip<br />
mkdir ~/.ec2<br />
cd ~/.ec2<br />
unzip ec2-api-tools.zip<br />
ln -s ec2-api-tools-1.2-13740 ec2-api-tools</code></p>
<p>Set the environment variables necessary to run the tools<br />
<code><br />
export EC2_HOME=~/.ec2/ec2-api-tools<br />
export PATH=$PATH:$EC2_HOME/bin<br />
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/<br />
</code><br />
Download your private key and certificate from your Amazon Web Services account to the ~/.ec2 folder.</p>
<p>Generate a key pair<br />
<code><br />
export EC2_PRIVATE_KEY=~/.ec2/pk-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem<br />
export EC2_CERT=~/.ec2/cert-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem<br />
mkdir ~/.ec2<br />
ec2-add-keypair gsg-keypair &gt; ~/.ec2/id_rsa-gsg-keypair<br />
chmod 600 ~..ec2/id_rsa-gsg-keypair<br />
</code></p>
<p>Launch a <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=517&amp;categoryID=101">Fedora Core 4: Base</a> instance.<br />
<code><br />
ec2-run-instances ami-20b65349 -k gsg-keypair<br />
</code><br />
This returns an instance number like i-9536dcfc.</p>
<p>Try running<br />
<code><br />
ec2-describe-instances i-9536dcfc<br />
</code><br />
until the status returned is no longer &#8216;pending&#8217; but &#8216;running&#8217;.</p>
<p>Allow ssh access and log in<br />
<code><br />
ec2-authorize default -p 22<br />
ssh -i ~/.ec2/id_rsa-gsg-keypair root@ec2-67-202-21-218.compute-1.amazonaws.com<br />
</code></p>
<p>On the EC2 instance run<br />
<code><br />
wget http://erichsen.net/blog/fc4-base<br />
chmod 755 fc4-base<br />
./fc4-base<br />
</code><br />
fc4-base is a script found in this forum <a href="http://developer.amazonwebservices.com/connect/thread.jspa?messageID=48741">posting</a>. I adapted it to create an Ubuntu 6.06 image instead of 6.10.</p>
<p>After the script has finished execution copy the private key and certificate from the local machine to the EC2 instance<br />
<code><br />
scp -i ~/.ec2/id_rsa-gsg-keypair ~/.ec2/pk-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem root@ec2-67-202-21-218.compute-1.amazonaws.com:/root/<br />
scp -i ~/.ec2/id_rsa-gsg-keypair ~/.ec2/cert-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem  root@ec2-67-202-21-218.compute-1.amazonaws.com:/root/<br />
</code></p>
<p>Create an image and sign it with the private key<br />
<code><br />
ec2-bundle-image -i /mnt/ubuntu606base.img -k /root/pk-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem -c cert-8WU9XGOPO65IKA7O96M2KEKVOS5288KU.pem -u &#8216;5171-9220-6573&#8242;<br />
</code></p>
<p>The image must be stored on S3 so I create a bucket (from my local Mac)<br />
<code><br />
sudo gem i aws-s3 -y<br />
export AMAZON_ACCESS_KEY_ID=&#8221;1IQ8AHOAWNRDMQOI91ZK&#8221;<br />
export AMAZON_SECRET_ACCESS_KEY=&#8221;VCddmbA9C4D8w/mw6aLZjzCkMoEyx5EUvouJdY/4&#8243;<br />
s3sh<br />
Bucket.create(&#8217;erichsen.net&#8217;)</code></p>
<p>On the EC2 instance I upload the image<br />
<code><br />
ec2-upload-bundle -b erichsen.net -m /tmp/ubuntu606base.img.manifest.xml -a &#8216;1IQ8AHOAWNRDMQOI91ZK&#8217; -s &#8216;VCddmbA9C4D8w/mw6aLZjzCkMoEyx5EUvouJdY/4&#8242;<br />
</code></p>
<p>From my local Mac I register the instance and that&#8217;s it!<br />
<code><br />
ec2-register erichsen.net/ubuntu606base.img.manifest.xml<br />
</code></p>
<p>The ec2-register returns an AMI id - in this case ami-4acd2823. Let&#8217;s try it out<br />
<code><br />
ec2-run-instances ami-4acd2823 -k gsg-keypair<br />
ec2-describe-instances i-9536dcfc<br />
ssh -i ~/.ec2/id_rsa-gsg-keypair root@ec2-67-202-24-151.compute-1.amazonaws.com<br />
</code></p>
<p>YES! I was able to ssh into an EC2 instance running my Ubuntu 6.06 image! Note that the ssh configuration of the image is not the best - it allows root logins which is not in general a good idea.</p>
<p>Hope this helps someone else wanting to play with Ubuntu on EC2.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=11&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/11/04/creating-an-amazon-ec2-ubuntu-606-lts-server-edition-image/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>My favourite Rails stack</title>
		<link>http://blog.erichsen.net/2007/10/31/my-favourite-rails-stack/</link>
		<comments>http://blog.erichsen.net/2007/10/31/my-favourite-rails-stack/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 14:05:55 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[Mongrel]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/10/31/my-favourite-rails-stack/</guid>
		<description><![CDATA[Operating System
Boy, things have come a long way since I first installed SLS Linux on my pc using floppy discs back in 1994  
These days I prefer Ubuntu 6.06 LTS server edition. It is supported until 2011 - nice that you don&#8217;t have to reinstall the server in a year or two. Furthermore, deprec [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3>Operating System</h3>
<p>Boy, things have come a long way since I first installed SLS Linux on my pc using floppy discs back in 1994  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
These days I prefer <a href="http://www.ubuntu.com/">Ubuntu 6.06 LTS server edition</a>. It is supported until 2011 - nice that you don&#8217;t have to reinstall the server in a year or two. Furthermore, <a href="http://www.deprec.org/">deprec</a> makes it extremely simple to setup a Rails stack on an Ubuntu server.</p>
<h3>Webserver</h3>
<p><a href="http://nginx.net/">nginx</a>. Nginx is fast, stable, lightweight and has easy configuration.</p>
<h3>Load balancer</h3>
<p>Usuyally I use the one built in to nginx.<br />
Alternatives: <a href="http://siag.nu/pen/">Pen</a> or <a href="http://haproxy.1wt.eu">HAProxy</a>.</p>
<h3>Rails-server</h3>
<p>Well, <a href="http://siag.nu/pen/">Mongrel</a> of course. In a cluster handled by <a href="http://mongrel.rubyforge.org/docs/mongrel_cluster.html">Mongrel cluster</a>.</p>
<h3>Database</h3>
<p>MySQL. It&#8217;s the database used by most Rails applications. Furthermore, it has some nice scaling support with master-slave setups. A couple of years ago I used and liked PostgreSQL a lot. I still prefer PostgreSQL&#8217;s query analyzer to MySQL&#8217;s.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=9&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/10/31/my-favourite-rails-stack/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>My Rails presentations</title>
		<link>http://blog.erichsen.net/2007/10/27/my-rails-presentations/</link>
		<comments>http://blog.erichsen.net/2007/10/27/my-rails-presentations/#comments</comments>
		<pubDate>Sat, 27 Oct 2007 17:59:53 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/10/27/my-rails-presentations/</guid>
		<description><![CDATA[A list of the presentations I have given in aarhus.rb (my local Ruby Brigade which I co-founded).

HappyHour (internal time tracking app, RSpec, YSlow)  
Installation and Deployment of a Rails App (deprec, Capistrano)
Hobo (notes in Danish)  
JRuby (notes in Danish)  
Rails Graph Plugins (Ziya and Gruff)  
Rails Deployment (notes in Danish)  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A list of the presentations I have given in <a href="http://www.aarhusrb.dk/">aarhus.rb</a> (my local Ruby Brigade which I co-founded).</p>
<ul>
<li><a href="http://www.aarhusrb.dk/2007/7/4/mde-hos-lenio-d-6-august-2007-kl-16-18">HappyHour</a> (internal time tracking app, RSpec, YSlow)  </li>
<li><a href="http://www.aarhusrb.dk/2007/5/7/m%C3%B8de-hos-lenio-d-4-juni-2007-kl-16-18">Installation and Deployment of a Rails App</a> (deprec, Capistrano)</li>
<li><a href="http://www.aarhusrb.dk/2007/5/7/m%C3%B8de-hos-trifork-mandag-den-7-maj-2007-kl-16-18">Hobo</a> (notes in Danish)  </li>
<li><a href="http://www.aarhusrb.dk/2007/4/16/mde-hos-lenio-16-april-2007-kl-16-18">JRuby</a> (notes in Danish)  </li>
<li><a href="http://www.aarhusrb.dk/2007/3/5/mde-hos-trifork-5-marts-2007-kl-16-18">Rails Graph Plugins</a> (Ziya and Gruff)  </li>
<li><a href="http://www.aarhusrb.dk/2007/1/8/mde-hos-lenio-8-januar-2007-kl-16-18">Rails Deployment</a> (notes in Danish)  </li>
<li><a href="http://www.aarhusrb.dk/2006/11/13/mde-hos-mjlner-13-november-2006-kl-16-18">Dr Nic’s Magic Models</a>  </li>
<li><a href="http://www.aarhusrb.dk/2006/10/9/mde-hos-mjlner-9-oktober-2006-kl-16-18">Impressions from RailsConf Europe 2006</a>  </li>
<li><a href="http://www.aarhusrb.dk/2006/9/4/mde-hos-lenio-4-september-2006-kl-16-18">Rails Testing</a></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=10&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/10/27/my-rails-presentations/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
		<item>
		<title>tv2.dk traffic costs</title>
		<link>http://blog.erichsen.net/2007/10/27/tv2dk-traffic-costs/</link>
		<comments>http://blog.erichsen.net/2007/10/27/tv2dk-traffic-costs/#comments</comments>
		<pubDate>Sat, 27 Oct 2007 13:50:14 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
		
		<category><![CDATA[rails]]></category>

		<category><![CDATA[scaling]]></category>

		<category><![CDATA[Amazon E2]]></category>

		<category><![CDATA[amazon s3]]></category>

		<guid isPermaLink="false">http://blog.erichsen.net/2007/10/27/tv2dk-traffic-costs/</guid>
		<description><![CDATA[	In an earlier posting we saw that tv2.dk in August 2007 served 142.132.680 pages and that the average page size was 395K and the average number of requests per page was 54.
How much traffic is this?
Doing some math it turns out that approximately 54 TB traffic and 7.7 billion requests during August! That&#8217;s a lot [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>	In an earlier <a href="http://blog.erichsen.net/2007/10/22/tv2dk-on-rails/">posting</a> we saw that tv2.dk in August 2007 served 142.132.680 pages and that the average page size was 395K and the average number of requests per page was 54.</p>
<p>How much traffic is this?</p>
<p>Doing some math it turns out that approximately 54 TB traffic and 7.7 billion requests during August! That&#8217;s a lot of traffic!</p>
<p><a href="http://www.jay.net/index/produkter/hosting.php">Jay.net</a> in their Grand National package say that 33000 GB traffic/month will set you back 10000 kr. which is approximately 1900$. Note that it is 33000 GB Danish traffic and that you have to pay for international traffic as well. According to <a href="http://www.alexa.com/data/details/traffic_details?url=tv2.dk">Alexa</a> 87% of the tv2.dk&#8217;s traffic comes from Denmark. My guess is that tv2.dk&#8217;s 54 TB traffic in the jay.net setup will cost them around 4000$.</p>
<p>What if the site was hosted on Amazon EC2/S3?</p>
<p>One option is to let Amazon S3 serve all static content. Using the <a href="http://calculator.s3.amazonaws.com/calc5.html">AWS Simple Monthly Calculator</a> the traffic is going to cost 8,699.44$ for the traffic itself and a request fee of 7,675.17$ totalling 16,374.61$! Letting the content from S3 removes the need for a dedicated server to serve static content but the request fee makes it rather costly.</p>
<p>Another option is to have a dedicated EC2 server for serving static content. The traffic is going to cost 8,699.44$ and the server itself 74.40$.</p>
<p>So jay.net turns out to be much cheaper than the Amazon offer for a high-traffic site like tv2.dk.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/enjoyingrails.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/enjoyingrails.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&blog=1936559&post=7&subd=enjoyingrails&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2007/10/27/tv2dk-traffic-costs/feed/</wfw:commentRss>
	
		<media:content url="http://www.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
	</channel>
</rss>