[ANN] Thin 0.5.1 LOLCAT released

Hey all,
Version 0.5.1 (codename LOLCAT) of the fastest Ruby server is out!
Thin is a Ruby web server that glues together 3 of the best Ruby
libraries in web history:

  • the Mongrel parser: the root of Mongrel speed and security
  • Event Machine: a network I/O library with extremely high scalability,
    performance and stability
  • Rack: a minimal interface between webservers and Ruby frameworks
    Which makes it, with all humility, the most secure, stable, fast and
    extensible Ruby web server
    bundled in an easy to use gem for your own pleasure.
    == What’s new?
    Even though Thin has been made public only 4 days ago, lots of things
    have happened since:
  • Ruby 1.9 compatibility
  • Better Rails adapter
  • Thin support included in Ramaze and Vintage frameworks (Thin can also
    run Rails, Camping, Merb and more)
  • Some bug fixes in header parsing
    And some amazing numbers:
    [~/projects/thin] ruby benchmark/simple.rb
    server request concurrency req/s failures
    =====================================================
    WEBrick 1000 1 389.31 0
    Mongrel 1000 1 1495.70 0
    EMongrel 1000 1 2070.35 0
    Thin 1000 1 2219.45 0
    WEBrick 1000 10 366.16 0
    Mongrel 1000 10 1501.02 0
    EMongrel 1000 10 2562.43 0
    Thin 1000 10 3129.64 0
    WEBrick 1000 100 ERROR
    Mongrel 1000 100 1500.82 0
    EMongrel 1000 100 3031.29 0
    Thin 1000 100 3372.49 0
    [~/projects/thin] ruby19 benchmark/simple.rb
    server request concurrency req/s failures
    =====================================================
    WEBrick 1000 1 506.33 0
    Mongrel 1000 1 1768.31 0
    Thin 1000 1 2528.11 0
    WEBrick 1000 10 461.66 0
    Mongrel 1000 10 1541.35 0
    Thin 1000 10 4003.19 0
    WEBrick 1000 100 ERROR
    Mongrel 1000 100 1313.19 0
    Thin 1000 100 4154.67 0
    == Get it!
    sudo gem install thin
    (Might take some time for the gem mirrors to be updated, try adding
    –source http://code.macournoyer.com to the command if it doesn’t work)
    == Contribute
    Thin is driven by an active community of passionate coders and
    benchmarkers. Please join us, contribute
    or share some ideas in Thin Google Group:
    http://groups.google.com/group/thin-ruby/topics
    Also on IRC: thin on freenode
    Thanks to all the people who contributed to Thin, EventMachine, Rack and
    Mongrel.
    Marc-Andre Cournoyer
    http://code.macournoyer.com/thin/

On Jan 7, 2008, at 10:09 PM, Marc-andre Marc wrote:

And some amazing numbers:
[~/projects/thin] ruby benchmark/simple.rb
server request concurrency req/s failures

Thin 1000 1 2219.45 0

Very cool. I just benchmarked (very crude localhost-only numbers) a
form page in Rails that hits a MySQL database. I would have expected
database and template rendering to be a far bigger factor, but here
are the numbers on my mbp (Ruby 1.8.6p111):

mongrel n=1000 c = 1 : 44.45
thin n=1000 c = 1 : 51.29
mongrel n=1000 c = 10 : 40.12
thin n=1000 c = 10 : 51.27
mongrel n=1000 c = 100 : 35.94
thin n=1000 c = 100 : 50.86

Now, I can’t serve as many pages as you can (2200+!), but 50r/s is
still over 4 million pages served per day. I’m sure with a “thin
cluster,” you can pretty much serve pages at will!

In article [email protected],
Marc-andre Marc [email protected] wrote:

  • Ruby 1.9 compatibility

Good!

  • Better Rails adapter

Is rails 1.2.6 compatible with 1.9 BTW or do I need to move on to
Rails2? My
main site is built with RadiantCMS and I’d like to move to 1.9… (yes I
understand it is development but I follow 1.9/trunk already anyway).

Is there IPv6 support for thin? I can run a plain mongrel server on ::1
but
thin seems to puke.

Thanks for thin!

On Jan 8, 2008, at 11:25 AM, Ollivier R. wrote:

Is rails 1.2.6 compatible with 1.9 BTW or do I need to move on to
Rails2? My
main site is built with RadiantCMS and I’d like to move to 1.9…
(yes I
understand it is development but I follow 1.9/trunk already anyway).

Rails is not 1.9 compatible at this moment, this is work in progress
in edge.

– fxn

Marc-andre Marc wrote:

http://code.macournoyer.com/thin/

Does your website use Thin?

I get a timeout…

@Steve: very nice! thx for benchmarking with Rails!

@Ollivier: like Xavier mentioned, Rails is not yet Ruby 1.9 compatible.
Rails core team working on this right now, but it’s gonna be in next
Rails version, better update now to Rails 2.
I ddin’t know about mongrel IPv6 support, I’ll give it a look, thx!

@Joachim: no the website is a set of static HTML pages hosted on
DreamHost

thx for the comments, glad you like my project!

Wow, I’m impressed with Thin performance :).

