libc_r is deprecated

David Xu davidxu at freebsd.org
Wed Oct 26 18:05:32 PDT 2005


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 




More information about the freebsd-arch mailing list