Mongrel 生まれの高速(らしい) Web サーバ Thin に関するメモ。

by tanabe on January 06, 2008

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:


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


(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:

豆知識として、現状、Thin で検索かけてもさっぱり目的の情報は見つからないので、"gem install thin"あたりで検索するのがオススメ。