On 3/3/06 10:09 PM, “DDudde” email@example.com wrote:
I currently have a fairly simple Rails application running on FreeBSD
under Apache 1.3 and normal CGI, and the performance I’m getting is
alarmingly poor. I realize CGI or WebBrick are quite a bit slower than
FastCGI, and I’ll probably use one of those instead when I have the
time. However, I’m just curious if CGI is really supposed to be that
slow, or if there’s something wrong with my configuration.
I’m actually seeing similar performance issues on FreeBSD 6.0 with the
latest Ruby 1.8.4 and Rails. I find that Mongrel screams on Linux,
and NetBSD, but on FreeBSD or OSX it crawls. It’s still faster than
WEBrick, but not nearly as fast as it should be. It’s actually so bad
I installed FreeBSD on my laptop just so I could debug the problem once
As a comparison, I have 1/16th VPS donated to me by the railsmachine.net
people, which runs Linux. My tests on this VPS show Mongrel doing a
“test” controller at around 120 req/sec (70 low end). Over on my
laptop–which is a full computer with a 1.6ghz processor–the exact same
code gets a pathetic 20 req/sec. WEBrick gets 8 req/sec.
There’s just no way that FreeBSD–one of the fastest server OS out
really getting 1/6th the performance of a literal slice of a Linux
OSX also has similar crap performance for some odd reason.
My current theory–after not much review–is that OSX and FreeBSD set
default select fd limit to 256 so Ruby isn’t able to keep up with a
load. But I’ve got no evidence to back this up.
At present any request to the server (i.e. page refresh) takes 2 or 3
seconds. Again, I’m talking about a decent server on a Gigabit local
area network. Also the PHP web sites I run on this very same server are
instantaneous, so the server couldn’t be the problem. But anything I’ve
tried with Rails is incredibly slow.
CGI is going to be insanely and horribly slow. The only people who use
are the desperate ones. Give Mongrel a try (pimptastic plug from me) or
take the time to setup lighttpd and fastcgi.
But yeah, I’m seeing the same kind of slow performance from Rails
applications on FreeBSD.
Zed A. Shaw