InfoQ

News

Thin The Fast Ruby Web Server

Posted by Sebastien Auvray on Feb 25, 2008 04:00 AM

Community
Ruby
Topics
Web Frameworks,
Performance & Scalability
Tags
Mongrel,
Ruby on Rails
Today Mongrel is the defacto Ruby webserver of choice (watch Zed Shaw's, creator of Mongrel, presentation from QCon London 2007) . But a new experimental solution is now available under the name of Thin. Thin glues together three Ruby web libraries:
  • The Mongrel parser (using Ragel) the root of Mongrel speed and security.
  • Event Machine, a simple event-processing Ruby library that makes it possible to write scalable network I/O process.
  • Rack, a minimal interface between web servers supporting Ruby and Ruby frameworks.
Marc-André Cournoyer made a presentation of Thin at latest Montreal on Rails showing the benefits of Thin.

The performance improvements can be significant with increases up to 25% for requests/s and around 15% less memory used,  although the speed is dwarfed by the time spent in Rails.
Since 0.6.1 version in January Thin supports listening to UNIX sockets as well as to TCP/IP sockets, making it even faster.




Images by Marc-André Cournoyer

Thin already supports most Ruby Web Frameworks Rails, Merb, Camping, Sinatra, Ramaze, Vintage, Swiftiply.
Thin is a 3 months old project and it is worth a try before a production release is out.

4 comments

Reply

Testing with Thin looks good by Robert Dempsey Posted Feb 25, 2008 12:38 PM
Lighttpd by Wang Jianzhi Posted Feb 26, 2008 8:52 AM
Re: Lighttpd by Kirk Haines Posted Feb 27, 2008 12:46 PM
Running Thin on my server by John Griffiths Posted Mar 3, 2008 11:58 AM
  1. Back to top

    Testing with Thin looks good

    Feb 25, 2008 12:38 PM by Robert Dempsey

    We have been testing Thin using CentOS 5.1, Ruby 1.8.6, Rails 2.0.2, Nginx, and Thin. So far, we are seeing faster response times inline with the graphs presented by Marc-Andre. Very cool stuff.

  2. Back to top

    Lighttpd

    Feb 26, 2008 8:52 AM by Wang Jianzhi

    Does Thin run faster than Lighttpd+Fcgi?

  3. Back to top

    Re: Lighttpd

    Feb 27, 2008 12:46 PM by Kirk Haines

    Since nobody else has answered.... Maybe. You really need to benchmark your application on your hardware to know for sure, but given that regular threaded Mongrel can be in the ballpark with lighttpd+fcgi in some deployments, faster solutions like evented_mongrel or Thin should be in the ballpark and competetive with fcgi in many deployments.

  4. Back to top

    Running Thin on my server

    Mar 3, 2008 11:58 AM by John Griffiths

    I had a play with THIN last week and so far have been pretty impressed about it's performance, much faster than mongrel and a lot less memory cost. Wrote 2 articles on getting it installed which you can find on my blog... http://www.red91.com My setup is nginx, rails 2.0.2, ruby 1.8.6, mysql 5, Ubuntu 7.10 and of course THIN. so far pretty sweet.

Exclusive Content

Rustan Leino and Mike Barnett on Spec#

Rustan Leino and Mike Barnett of Microsoft Research discuss the technology in Spec# and its futures.

10 Ways to Screw Up with Scrum and XP

Henrik Kniberg talks about 10 possible reasons to fail while doing Scrum and XP. Maybe the team does not have a definition of what Done means to them, or they don't know what their velocity is.

Tips from a Top Sports Team Coach

This article outlines 9 principles Marc Lammers discovered while building the world’s best field hockey team, mapping them to software development practices.

SOA Governance: An Enterprise View

Michael Poulin explains the necessity for SOA governance to ensure an Enterprise SOA's success, relying on concepts from the OASIS SOA Reference Model and Reference Architecture.

Developing Portlets using JSF, Ajax, and Seam (Part 2 of 3)

This article covers setting up a RichFaces portlet using JBoss Portlet Container and JBoss Portlet Bridge, deploying a RichFaces portlet, and RichFaces capabilities.

Scalability Worst Practices

This article discusses scalability worst pratices including The Golden Hammer, Resource Abuse, Big Ball of Mud, Dependency Management, Timeouts, Hero Pattern, Not Automating, and Monitoring.

Do the Hustle

Obie Fernandez shares his experience selling consulting services for both Thoughtworks and Hashrocket and give tips how Ruby developers can work with clients.

Natural Laws of Software Development - Deriving Agile Practices

Jeffries and Hendrickson derive Agile practices from the natural laws of software development. They don't just say "Be Agile!", but they explain why Agile practices make perfect sense.