

Welcome to the Rails TakeFive interview series, where we have a virtual sit down with leading developers from the community and bring you their insights into all things Ruby and Rails.
This week, we're bringing back a popular theme and hosting a Campfire chat between FiveRuns developer, Rubyist and Raconteur Adam Keys and Glenn Vanderburg, noted Rubyist, speaker, author, and the Chief Scientist at Relevance.
In this chat, Glenn and Adam talk about testing, the Ruby Community, framework philosophies, VM implementations, and more. Let's get started!
<style> /*------------------------------------------------- CHAT TABLE -------------------------------------------------*/ #chat-wrapper { overflow: hidden; margin-bottom: 1px; width: 585px; border: 1px solid #DDD; } #chat-wrapper table.chat { font-size: 12px; margin-bottom: 1px; font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; } #chat-wrapper table.chat div { font-size: 12px; margin-bottom: 1px; font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif; line-height: 15px; } #chat-wrapper table.chat td { padding: 5px; border-bottom: 1px solid #efefef; border-left: 1px solid #dcdcdc; } #chat-wrapper table.chat tr.outofwindow td { color: #aaa; border-bottom: 1px solid #f2f2f2; border-left: 1px solid #eee; } #chat-wrapper table.chat td.person { width: 1%; font-weight: bold; text-align: right; white-space: nowrap; vertical-align: top; background-color: #efefef; border-left: none; } #chat-wrapper table.chat tr.outofwindow td.person { background-color: #f5f5f5; } #chat-wrapper table.chat tr.you td { background-color: #ffc; } #chat-wrapper table.chat tr.chat_red td.person { color: #900; } #chat-wrapper table.chat tr.chat_blue td.person { color: #009; } #chat-wrapper table.chat tr.chat_purple td.person { color: #606; } #chat-wrapper table.chat tr.chat_green td.person { color: #363; } #chat-wrapper table.chat tr.chat_gold td.person { color: #660; } #chat-wrapper table.chat tr.chat_orange td.person { color: #D56C14; } #chat-wrapper table.chat tr.chat_indigo td.person { color: #A96B91; } #chat-wrapper div.chat_quote { font-style: italic; font-size: 24px; font-family: georgia; margin: 20px 0; } #chat-wrapper table.chat tr.break td { border: none; } #chat-wrapper #todays_transcript { font-size: 12px; font-weight: normal; padding-top: 15px; border-bottom: 1px solid #dcdcdc; color: #666; padding: 5px 0; } #chat-wrapper .pullquote { font-style: italic; font-size: 28px; font-family: georgia; margin: 20px 0; } </style>
Glenn Vanderburg has more than 20 years of experience developing software across a wide range of domains, and using a variety of tools and technologies. Glenn is always searching for ways to improve the state of software development, and was an early adopter and proponent of Ruby, Rails, and agile practices. He is also Chief Scientist at Relevance.

