Gentoo warning

Hi,

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.

Just for the record :slight_smile:

With regards,
Ochronus

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.


Zed A. Shaw

Hey

You need to set the USE flag ‘threads’ to add pthread support to ruby.

Ben

On 2007-11-22, at 18:53, Zed A. Shaw wrote:

Check to see if they’ve got the pthreads turned on in their build,
Mongrel-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/mongrel-users

Gruss
Ben

Benjamin K.

[email protected]

Rails-Schulung “Advancing with Rails” mit David A. Black
19.11.-22.11.2007, Berlin-Mitte
Details u. Anmeldung: http://www.railsschulung.de

On Nov 22, 2007 5:00 PM, Ezra Z. [email protected] wrote:

but you definitely want to turn [pthreads] 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?


Alexey V.
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]

Hi~

On Nov 22, 2007, at 2:47 PM, Benjamin K. wrote:

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.

Cheers-
-Ezra

On Nov 22, 2007 8:18 PM, Ezra Z. [email protected] wrote:

The only thing that ruby uses pthreads for is if you use tk afaik.
Where I hit that particular wall was Oracle driver.

a serious 25% or more faster with pthreads disabled. A very real difference.
Yeah, that’s what I get on the “petstore benchmark”, too.


Alexey V.
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]

On Nov 22, 2007, at 4:33 PM, Alexey V. wrote:

On Nov 22, 2007 5:00 PM, Ezra Z. [email protected] wrote:

but you definitely want to turn [pthreads] 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.

Cheers-
-Ezra

Hi,

You were right, the “threads” USE flag was set.
Thanks for the heads up!

Regards,
Csaba