huge number of context switches under 2.2.x with SMP & threaded apps

From: bert hubert (
Date: Tue Jul 17 2001 - 18:13:29 EST

A threads related question - I have a nameserver with 8 active threads,
which in turn leads to 6 (in this case) MySQL connections. When
stresstesting this nameserver, we see a *huge* number of context switches.
50.000 has been observered. When raising this to ~50 active threads and ~50
MySQL connections we've seen 100.000 context switches/second. Performance

This is a RedHat 6.2 system with a 2.2.16 kernel, 2*PIII, 900MHz.

I saw some mention of this problem on the MySQL site with regards to
processes holding a pthread_mutex_lock() for short amounts of time. They
advise to use 2.4 but right now that is not within the scope of my options.

My question: is there a 2.2 kernel in which this is resolved? And secondly,
is there a way to prevent this problem purely from userspace? In other
words, what causes this problem.

The MySQL site also mentions that 2.4 could do better in some ways,
especially regarding 'overspin'.

Thanks for your time.

--      Versatile DNS Services  
Trilab                       The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:09 EST