Welcome to Rails TakeFive, FiveRuns’ periodic discussion about Ruby on Rails with noted developers from throughout our community. This week, we’re honored to be joined by Jay Fields, noted software developer, author, and speaker.
FiveRuns: Welcome Jay! And, thanks for taking the time. Let’s kick it off by getting your thoughts on the community. Can you name a few relatively unknown or unheralded developers who you think deserve to be recognized and tell us why they rock?
Jay Fields: George Malamidis, Philippe Hanrigou, Pat Farley & John Hume are all not as well known, but superstar developers. I’ve worked with all 4 of them on projects and I would go out of my way to work with all of them in the future. They all possess the fantastic combination of being both innovative and pragmatic. They all have blogs, speak at conferences and contribute to open source. You might not have heard of them yet, but you definitely will in the future.
FiveRuns: Okay, we’ve all made mistakes. Name one of your most embarrassing moments of FAIL, or one of your biggest rookie gaffes.
Jay Fields: Several years ago I was working for ThoughtWorks and I became the Tech Lead for a team building a Ruby application that used a DSL for the business rules. It was the most interesting work I had ever done, but I made a huge mistake. It was a very short project, 3 months in all. In general I believe that premature optimization is a mistake, but on a timeline that small we really needed to start looking at speed early in development. Unfortunately, I didn’t make it a priority. In the end we spent the last 2 weeks of the project working on the performance, and barely got the project out the door.
FiveRuns: Do you agree that Rails presents a big opportunity in the current financial environment, because of the 5-8x productivity boost, the fact that Rails is open source, and the limited accompanying infrastructure costs? How is the economy affecting your work and/or your livelihood?
Jay Fields: I think Rails presents a big opportunity regardless of the financial environment. In fact, I think history shows that to be true. Companies didn’t start adopting Rails because of the financial environment. The adoption of Ruby/Rails has been on the rise since it’s introduction. I do think adoption will slow eventually, but not until all of the talented Ruby/Rails developers are out of the job market. Ruby absolutely makes better programmers more productive, companies would be foolish to ignore that whether they are up or down. Ruby isn’t the answer to all problems, but if it is an answer to your problem and you choose a more ceremonious language, you’re probably making a mistake.
The economy hasn’t had any impact on my livelihood. Computers have become so integral to everyone’s life, I don’t expect any good programmers are out of work. In fact, regardless of the financial environment, I think good programmers will continue to enjoy larger than average raises. If you aren’t getting better than average raises, you either aren’t as good as you think you are, you are trading money for some other form of happiness, or you’re missing opportunities.
FiveRuns: Mike Gunderloy recently did a post outlining the process for contributing code to Rails. What was your very first contribution? What motivated you to get started? Nowadays, how much time do you spend battle-testing your code with friends and fellow developers? How often do you make use of the rubyonrails-core mailing list or the #rails-contrib channel on IRC?
Jay Fields: I’ve never actually had a patch committed to Rails, but I’ve had a few ideas that ended up making it into Rails in slightly varied ways. The most popular is probably the test class method that can be used when writing tests in place of defining test names that start with test. I was motivated to contribute to Rails because I felt that the current options were inferior to what was available, and I was tired of customizing Rails with each new project. There’s also a nice feeling (for me anyway) when you have an idea that can help the community as a whole. I’ve never used the IRC channel, but I’ve found the mailing list to be a great testing ground for patches.
FiveRuns: Have you ever taken a Ruby-related course or seminar, either in-person or virtually? Who are some of the best teachers and courses out there? For nubies? For pros looking to break through to a new level?
Jay Fields: I spend a fair amount of my time learning. I’ve always been in the work-smarter-not-harder camp. In the past few years I’ve attended as many as 6 conferences a year, and there’s almost always a few great presentations. I’m a big fan of conferences usually, but I’ve also been happy with the Pragmatic Studios and The Rails Edge mini-conference. There’s so many great guys in that group: Chad Fowler, Dave Thomas, Mike Clark, Stu Halloway, Justin Gehtland, Marcel Molina Jr, Ezra…. there’s really too many great guys doing Ruby and presenting to name them all. I’m also a huge fan of Geoffrey Grosenbach and PeepCode screencasts. Between those guys there’s information for everyone from a Ruby hobbyist to a professional Ruby developer.
Jay Fields is a software developer and consultant at DRW Trading and www.jayfields.com.
He has a passion for discovering and maturing innovative solutions. His most recent work has been in the Domain Specific Language space where he has delivered applications that empowered domain experts to author domain logic. He is very interested in maturing software design through developer testing and software testing in general.
Jay is also the author of <u>Refactoring: Ruby Edition</u> and a contributor to <u>Advanced Rails Recipes</u>.
One of the critical components FiveRuns Manage allows you to monitor is the memory usage of your Rails application server. Memory usage is one of the metrics that can provide insight into the availability and responsiveness of your Rails system. These measurements are global to the operating system and independent of your individual Rails application processes.
Which Metrics To Track?To accurately gauge memory resources, Manage correlates the relative metrics. In the example below, a low percentage of free system memory does not necessarily indicate a resource constraint. The operating system may allocate the bulk of available physical memory to optimize server performance.

Sustained contention for RAM however, can generate swapping to your virtual memory system. This is a good indicator the physical memory is constrained and you are paying a performance penalty by swapping out to disk. Manage tracks both physical and virtual memory statistics like swap in, swap rate and page file usage.

Browsing memory metric graphs is exciting and all, but maybe you’ve got some other things do? No problem. Manage allows you to configure custom alerts using your Rails environment’s baselines and important metrics. The memory example above could be built into a trigger with two simple conditions to provide a more accurate notification of a system problem. When conditions meet your criteria, an email alert is generated with a synopsis of the situation and a link back to the FiveRuns console where you can investigate in more detail.

FiveRuns Manage leverages the full stack of your Rails server metrics, to keep you informed of your application’s status. What are the other important metrics you depend on to keep your production Rails applications online? Let us know and we’ll cover them in future blog posts!

We are happy to announce several new partners who have recently joined our RAMP partner program. Welcome, and we look forward to working with you!
If you have a Rails app, and are looking for development help, we highly recommend any of these companies. If you’re a Rails development shop and looking for ways to earn additional margin, check out our new performance optimization and deployment readiness services. Just let us know if we can help!

Integrum is a close-knit, experienced, internet-savvy group that makes web applications using the latest technologies and web standards to emphasize business value, community, and user-experience. Integrum builds for the internet because they like to and because they are good at it. It’s that simple.

Y|Factorial is a Rails consultancy founded in 2007 by Rails contributor and author Ryan Daigle. Specializing in an agile and transparent project life-cycle, Y|Factorial efficiently delivers intuitive software built on Ruby frameworks like Rails, Merb, DataMapper and more.