I noticed that .irbrc file is loaded and it’s loaded every request! Is
it intentionally? How to disable this behaviour?


Rados³aw Bu³at

http://radarek.jogger.pl - mój blog

In article [email protected],
Marc-andre Marc [email protected] wrote:

I ddin’t know about mongrel IPv6 support, I’ll give it a look, thx!

Thanks.

It is not critical per-se as I have an IPv6-enabled Apache in front of
mongrel/thin for URL filtering/rewriting anyway but it would be better
to keep
IPv6 support in, especially when mongrel has it.

In article [email protected],
Marc-andre Marc [email protected] wrote:

I ddin’t know about mongrel IPv6 support, I’ll give it a look, thx!

While I’m here, would you care to use the same options as mongrel? It
would
certainly help moving from one to the other (e.g. -a vs -o in thin).

I’d also argue that -c (chdir) is renamed to -C and use -c for
specifying a
config file (hmmm, thin does not support this…).

Radosław Bułat wrote:

I noticed that .irbrc file is loaded and it’s loaded every request! Is
it intentionally? How to disable this behaviour?

Very weird. I’ve tried raising an error in my .irbrc file to see if it’s
loaded and it’s not.

Are you using breakpointer or something like this. Seems like it can
cause this kind of error: http://dev.rubyonrails.org/ticket/803

What the content of your .irbrc file ?

Ollivier R. wrote:

While I’m here, would you care to use the same options as mongrel? It
would
certainly help moving from one to the other (e.g. -a vs -o in thin).

I’d also argue that -c (chdir) is renamed to -C and use -c for
specifying a
config file (hmmm, thin does not support this…).

Hey Ollivier,

Someone already mentioned this on Thin group:
http://groups.google.com/group/thin-ruby/browse_thread/thread/678862834040a4e1
it’s already on git and will be part of the next release

As for the -c, it already behaves like the mongrel_rails script:

mongrel_rails:
-c, --chdir PATH Change to dir before starting (will be
expanded)

thin:
-c, --chdir PATH Change to dir before starting

thx for using Thin!

On Jan 9, 2008 4:03 AM, Marc-andre Marc [email protected] wrote:

Very weird. I’ve tried raising an error in my .irbrc file to see if it’s
loaded and it’s not.

Are you using breakpointer or something like this. Seems like it can
cause this kind of error: http://dev.rubyonrails.org/ticket/803

What the content of your .irbrc file ?

I’ve checked and with rails running on mongrel there is the same
behaviour, so it seems that issue is related to rails, not thin. RoR
is strange sometimes…


Rados³aw Bu³at

http://radarek.jogger.pl - mój blog

On Jan 10, 2008, at 12:47 AM, Radosław Bułat wrote:

I’ve checked and with rails running on mongrel there is the same
behaviour, so it seems that issue is related to rails, not thin. RoR
is strange sometimes…

It may be related to this:

 http://groups.google.com/group/ruby-talk-google/browse_thread/thread/c6e459297da83e6d

– fxn