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
Ruby on Rails ,
Mongrel
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.
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.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.