Open Rain is a premier custom software solutions developer specializing in dynamic, data-driven websites for online business. Founded by computer scientists, OpenRain breaks the mold of archaic web development practices using high-velocity, rapid-feedback cycles and small, highly qualified teams with rigorous quality standards. Cutting-edge web solutions are developed with JavaScript, CSS, XHTML and Ruby-based web frameworks.

Brown Beagle Software is a reliable producer of quality Ruby On Rails code. The Brown Beagle headquarters is in Perth, Western Australia, but their services are provided for companies all over the world. They’ve built quality Ruby On Rails systems for clients with a diverse set of requirements ranging from the health industry through to white label Internet services.

Unshakable Media is a multimedia production company creating user-friendly and search engine friendly Ruby on Rails Applications. They build both custom applications and production ready applications. They also have a video productions team along with an internet marketing team. Altogether Unshakable Media is a great company to take your site and applications to a new level by adding web 2.0, video, marketing, and other innovative strategies to get your business to the top. They say at Unshakable Media that they are “Empowering Your Site For Success!” So come check them out at www.UnshakableMedia.com or 512-983-2206.
A while ago someone had asked who’s using Phusion Passenger in production. The positive responses were overwhelming; thanks to all who had replied!
Ruby Enterprise Edition seems to get a bit less attention than Phusion Passenger, so we’re wondering how many people use Ruby Enterprise Edition in production. We need this information for marketing purposes, and seeing that we’re providing REE for free, we’d be really grateful if you could take some time to tell us. Please send replies to the mailing list.
And if you can, please also tell us which of your websites are powered by REE and how much traffic they get.
Thank you.
How do you ensure your Rails app is running well? There are many application, database and server metrics available and each can provide useful information about your system. Organizing and evaluating that data allows you to quickly assess how your application is performing and identify problems. This post introduces the ways FiveRuns Manage helps you ensure your Rails applications remain healthy and responsive.
Manage was designed to monitor your complete Rails environment and deliver organized, actionable status information. The Manage dashboard aggregates metrics from your full Rails stack, including operating system, database, Mongrel, memcached, Apache and nginx. Metrics are trended over time and provide drill down detail for interesting measurements or those indicating a potential problem.
The Right Tools To Measure Rails HealthStarting with individual apps and groups of application clusters, Manage summarizes the current Rails availability status. Threshold triggers provide even more detailed monitoring of specific rails metrics and other applications on your system.

Select a Rails application or cluster above for detailed performance analytics. The Application Dashboard below identifies the slowest measured controllers across the Rails environment on the right and those receiving the most activity below. Sparkline graphs on the left provide a summary of recent Rails performance trends and each link to detailed statistics. The metric span can be adjusted between 1 and 24 hours to view a specific period of interest. In this example, the Rails application’s response time is increasing, but there is no additional request load occurring during the same period, which could indicate a problem trend.

The Manage System Browser displays these trends in more detail and allows correlation with other system metrics. If the degraded Rails application response time is being is caused by a memory leak on the app server or low disk space on the MySQL back end, this is the place to find it.
The System Browser is also a great place to assess baselines for your Rails environment monitors. Metric data is available spanning periods up to 48 hours and covering every level of the application stack.

For even greater precision, Manage Reports combine critical Rails health measurements into a single, consolidated view. System Overview Reports are provided out of the box or customize your own to the individual controllers, models and actions most important to you.
To keep a constant on eye on your Rails application’s health status, Manage triggers events when thresholds you set are exceeded. You can choose be notified by email with a summary of the event and links back to the FiveRuns Manage console for complete troubleshooting.
Stay tuned for future posts on using FiveRuns Manage to keep your Rails applications healthy, including additional information on specific metrics, use of triggers and how to create custom reports that focus on your key metrics.
With our new Performance Optimization and Deployment Readiness Services, we’ve already helped some of our customers optimize their websites and applications. Now, we’re looking for some particularly nasty performance problems to help solve. Send us your biggest Rails application performance issue and you could be one of five winners of free consulting services from FiveRuns!
Just email your name, company name, url and a description of your most pressing Rails application performance issue to performancechallenge@fiveruns.com. We’ll choose five companies to receive free FiveRuns Performance Optimization Services!
Here are the details:Ready…Set…Go!
We congratulate the Merb team on a successful 1.0 release!
We’d like to announce a new version of the TuneUp panel slice gem for Merb (which sits up at GitHub), as well as the core TuneUp dependency.
v0.5.3 is a bugfix release, addressing issues with uploading runs and removing development dependencies that were causing loading issues. The installation instructions have also been updated, removing the now-unnecessary installation task (assets are now copied automatically on startup, as with the TuneUp for Rails) and changing the routing instructions.
Many thanks to Matt Aimonetti for his continued help tracking down issues and providing Merb slice “best practice” guidance. Cheers!

