Mongrel 0.3.11 - speed test ... seems slow


#1

I did some basic speed test on my rails application. I use Centrino
1.7GHz, WinXP.
For simple test I used Apache 'ab -n 100 -c 10 http://url… ’

Running Mongrel 0.3.11 I got:
development env. = 4.5 req./sec
production env. = 11.5 req./sec

Running Webrick I got:
development env. = 5.7 req./sec
production env. =25.9 req./sec

Does anyone know why the webrick is still faster? Mongrel runs without
problem but quite slow. Cant see any advantage to webrick.

David M.

PS: I run rails edge, Ruby 1.8.4


#2

David M. wrote:

production env. =25.9 req./sec

Does anyone know why the webrick is still faster? Mongrel runs without
problem but quite slow. Cant see any advantage to webrick.

Mongrel serializes all requests because Rails isn’t thread safe. Webrick
doesn’t have this knowledge. Try hitting them with only one thread (and
post those results here also please :-)).

Find “Rails” in the Mongrel FAQ: http://mongrel.rubyforge.org/faq.html

Br,

Morten


#3

Morten,

It is true that Mongrel locks the requests to Rails but I believe that
WEBrick does something similar. If it didn’t then nobody could run in
production at all.

Zed A. Shaw


#4

I have updated the tests and ran it once again for both: Mongrel and
Webrick. The page I’m accessing in test has no connection from database,
so there is not other bottleneck except of rails itself. Not sure why
the results are a bit different from what I seen yesterday, but now the
speed simillar at least. I did each test 3x for each server and the
value is the average.

Test1: 'ab -n 500 -c 1 http://url… ’

Running Mongrel 0.3.11 I got:
production env. = 32.7 req./sec

Running Webrick I got:
production env. =28.2 req./sec

Test2: 'ab -n 500 -c 10 http://url… ’

Running Mongrel 0.3.11 I got:
production env. = 18.5 req./sec

Running Webrick I got:
production env. = 13.4 req./sec


#5

Hey David,

Interesting results, I’ll have to check it. The 0.3.11 release is
mostly to
get everything working right now on win32, with uber-tweaking coming
soon.
It’s possible I slipped something in that is causing this.

Zed