Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News Thin The Fast Ruby Web Server

Thin The Fast Ruby Web Server

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.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Testing with Thin looks good

    by Robert Dempsey,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    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.

  • Lighttpd

    by Jianzhi Wang,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Does Thin run faster than Lighttpd+Fcgi?

  • Re: Lighttpd

    by Kirk Haines,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Since nobody else has answered....


    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.

  • Running Thin on my server

    by John Griffiths,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    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...

    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.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.