Last year, we launched a partnership with BitRock, an innovator in open source tools and stacks, and introduced FiveRuns Install, a Ruby on Rails stack optimized for production environments. Install has been a great success, with thousands of downloads from the community. This week, we’ve happy to announce that we’ve expanded our partnership with BitRock and now their BitNami RubyStack, a freely available, ready to run distribution of Ruby on Rails, will include FiveRuns TuneUp, our free/open source application profiling tool for Ruby on Rails and Merb developers.
The BitNami RubyStack was released in 2007 and has been downloaded tens of thousands of times. It’s a freely available, ready to run distribution of Ruby on Rails, packaged with BitRock’s multiplatform installer, making it easy to have an enterprise-ready Rails environment up and running in just a few minutes. By including FiveRuns TuneUp with the RubyStack, we wanted to give developers a complete environment for installing, developing, and profiling Ruby on Rails applications that can be optimized for performance and scale.
BitRock has been a terrific partner, and we’ve been continually impressed by their expertise and leadership in the open source stack business, so we’re very excited to further our relationship and offer up this bundle to the Rails development community. RubyStack is currently available for Linux, Mac OS X, and Windows, with support for Solaris coming soon. It is free to download and use under the terms of the Apache 2.0 license.
For more details, or to download a copy, visit BitNami.org.


Congratulations to FiveRuns Rubyist Bruce Williams!
Bruce was selected to join Barack Obama tonight at his election night party in Chicago’s Grant Park as one of 10 winners from across the country who participated in the Front Row to History campaign. Bruce invited Damon Clinkscales, who most of you know as the founder of Austin On Rails, to join him tonight as his guest.
We’re incredibly proud of Bruce and Damon – the only two Austinites (and Rubyists) selected to participate in this historic event! Of course, the guys had to whip up a site to monitor their activities while in Chicago. You can follow Bruce’s and Damon’s live-tweets at obamaftw.org. Watch for pics and other updates throughout the evening.
And don’t forget to Vote!
p.s. I neglected to give credit to Erik Kastner for helping Bruce and Damon with obamaftw.org. Thanks, Erik!
TuneUp is FiveRuns’ open source plugin for profiling the performance your Rails and Merb applications. TuneUp is intended to be run locally in your development environment, since the instrumentation returns detailed analysis of a single browser invocation. Bottlenecks can be identified before deployment and before your users experience a performance issue.
Why?There are some times it may be useful to run TuneUp in production. Perhaps you’d like to share the profiling view across a team. Maybe you’d like to compare the metrics of that same request, against your production database’s configuration, on the actual hardware or under the live platform’s operating system.
All you need to do to activate the TuneUp instrumentation in production is create the following file:
/YOUR/APP/config/tuneup.rbContaining the following:
Fiveruns::Tuneup.config do |config| config.environments << :production endThat’s it. Restart your rails app on the server and it will render the TuneUp instrumentation bar to your local browser. From there, you can toggle it on and off and profile the live server requests remotely.
Why not?Running TuneUp in production should be done in a closed environment. The instrumentation bar, sequel queries, controller names and other analytics about the code base are displayed. Also, multiple browsers accessing the application concurrently may skew the profiling results.
If you’d like to permanently monitor your servers’ Rails performance in production, check out FiveRuns Manage.
I’ve been playing with benchmarking tools this week. After reviewing the open source options, I ended up working with just a few of the dozens of choices. Some are new and Rails specific. Some are no longer maintained yet remain popular choices. Here’s a sample:
There are not only a lot of tools, there are a variety of approaches to take. Are you looking know how fast your application can return a single user’s transaction? Is a better durability test to know how much traffic your application can sustain over longer periods? Should you test individual pages of the web app or build workflow sequences to more closely simulate real world activity?
For your performance test method, what’s your choice of benchmarking tools?
<embed src="http://www.polldaddy.com/poll.swf" height="389" width="252"></embed>I’m not sure what I should write down here seeing as David Heinemeier Hansson pretty much sums it all up:

