I’ve done some benchmarking on our new servers (being built now), AMD X2
5600, gentoo-hardened.
With the same CFLAGS (safe cflags: -march=k8 -O2) I’ve tested the
following
configs:
1, emerge ruby rubygems, then gem install mongrel (or emerge mongrel,
the
performance was similar)
2, download the same ruby version, untar, ./configure, make, make
install,
download rubygems, install it, then gem install mongrel
the test script: a simple mongrel handler which writes “hello world” in
its
“process” method
the benchmarking suite: ab2 -n 10000 -c 10 http://localhost:800/test
for the pure gentoo branch I got at max. 700 req/s
for the 2nd test case it’s around 2400 req/s
Having the same CFLAGS for both builds, the only thing I can think of is
that some gentoo patches
are responsible for this.
On Thu, 22 Nov 2007 11:20:37 +0100
“Csaba O.” [email protected] wrote:
Hi,
Having the same CFLAGS for both builds, the only thing I can think of is
that some gentoo patches
are responsible for this.
Check to see if they’ve got the pthreads turned on in their build,
rather than a patch. It’d be an option to ./configure that enables it,
and that usually makes Ruby crawl.
Just to be clear you want pthreads turned off so USE=’-threads’ or
the equivalent. I dont recall if the default ebuild uses pthreads or
not but you definitely want to turn them off.
Definitely, but… you may need it on, if you use an extension that
itself relies on pthreads. Which is why Redhat has Ruby compiled with
pthreads.
By the way, what kind of performance penalty has anyone seen from
pthreads in a real app?
The only thing that ruby uses pthreads for is if you use tk afaik. I
did some benchmarks on gentoo with pthreads enabled and disabled and a
rails app performs a serious 25% or more faster with pthreads
disabled. A very real difference.