Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Apr 1999 12:22:00 +0100
From:      Tony Finch <dot@dotat.at>
To:        smp@freebsd.org
Subject:   Re: concurrent select()s on listen socket broken under SMP 
Message-ID:  <E10VZMG-000700-00@fanf.noc.demon.net>
In-Reply-To: <199904090652.OAA23047@spinner.netplex.com.au>
References:  <199904090203.TAA14310@usr04.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm <peter@netplex.com.au> wrote:
>
>The original poster didn't mention what version of FreeBSD was in use. 
>3.1-RELEASE has this bug...  It's fixed in 4.0 and 3.1-STABLE (after
>26-feb-99).

It's an up-to-the-minute -STABLE box.

>The other serious problem is select collisions.  I'd strongly advise using
>a mutex so that only one process is ever in a select() for waiting for
>connections on a socket.  If two or more processes select() waiting for the
>listening socket to become readable, when it does - a select collision
>happens.  ie: *EVERY SINGLE PROCESS* that was asleep in select gets woken
>up, and runs, and scans it's select tables, and 99% go back to sleep. If
>you have a couple of hundred processes asleep in select(), this hits like a
>bomb going off.  You can get a spontanious load average jump from 0.2 to
>100+ in an instant, depending on when loadav() runs.

We only have a few processes select()ing on the listen socket. The
reason for doing this is to cope with certain situations when thttpd
takes longer than it should between select()s -- generating directory
listings in particular. I suppose we were playing fast-and-loose with
this cheapo parallelism and were lucky not to lose sooner.

>Select collisions are a well understood problem, and there is no cheap,
>easy, trivial fix that scales well.

Drat.

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E10VZMG-000700-00>