Ruby Inside で紹介されていた Thin に関するメモ。(なんだけど、試していないので実態は不明。)
Thin actually relies on Mongrel, but is ultimately faster than it, even against Mongrel's EventMachine-enhanced guise.
とのこと。公式サイトの about を読むと、Mongrel のパーサを使っているので、Mongrel の速さとセキュリティを受け継ぎ、EventMachine を使っているから、安定していてスケーラブル。そして、Rack 対応なので既存アプリも簡単に移行できるということらしい。
上記のブログのコメントからいくつか抜粋。
Does Thin run multiple Rails processes? Or do you still need to put it behind a load balancing proxy like you do with Mongrel? (like this config: http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/)
に答えて、
Thin is exacly like Mongrel on that side, you’ll need multiple Rails processes for a web site with some traffic.
You should probably also check out Rev (http://rev.rubyforge.org) which is a light simple binding around libev (not libevent) and works only in Ruby 1.9. Tony is building a very nice API for it that you can use, and libev is very fast and small.
これは Zed Shaw のコメント。libev はこれか。
How long, you think, before it can be used on a production server?
への回答。
A better reply would be: you tell me! If you feel like it, deploy an app using it and let me know if it works for you.
そら、そうだw
(Ruby はあんまりスケールしない(しなかった)って議論があるんだけど、その点はどうなの?って質問に答えて。)
Ruby had some problems in the past with threads, Mongrel helped fixing those bugs in Ruby’s core but still, Ruby threads are not native (don’t use OS processes, so can’t take advantage of multicore processors). And threading is not the most scalable way of handle huge loads. Event-driven I/O can handle more requests and uses only one thread.
"Event-driven I/O can handle more requests and uses only one thread." について関連情報を検索してみた。
Cool, now where’s the info on how to replace my mongrel clusters with thin clusters?
here’s a rake task to start and stop a cluster:
http://groups.google.com/group/thin-ruby/browse_thread/thread/a639d1e20a1b0d75
豆知識として、現状、Thin で検索かけてもさっぱり目的の情報は見つからないので、"gem install thin"あたりで検索するのがオススメ。