Indeed, Passenger now supports the ability to choose for global queing at the request of 37signals, which has the potential to be the first of many exciting collaborations with the company responsible for applications such as Basecamp, Campfire and of course, the Rails framework.
For more info on this feature as well as on Phusion Passenger’s architecture, we’d kindly like to refer you to Passenger’s user guide and architectural overview.
For completness sake, I’ve included the relevant information with regards to this feature below for your reading pleasure.
What does this option (Global Queuing) do?Recall that Phusion Passenger spawns multiple backend processes (e.g. multiple Ruby on Rails processes), each which processes HTTP requests serially. One of Phusion Passenger’s jobs is to forward HTTP requests to a suitable backend process. A backend process may take an arbitrary amount of time to process a specific HTTP request. If the websites are (temporarily) under high load, and the backend processes cannot process the requests fast enough, then some requests may have to be queued.
If global queuing is turned off, then Phusion Passenger will use fair load balancing. This means that each backend process will have its own private queue. Phusion Passenger will forward an HTTP request to the backend process that has the least amount of requests in its queue.
If global queuing is turned on, then Phusion Passenger will use a global queue that’s shared between all backend processes. If an HTTP request comes in, and all the backend processes are still busy, then Phusion Passenger will wait until at least one backend process is done, and will then forward the request to that process.
When to turn on global queuing?You should turn on global queuing if one of your web applications may have long-running requests.
For example suppose that:
The situation looks like this:
Backend process A: [* ] (1 request in queue) Backend process B: [*** ] (3 requests in queue) Backend process C: [*** ] (3 requests in queue) Backend process D: [*** ] (3 requests in queue)Each process is currently serving short-running requests.
Phusion Passenger will forward the next request to backend process A. A will now have 2 items in its queue. We’ll mark this new request with an X:
Backend process A: [*X ] (2 request in queue) Backend process B: [*** ] (3 requests in queue) Backend process C: [*** ] (3 requests in queue) Backend process D: [*** ] (3 requests in queue)Assuming that B, C and D still aren’t done with their current request, the next HTTP request - let’s call this Y - will be forwarded to backend process A as well, because it has the least number of items in its queue:
Backend process A: [*XY ] (3 requests in queue) Backend process B: [*** ] (3 requests in queue) Backend process C: [*** ] (3 requests in queue) Backend process D: [*** ] (3 requests in queue)But if request X happens to be a long-running request that needs 60 seconds to complete, then we’ll have a problem. Y won’t be processed for at least 60 seconds. It would have been a better idea if Y was forward to processes B, C or D instead, because they only have short-living requests in their queues.
This problem will be avoided entirely if you turn global queuing on. With global queuing, all backend processes will share the same queue. The first backend process that becomes available will take from the queue, and so this “queuing-behind-long-running-request” problem will never occur.
Turning global queuing off will yield a minor performance improvement (about 5%, depending on how fast/slow your web application is), which is why it’s off by default.
So your shiny new Rails application is ready for production. Time to configure the server application layer. A common question we hear at FiveRuns is: What’s the best number of Mongrels to use? There are a plenty of opinions, including yours, so feel free to comment below.
Test DriveEarly on, Zed recommended performance testing with httperf and an increasing numbers of mongrels to determine the best number for your setup. Test a file served directly from the web server and then test your app via a single mongrel instance. This provides a static file reality check and then a decent baseline from which to improve the responsiveness based on additional mongrels.
> 1Depending on the memory footprint of each mongrel process and the available system memory, you may have an upper limit to consider for your server. Some administrators use at least two mongrel processes to balance the queue and avoid any locking behind a single mongrel or Rails request. My tests with a very entry level 256 MB virtual machine yielded the best performance using 3 mongrel instances behind an Apache2 front end.
UsThe average number of mongrel processes used by our customers is 5 per Rails app and 12 per server on systems with 8 GB of physical memory. This is what we run here at FiveRuns too. For example, a common setup is to have two high volume applications, served by 5 mongrels each and a lower volume Rails app with 2 mongrels. A lightweight front end like nginx balances traffic among the mongrel ports in use and optionally, any additional application servers in the hardware pool.
None?Choosing not to answer the “How many Mongrels?” question is becoming a popular option. Passenger handles the port management between the front end and application layer, including the optimal number of back end processes. Thin is lightweight and crazy easy to install and configure. Each yield comparable or better performance metrics. Ebb also lists significant performance gains over mongrel.
So with configuration ease and performance gains, why choose mongrel today? Still grateful for delivery from FastCGI/lighttpd? (like me?) Perhaps you are gauging the community adoption of the alternatives? Maybe it’s a proven part of your existing architecture?
As we’ve worked with our customers, our partners, and the community over the past couple of years we have gathered lots of tips, tricks, and best practices around Rails application performance, administration, and deployment. We’ve heard the message loud and clear – people are looking for help in speeding up their apps – so we are happy to announce two new services offerings to fit the bill: Performance Optimization and Deployment Readiness.
Now, you can call us in to help you tune-up, ���x-up and scale-up your Rails applications so that you can get all the performance and scale that your application and business demands. We’ll deliver these services directly, or through one of our development partners, whichever works best for you.
We’re also happy to announce that we have partnered with Relevance, a leading consulting, development, and training company that is focused on Ruby on Rails, to deliver the new services as part of their consulting engagements. Relevance clients will be offered the FiveRuns performance optimization and deployment readiness services as well as use of FiveRuns Manage and TuneUp performance monitoring software products as part of their Relevance engagement.
From Justin Gehtland, president of Relevance: “Relevance specializes in delivering agile Ruby on Rails application development and training services to our customers. FiveRuns’ expertise in optimizing application performance prior to deployment and continually monitoring it while in production expands the scope of our services, provides significant value to our customers, and enables us to better meet their application development needs.”
And the results are encouraging. TradeKing, a nationally licensed online broker dealer and pioneer in incorporating social networking features into online trading, worked with us to optimize the performance of their website using the new services.
From Mike Massey, director of community development at TradeKing: “Rails has made it easy for us to develop our applications quickly and beautifully, but understanding how they will perform has been somewhat of a black hole. FiveRuns’ extensive experience in Rails application performance coupled with their monitoring and profiling tools have helped us increase the performance of our site by an order of magnitude and helped ensure the best online trading experience for our customers.”
Here are the details of the new offerings:
FiveRuns Rails Performance Optimization Service. We’ll do a full review of your Rails application and the production environment to help pinpoint performance bottlenecks, optimize the stack and production con���guration and prepare for future scale. As part of this service, we will:
FiveRuns Rails Deployment Readiness Service. This service is designed to ensure successful application performance, on even the most aggressive application deployment schedules. We’ll include analysis of the desired performance characteristics of your application and the Rails stack components on which it runs. We will also:
We’re also happy to put together custom services to address performance scale problems you are having with your Rails applications.
So, if you have a performance problem that needs addressing, we’d love to work with you on it. More details on the services can be found here. Or, just shoot us a note and we’ll be in touch.
Welcome to the second FiveRuns blog post to automate server configuration for Ruby on Rails. We received great feedback and suggestions about the original script, Automatic Rails at Slicehost, which installed the basics. This time we’ll use standards like Capistrano deployment, separate web and application layers and an active database backend. While the Hello World application surely dazzled your friends and family, this time we’ll take it up a notch and deploy a working, full stack community web application, Trevor Turk’s cool Rails app, Eldorado.
The WhatThis script connects to a new Ubuntu 8.04 server and configures all necessary applications and libraries. Since we are installing a lot more this time, it’s a bit long to post here, so I’ve linked to it on Github. You still only need to provide 2 pieces of information: the target address of your server and the password. Execute the script locally which downloads Eldorado, the associated configuration files and then connects to your server to push the installation.
The previous script installed:1. Download the script from Github. I’ve abbreviated the URL.
wget http://tinyurl.com/57sjce -O configure_ubuntu_eldorado.sh2. Run the script.
sh configure_ubuntu_eldorado.shThat’s it! You’ll be asked for your password twice, once to set up the OS via ssh and once to run the Capistrano deployment tasks. Speaking of passwords, best practices include dedicated deployment and MySQL user accounts. This script uses the root account for simplicity.
The WhyThe script originated as a DRY effort for Slicehost deployments. You can now point it at other providers, remote Ubuntu servers or virtual machines. It’s become a handy way to explore a working Rails environment without manually installing every component. Also, writing configuration automation is a great way to hone your deployment skills. Thanks go to Trotter Cashion for the suggestion to maintain the scripts on Github, where they’ve been forked and extended. Check out Jørgen Orehøj Erichsen’s blog adding support for Passenger and Ruby Enterprise Edition.
All the scripts and configuration files are on Github so feel free to post any feedback or suggestions.
Welcome to the second FiveRuns blog post to automate server configuration for Ruby on Rails. We received great feedback and suggestions about the original script, Automatic Rails at Slicehost, which installed the basics. This time we’ll use standards like Capistrano deployment, separate web and application layers and an active database backend. While the Hello World application surely dazzled your friends and family, this time we’ll take it up a notch and deploy a working, full stack community web application, Trevor Turk’s cool Rails app, Eldorado.
The WhatThis script connects to a new Ubuntu 8.04 server and install all necessary applications and libraries. Since we are installing a lot more this time, the script is a bit long to post here, so I’ve linked to it on Github. You still only need to provide 2 pieces of information: the target address of your server and the password. Running the main script locally will download a copy of Eldorado and a few associated configuration files.
The previous script installed:1. Download the script from Github. I’ve abbreviated the URL.
wget http://tinyurl.com/57sjce -O configure_ubuntu_eldorado.sh2. Run the script.
sh configure_ubuntu_eldorado.shThat’s it! You’ll be asked for your password twice, once to set up the OS via ssh and once to run the Capistrano deployment tasks. Speaking of passwords, best practices include dedicated deployment and MySQL user accounts. This script uses the root account for simplicity.
The WhyThe script originated as a DRY effort for Slicehost deployments. You can now point it at other providers, remote Ubuntu servers or virtual machines. It’s become a handy way to explore a working Rails environment without manually installing every component. Also, writing configuration automation is a great way to hone your deployment skills. Thanks Trotter for the suggestion to maintain the scripts on Github, where they’ve been forked and extended. Check out Jørgen’s blog adding support for Passenger and Ruby Enterprise Edition.
Check out the scripts used on Github and feel free to post any feedback or suggestions.

