lots of futex_wait calls

André Malo auch-ich-m at g-kein-spam.com
Fri Jun 6 19:03:23 CEST 2008


skunkwerk wrote:

> I've got a python program written for the django web framework that
> starts about 100 threads.  When I start the server, it sometimes eats
> up 100% of the CPU for a good minute or so... though none of the
> threads are CPU-intensive
> 
> doing a strace on the program, i found lots of calls like this:
> 
> select(5, [4], [], [], {1, 0}) = 0 (Timeout)
> futex(0x86a3ce0, FUTEX_WAIT, 0, NULL) = 0
> 
> i've read the man page for futex... but is this normal?

More or less. Most of the futex calls (if not all) are grabbing or releasing
the global interpreter lock (GIL).

It's usually helpful to increase the thread-schedule-checkinterval in order
to lessen the system load (especially the number of context switches). See
sys.setcheckinterval.

nd



More information about the Python-list mailing list