2006-06-08 優しいRailsの育て方 [長年日記]

[Rails] 運用サーバ速度比較

  • Pentium III(733MHz) Dual
  • Ruby-1.8.4 (2005-12-24)
  • Lighttpd-1.4.11
  • Mongrel-0.3.12.4
  • WEBrick-1.12
  • Apache2-2.0.55
  • LiteSpeed-2.1.16 Standard

ベンチ1: Rails アプリケーション

benchmark.png

[Railsアプリ]

コントローラ

class BenchController < ApplicationController
  def index
    render :text=>"maiha"
  end
end
  • production mode
  • config.frameworks -= [ :action_web_service, :action_mailer, :active_record ]

[apache2 の proxy の設定]

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass        /bench/ http://127.0.0.1:3000/bench/
ProxyPassReverse /bench/ http://127.0.0.1:3000/bench/

[計測方法]

% ab -n 100 http://localhost:3000/bench/

ベンチ2: tDiary (2006/06/01〜2006/06/07のデータ)

benchmark2.png

まとめ

  • LiteSpeed + LSAPI(ruby-dispatch) が生 Lighttpd と同程度であることに驚いた。(無菌状態での精密なベンチではないので全体的に10%程度の誤差はありえる)
  • Apache2 の proxy は全般的にオーバーヘッドが少ないが、LiteSpeed は Mongrel 以外のサーバとはなぜか相性が悪い。(LiteSpeed proxy は Mongrel 一択で)
  • WEBrickが思ったほど遅くなかった。(今回は逐次アクセスで測定したので、並行処理の場合はまた違う結果になるのかも)
  • ruby-runner を利用することで既存の Ruby CGIアプリが全て高速化されるのは嬉しい。(tDiary で3倍)
  • 結局、高々5倍程度の差と思えば好きな鯖でよい。(生CGI だけはダメ、絶対)
本日のツッコミ(全2件) [ツッコミを入れる]
_ ma2 (2006-06-09 12:42)

ab の -c オプションを使えば並行処理のケースも測定できますね。完全なパラレルにはならないとは思いますが。

_ ma2 (2006-06-09 12:43)

あ,言い忘れていた。<br>舞波 乙!


サイト内検索 (by Google)

| JRuby | Rails | Berryz | ℃-ute | エッグ | jQuery |

過去

2006年
6月
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

未来

コンタクト