Fine grain select locking.

Robert Watson rwatson at
Fri Aug 3 07:18:08 UTC 2007

On Thu, 2 Aug 2007, Jeff Roberson wrote:

> I hope we can hash out a good plan to resolve this for 8.0.  filedesc and 
> lockmgr are the biggest hitters on mysql writes.  I suspect this is also the 
> case for pgsql and likely other network server type programs.

Actually, I'd scope this claim a bit -- it's certainly going to be an issue 
for MySQL and any *threaded* network server type programs.  As process based 
parallelism doesn't share the file descriptor table, it shouldn't affect 
non-threaded workloads such as Apache and pgSQL.  This is one of the 
interesting contradictions with threads -- developers are taught that they are 
lightweight, and they are in the sense that they cost less to have many of and 
support very easy IPC, but they are also more likely to contend kernel locks 
as they involve more shared data structures being referenced.  In contrast, 
process-driven parallelism allows a much higher level of independence between 
executing threads of control, allowing IPC to be explicit rather than 
continuous.  Anything that reduces the overhead of filedesc locking will 
improve the performance of all apps, but reducing the contention on filedesc 
will only help applications sharing the file descriptor array between many 

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the freebsd-arch mailing list