Showing posts with label mongrel. Show all posts
Showing posts with label mongrel. Show all posts

Thursday, March 12, 2009

rails on opensolaris vs. rails on linux benchmarks

open solaris rocks (really), i'm using it as a developer on desktop and its great. i wanted to see how its performance is compared agains linux. so here we go...

i made a simple web site with rails, it just serves a web page and sends a query to mysql and shows it - just a simple web application-. i ran all benchmarks from a local networked ubuntu, so benchmarking should not be effecting performance. i ran each benchmark 3 times - to warm it up - and then ran again 3 times, these numbers are last three runs.

i used ruby, mysql from ips stack. i did same tests with thin and mongrel.

first i ran test with 1 process, and then i used nginx to reverse proxy to 4 processes. then i rebooted the machine, and started over in ubuntu 8.10. ruby/mysql/nginx was installed by synaptics - ruby version differs btw, ubuntu comes with ruby 1.8.7 installed and opens solaris (2008.11) comes with ruby 1.8.6.

so as long as the machine is identical - its the same laptop - these numbers may give you a clue.

i am using zones in solaris, first i ran only one thin process, and benchmarked with ab.

ab -n 1000 -c 100 http://192.168.1.209:9690/chat/
single process - thin
Requests per second: 172.14 [#/sec] (mean)
Requests per second: 187.11 [#/sec] (mean)
Requests per second: 178.25 [#/sec] (mean)

and then i thought if i do this in global zone what will change...

Requests per second: 188.44 [#/sec] (mean)
Requests per second: 188.57 [#/sec] (mean)
Requests per second: 173.15 [#/sec] (mean)


there was not much difference, so zones are really lightweight. so i didnt repeat the tests in global zone.

anyway, 4 thin process, upstreamed from nginx


Requests per second: 229.80 [#/sec] (mean)
Requests per second: 249.45 [#/sec] (mean)
Requests per second: 267.92 [#/sec] (mean)


now i wanted to see how mongrel is compared to thin on solaris.

mongrel 1 process

Requests per second: 126.04 [#/sec] (mean)
Requests per second: 121.87 [#/sec] (mean)
Requests per second: 119.53 [#/sec] (mean)


and mongrel 4 process on opensolaris

Requests per second: 182.07 [#/sec] (mean)
Requests per second: 177.18 [#/sec] (mean)
Requests per second: 176.31 [#/sec] (mean)


then i rebooted the machine into ubuntu and started again

thin 1 process

Requests per second: 253.94 [#/sec] (mean)
Requests per second: 242.28 [#/sec] (mean)
Requests per second: 246.67 [#/sec] (mean)

thin 4 process upstreamed by nginx on linux

Requests per second: 336.30 [#/sec] (mean)
Requests per second: 326.03 [#/sec] (mean)
Requests per second: 320.67 [#/sec] (mean)

mongrel 1 process

Requests per second: 196.33 [#/sec] (mean)
Requests per second: 196.13 [#/sec] (mean)
Requests per second: 198.44 [#/sec] (mean)

mongrel 4 process upstreamed by nginx

Requests per second: 238.31 [#/sec] (mean)
Requests per second: 244.72 [#/sec] (mean)
Requests per second: 233.49 [#/sec] (mean)


so here are the graphs


thin 1 process linux vs. open solaris



thin 4 process linux vs. open solaris


mongrel 1 process


mongrel 4 process



here is the configuration in two operating system
ubuntu linux (8.10)
uname -a :
Linux aybars-laptop 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64 GNU/Linux
ruby :
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
mysql :
mysql Ver 14.12 Distrib 5.0.67, for debian-linux-gnu (x86_64) using readline 5.2
gems :
thin (1.0.0)
eventmachine (0.12.6)
ventmachine (0.12.6, 0.12.2)
mongrel (1.1.5)
Rails 2.1.1

open solaris (2008.11)
uname -a :
SunOS opensolaris 5.11 snv_101b i86pc i386 i86pc Solaris
mysql:
mysql Ver 14.12 Distrib 5.0.67, for pc-solaris2.11 (i386) using readline 5.1
ruby:
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-solaris2.11]
gems:
thin (1.0.0)
mongrel (1.1.5)
eventmachine (0.12.6)
mongrel (1.1.5)
rails (2.1.1)

in conclusion, i have several opinions about this results
1. zones are really lightweight and great
2. two operating systems are installed from stack - no optimization, no hand compiling etc.. so if you install just inserting a cd and boot then ubuntu beats hard. maybe its just because of ruby version or something with flags used to compile ruby, but i guess an operating system is not just the kernel, the components must be optimized and as new as possible.
3. i really am curious why the hell my kernel reports as i386 on solaris, shouldn't it be x86_64 or similar. it didn't ask me about anything, and there is only one iso.

anyway stack version of both systems, ubuntu default installation beats hard open solaris, so i think i will stick to my ubuntus on our servers.

and btw, please take this benchmarks just, as out of the box experience, none of them are optimized.