connection speed (Rails performance)

Mage mage at mage.hu
Mon Dec 12 22:07:48 UTC 2011


             Hello,


it is my second attempt to switch from Gentoo to FreeBSD because:

- if you google for FreeBSD you get sexy images of girls in red wear 
(turn safe search off)
- I am a bit tired to upgrade my hardened servers
- zfs supposed to work better and faster

However I'am stuck at the same issue where I gave up half year ago.

After setting up Ruby on Rails 3 (with rvm), Apache22 and Postgres, I 
ran some apache benchmarks and figured out that while FreeBSD wins at 
slow pages, at faster pages FreeBSD (for me) is way slower than Gentoo.

A dynamic page:

Gentoo:
# ab -n 1000 -c 12 http://randi7/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Requests per second:    169.88 [#/sec] (mean)

FreeBSD:
# ab -n 1000 -c 12 http://randi7/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Requests per second:    59.31 [#/sec] (mean)


A static page:
$ echo hello > public/index.html

Gentoo:
# ab -n 1000 -c 12 http://randi7/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Requests per second:    25047.59 [#/sec] (mean)


FreeBSD:
# ab -n 1000 -c 12 http://randi7/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Requests per second:    6160.29 [#/sec] (mean)


The faster the page is generated the bigger the difference is in 
requests per seconds.

I experienced the very same results half year ago at my first attemp to 
migrate to FreeBSD. All tests were done with more or less current 
kernels (both systems). This is a totally fresh install on a different 
computer.

Half year ago I tried all of apache, thin, mongrel, nginx and the 
outcome was same. I guess it might be something with the connection but 
I don't know what. Of course all tests were ran on localhosts.

How could I improve this?

         Mage


More information about the freebsd-questions mailing list