August 2010
1 post
Ruby Summer of Code — Benchmarking CI
Back in April I was anxious to jump into the Google Summer of Code. I was eagerly scanning all Ruby-related proposals and waiting for Google to announce which ones were approved. As a Ruby guy, I was very disappointed by the fact that not a single Ruby-related proposal was accepted. Despite this initial turndown, some awesomely clever people had this great idea. They wanted to follow...
Aug 31st
4 notes
April 2010
2 posts
Porting an application to Ruby 1.9
We recently ported our application to Ruby 1.9, here at escolinhas. After seeing the benefits of using Ruby 1.9.1 instead of 1.8.7, we just couldn’t resist (check before, after or just read the entire blog post). We had to sort a few things out in order to make our application 100% compatible with Ruby 1.9. I’ll cover the issues that most people will probably have to face. Encoding...
Apr 28th
1 note
Ruby Web Servers Benchmark
Feeling like my hardware wasn’t being used to the full extent of its capabilities, I decided to benchmark the most successful web servers from my previous trials in a different environment. This time, however, I’d use more workers, to see if there are significant performance gains and watch memory consumption. Different versions of Ruby were also taken into account. As you’ve...
Apr 1st
2 notes
March 2010
4 posts
Passenger Benchmark (on Apache/Nginx)
For the last few days I’ve been putting Thin and Unicorn behind Apache, Nginx and Cherokee acting as proxies. The day would finally come where the all mighty Passenger would come to dance with the rest of its partners. This benchmark is focused on Passenger’s performance on Apache and Nginx and, of course, an analysis is made on the achieved results. Setup and test The setup is...
Mar 12th
1 note
Thin vs. Unicorn Performance Benchmark
Thin, as I’ve mentioned in previous posts, is a very fast Ruby web server. Unicorn came a bit after and had some buzz associated with its arrival. Recently Twitter adopted it, so it’s a worthy opponent to the already established Thin web server. Setup, test and configuration Thin’s version and configuration were already stated in my previous 2 posts. As for Unicorn, you can find...
Mar 11th
Thin benchmark (with and without threading)
Thin is natively not based on the thread per request philosophy. It relies on the highly efficient EventMachine for lightning fast I/O. Although many benchmarks show Thin as being one of the fastest web servers for Ruby out there (like this one, which is great), many still don’t trust its single-threaded philosophy. Hearing the masses, its creator (Marc-André Cournoyer) decided to implement...
Mar 9th
Proxy performance in a Thin cluster environment
When scaling and using a proxy, it needs to be able to forward requests efficiently so the workers can to their job. This benchmark will focus on proxy performance. The back-end will be constituted by 4 Thin servers waiting for the proxy to forward them requests. Their configuration is exactly the same, so their efficiency will be dependent on the proxy’s ability to efficiently forward...
Mar 9th
1 note
February 2010
3 posts
Ruby 1.8/1.9 performance on Gentoo Linux and...
I’ve used the Ruby Benchmark Suite to do a few benchmarks on MRI (Ruby 1.8) and YARV (Ruby 1.9), both on Gentoo Linux and FreeBSD. First, the results The results for version 1.8 are as follows: The FreeBSD situation improved a bit on version 1.9. The results were: Benchmark details Ruby 1.8 and 1.9, as you have seen, were considered in this benchmark. The respective versions and...
Feb 22nd
Full-time commitment
This blog and my thesis are entering a new phase. I’ll be working full-time on this subject from now on until somewhere around June. First of all, I’ve got a new machine: CPU: Intel Core 2 Duo E8400 @ 3.0GHz (FSB @ 1333MHz) RAM: 4x2GB DDR2 (800 MHz, Dual Channel) HD: Seagate ST3750630AS 750GB SATA, 16MB Cache It’ll help me through the following months, thanks to Pedro. ...
Feb 18th
Second Keynote
I’ve been busy lately preparing my second keynote and a review of the state of the art on this subject. Here they are: Second Keynote EDIT: SlideShare’s editorial team has chosen this presentation to feature at their homepage. Nice! State of the Art Review Rails 3 On a side note, a beta of Rails 3 was released yesterday. Go check it out!
Feb 5th
1 note
January 2010
2 posts
Moving on
Last time I said I’d benchmark FreeBSD and compare its results to the ones I got on my previous post. I installed FreeBSD 8.0, used ports to install the needed packages and started doing the same benchmarks. At first, I had problems with ab because of a known bug. The solution given by the author didn’t work. I tried many versions of ab, patched or not, and the error kept showing up. ...
Jan 13th
Linux Performance Benchmark - Apache/Nginx
Since I’ve come to no solid conclusion in my last benchmarks, I chose to make this one web focused which makes plenty of sense since it’s my main goal. I was going to test apache and nginx with 3 kinds of pages: A very light page - “Hello world!” A normal page, with some text and a few images A heavy page with a lot of content and heavy background processing I...
Jan 9th
4 notes
December 2009
4 posts
Linux Performance Benchmark - System
I decided to start by enduring a simple and generalist benchmark to all distributions, using hdparm, gzip, gunzip, lame, oggenc and heavier one where I mixed all I mentioned before plus a standard PHP compilation. There were many surprises and a few details I couldn’t really understand but we’ll get to that. Configuration As you know, I’ve tested Ubuntu Server, Debian, CentOS...
Dec 29th
1 note
Benchmark Server
As I’ve told you before, I’ve been trying to get a server to run a few benchmarks on some operating systems, web servers and possibly a few other things. After struggling a bit with the IT department I was finally given a decent machine: CPU: Intel Core 2 Quad Q9300 @ 2.50GHz (FSB @ 1333MHz) RAM: 2x2GB DDR2 (800 MHz, Dual Channel) HD: Seagate ST3500620AS 500GB SATA, 16MB Cache The...
Dec 23rd
Database Indexes
Database indexes are separate files that sort specified fields. They impose an overhead in writing data but allow faster readings. Indexes are a powerful feature of most MyISAM and InnoDB databases and should be used with caution - although they can speed up a lot of queries, they can also slow your application down if not correctly used. If you don’t really get the concept, think of an...
Dec 11th
1 note
First Keynote
A lot of things have happened since I last posted, so I’ll divide them in proper sections. Codebits Last week I’ve been to codebits, a major Portuguese event with a lot of talks, workshops and a programming competition. Among other awesome stuff, I’ve had the chance to see Lenz Grimmer doing a talk about MySQL High Availability Solutions - Best practices and commonly used HA...
Dec 9th
November 2009
7 posts
Fetching Records with Batches
There are some situations in which you must fetch a lot of records from the database, instantiate each model object and show them in your view. There are many real-life situations where this can happen. I’ve had to deal with one recently as I was developing a real-estate website and had to list all districts, counties and parishes from Portugal in a search form. It’s a lot of coupled...
Nov 29th
File Transfers
If you happen to develop a platform that will have to support many file transfers there are a few things you could do to speed them up and go easier on your Rails application. I won’t cover the network part nor I’ll go into underground details - I’ll save it for another time. I’ll just give out some quick notes for all Rails developers that deal with file transfers. If...
Nov 23rd
More on Ruby's GC & Patching
Last time we covered Ruby’s garbage collector configuration, optimizing it’s settings with Rails needs in mind. There is still something we can do to improve it’s performance: patching. Even after configuring it right, it’s behavior is still inappropriate in some cases. We can solve that by simply changing it’s behavior on some situations, making it a more robust and...
Nov 17th
Ruby's GC Configuration
One of Rails fundamental weaknesses concerning performance is related to Ruby’s garbage collector. Some significant performance gains have a large development cost and sometimes it’s not worth to spend time researching, applying and testing these modifications. The basic principle is: start simple and bear performance in mind from the first second. This will reduce the time spent on...
Nov 12th
2 notes
Database Interaction Optimization
Last time I covered a basic technique - eager loading - that when used correctly can speed your database access a lot. Now I’ll cover some smaller but also important details relative to database access and interaction in Ruby on Rails that will also help accelerating your database operations. In some cases you might have to consider sacrificing you code legibility a bit in order to speed...
Nov 6th
1 note
Eager loading
I’ll start with something simple as I promised before. Eager loading is one of the basic features of Rails but when it’s missing or misused it can lead to huge performance hits. For those who don’t know what eager loading is please refer to lazy loading. When you figured that out, eager loading is the opposite - it let’s you fetch the same data using less queries to the...
Nov 5th
1 note
The fast start
I’m finishing my master’s degree on informatics and computer engineering at FEUP and engaged in a thesis about Rails optimization. The purpose of this thesis is to create a set of guidelines towards optimizing a Rails application and possibly a few patches for all the software involved, from the operating system to the application itself covering webservers, databases and so on. I...
Nov 3rd