Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2005 09:05:42 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        Marc Olzheim <marcolz@stack.nl>, Daniel Eischen <deischen@freebsd.org>, arch@freebsd.org
Subject:   Re: libc_r is deprecated
Message-ID:  <436027E6.8080604@freebsd.org>
In-Reply-To: <20051026120219.V32255@fledge.watson.org>
References:  <Pine.GSO.4.43.0510241948130.17636-100000@sea.ntplx.net>	<20051025120538.K52058@fledge.watson.org>	<435E2DCF.6080809@freebsd.org>	<20051025134834.GB62148@stack.nl> <435EBD49.7090207@freebsd.org> <20051026120219.V32255@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:

> ...
> I'll try to set up and run Apache2 with various configurations as a 
> substitute for the performance measurement httpd I have in 
> src/tools/tools/netrate, and see how its mpms interact with our 
> threading implementations.
>
> My increasing suspicion is that the performance issue for threads is 
> heavy access to the file descriptor related locks, resulting in 
> significant contention.  I need to look at traces and profiling some 
> more to decide which are the biggest problems, and whether there are 
> useful ways to improve them that help.  In the libthr vs. libpthread 
> measurements, it could well be that libpthread reduces kernel lock 
> contention by allowing a thread to compete less with itself for locks: 
> i.e., it introduces additional kernel threads only when blocked on a 
> real sleep, not a mutex wait, whereas with libthr, threads will yield 
> to each other on a CPU as they sleep on mutexes, resulting in more 
> mutex contention.  This is just a conjecture, however.
>
You sample program is nothing to do with libpthread or libthr, you never 
have userland
locking code, in kernel they should be same, in fact. I have done a 
simple test, on my
dual PIII machine, libthr is faster than libpthread, if I use ULE, 
libpthread is far behind
than libthr, I recommend you to try different file sizes, I have got 
very different result, for
small file size, e.g /usr/src/sys/sys/umtx.h, libthr beats libpthread,  
I can not test big file,
because my 100M network is very easy to be saturated.

If you suspect fd locking overhead, try to use fork() model, though it 
will introduce more
context switch overhead, but it still worthy to do.

> Robert N M Watson 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?436027E6.8080604>