Welcome to this week’s Rails TakeFive, our weekly discussion about Ruby on Rails with noted developers from throughout our community. This week, we thought we’d take a little different tack and bring you words of wisdom from one of our customers on how they use Rails and FiveRuns Manage to help keep their site humming.
James Elwood is Network Ninja Master for Geezeo.com, a free web-based personal finance application that makes it easy to track all your finances, see where all your money is going, set financial goals and learn from others. Built in Rails, it’s an awesome application and community, and has received a ton of great buzz from the financial community.
FiveRuns: Welcome James, and thanks for taking the time to share your thoughts! Let’s start by talking about how you got started with Rails at Geezeo. When and why did you decide to build Geezeo on Rails? What are some of the biggest benefits you’ve seen?
James Elwood: I came on board a little after Geezeo made the decision to build on Rails. One of first early iterations of our product was built in PHP by an outsourced team. This first iteration provided an initial idea for the site but did not allow a process where the team could rapidly take an idea and make it functional in a short period of time. Coming out of the outsourcing experience the team had been reading Agile Web Development with Rails. Because of this experience and all the buzz in the industry about Rails, we decided to go with Rails full steam ahead.
Sitting back mainly on the sysadmin end I am impressed with how rapidly the team can take something sketched on paper and push it out the door. In prior jobs, often the littlest changes would involve stepping back through legacy code trying to shoehorn in new features with no guarantee that a deliverable would happen in the current quarter or even year. The challenge for me in supporting them is just trying to keep pace with them as the requirements shift and they find new and inventive ways to boost performance and streamline operating costs. My experience is that Rails and the development methodologies surrounding it play a huge part in our ability to dream, design, build, and deliver.
FiveRuns: How has FiveRuns helped streamline and enhance your systems management processes?
James Elwood: By nature I am lazy and have an extreme dislike for perpetual repetition. I also hate re-inventing the wheel when I could be innovating the next big thing. But let me clarify, lest my bosses think that 70% of my time on the job is spent asleep. My feeling is that if you can automate a task then do it because that will free you up to tackle more pressing tasks or ones that add increased value.
At my last job we had the horrendous daily task of writing out the back up logs. (Literally writing them out. By hand, With pencil and paper). It was one of those jobs that you grit your teeth and wish that you could convince the powers that be to look at how you could manage that process by exception. FiveRuns lets me do that for Geezeo.
I rest easy knowing that FiveRuns will wake me up in the middle of the night to tell me that something is wrong with the server. Glancing over graphs on the dashboard gives me a quick and concise view of how my entire stack is performing and if something looks amiss I can drill in for more detail. That beats gnawing on the end of a pencil logging into every server, every morning of every workday. If anything FiveRuns has lowered my pencil budget substantially.
FiveRuns: Can you name a time when FiveRuns was vital to Geezeo’s upkeep?
James Elwood: FiveRuns helped point out an oversight on my part that killed our MySQL backups for a better part of the day (not one of my prouder moments!). We use replication so that we can have an online spare as well as for backups. Since we have been on EC2 since the early days we got into the habit of using mysqldump to get a snapshot of the database off the slave and tossing it up on to S3 for the inevitable “what if?” scenario.
The problem started when I forgot to uncomment one little line in the backup script, the one about stopping the slave. The slave was dutifully replicating while earnestly trying to dump the database to file and in the process just getting plain ugly with itself. So one morning, on a chart scanning expedition, I noticed that the CPU on the slave was tweaked which led me to check into what the instance was or was not doing.
By pointing out my shell scripting oversights, FiveRuns also made it obvious that I really ought to write a report that tells me if I missed any backups in a given period (no way am I picking up that pencil again). Being reminded of my shortcomings and mistakes is critical for me to not drop the ball. I guess in that regard, FiveRuns is like my mom on the job, “Don’t forget to look over your homework and when you get a chance would you please clean out that temp directory sometime this century?”
FiveRuns: How has using FiveRuns improved the user experience at Geezeo?
James Elwood: Soft spots and weaknesses, that it what I am looking for when I use the service. Is there anything on the server side that I can tighten or add capacity to? Are there any controllers that are sucking the life out of the Internet that the team should be made aware of? FiveRuns is part of the process aimed at refining and improving our stack. I’m never really satisfied with anything I work on because when I get the chance to step back I can see where I could have done things differently so I use the service to continually solicit feedback with the hope that I can make the things I do feel a little less unfinished.
FiveRuns: What types of product features or integrations would you like to see in the future from FiveRuns?
James Elwood: Some of the things I love to see is more push reporting, there are times when the work load gets too much and the only applications you might have open are mail and a terminal. Getting the charts pushed out in an email even on a weekly basis would be nice, especially the application metrics. If that could be configured to report on the pieces that a developer is working on and just push those metrics out on how it is performing in the various the environments we are monitoring it could be a big win. Everyone is often heads down during a sprint and can loose sight that the sun still comes up and goes down everyday. Combined with TuneUp I think it would give developers insight into how the code is performing.
James Elwood is the Network Ninja Master for Geezeo.com, the go-to guy for all networking and web development projects. With 10 years experience in network administration and information technology, James has been a integral part of Geezeo’s success. Before coming to Geezeo, James served as Network administrator for BKM total office, one of the worlds largest distributors of Steelcase office furniture. James holds a Bachelors degree from Connecticut State University and an MBA in Technology management from the University of Phoenix.
FiveRuns will be speaking at the San Francisco Ruby Meetup on Thursday, October 16 at 6:30pm. And, afterwards, we’ll be heading over to the The Dubliner on West Portal to have drinks, food and chat some more.
Bring your business card, mention FiveRuns and get $3 drinks. Or, look for Theo, Greg or Mike, get a FiveRuns sticker and get $3 drinks. Hope to see you at the Meetup, at the bar, or both!
We’re proud to release version 0.5.2 of TuneUp for Merb. This release fixes one bug, which was the incorrect display of TuneUp in Safari.
Here’s how to update:
Enjoy!
Since TuneUp was released in May, we’ve been thrilled by the interest we’ve seen from across the Ruby community. It’s become a day-to-day debugging, performance tuning, and communication tool for many Rails developers, and over the last few months the involvement of the community in improving the stability and usability of the plugin as an open source project, hosted on GitHub, has been tremendous. Thanks, everyone!
So, what’s next for TuneUp?Over the last year or so the Ruby community has seen an explosion of new web frameworks. We all love Rails, but a little friendly competition is a good thing, right? At FiveRuns we’re first and foremost Rubyists, and we’ve been having a lot of fun playing with these alternatives and thinking about how we can support them in our products.
We’ve been especially interested in Merb, which has been steadily growing in popularity and stability, and has popped up in feature requests from our customers. We’ve talked to a number of shops that include Merb development in their bag of tricks, and support for Merb in TuneUp has been a frequent follow-up question after demos at Ruby user groups.
So, today we’re announcing FiveRuns TuneUp for Merb, direct from MerbCamp in San Diego and just in time for the official release of Merb 1.0.
Let’s take a peek.TuneUp for Merb is packaged as a Merb Slice, and works with Merb v0.9.5 and higher (it might even work with previous versions). Installation and setup is easy (we love slices); in just a few steps you’ll see a panel above your application that will provide in-depth information on the current action.

Currently, TuneUp for Merb provides information on filters, renders, and DataMapper activity (let us know what other ORMs you’d like to see. Sequel? ActiveRecord?). You can see what proportion of time you’re spending in the model, view, or controller, as well as how long each step takes to execute, where it’s being called (with support to jump to those files in TextMate), and for DataMapper activity the SQL query that was executed and a detailed breakdown of the Query object. Even if you’re not focused on performance, the TuneUp panel is a powerful exploratory tool; as with the Rails version, we expect we’ll hear developers are using it for debugging just as often as they use it for tuning.
The TuneUp CommunityAnother thing about TuneUp that we’ve received a lot of great feedback on is its use as a communication tool. With a single click from the panel you can send up the same detailed information on an action to http://tuneup.fiveruns.com, where you can keep it private (just to save it), share it with specific people, or even make it public—where the entire community can help you solve problems.

Installation is easy – in just a few steps you can start seeing detailed performance metrics on your Merb app. It comes packaged as the fiveruns_tuneup_merb gem. The detailed instructions are on the TuneUp web site.
Once configured, you can instrument your local Merb applications with TuneUp. For further capabilities, like uploading and sharing of TuneUp runs via the TuneUp website, please create an account and add the API key from your profile page. Please help us grow the public TuneUp community by uploading runs, sharing them and participating in the discussions.
Open SourceOur commitment to open source is the same as always. GitHub is a fantastic service, and we’re happy to make fiveruns_tuneup_merb (and dependency fiveruns_tuneup_core) available for forking. The project is still in its infancy, is most certainly a beta, and any help you can provide on making it more stable by contributing code (or sending bug reports and feature requests to our support team at
We’ve just unleashed FiveRuns TuneUp v0.8.17. This release fixes an issue when running on JRuby. It also corrects a snafu I introduced by building 0.8.16 against a modified working copy. My bad! If you were previously getting an exception coming out of _data.html.erb, this release should fix that.
The moral of the story is, you should always run git status or svn status before you build a Gem!