From owner-freebsd-hackers Sat May 31 05:39:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA22090 for hackers-outgoing; Sat, 31 May 1997 05:39:27 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id FAA22085 for ; Sat, 31 May 1997 05:39:21 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id OAA22027; Sat, 31 May 1997 14:05:27 +0200 From: Luigi Rizzo Message-Id: <199705311205.OAA22027@labinfo.iet.unipi.it> Subject: Re: WHy does Appache eat my system? To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Sat, 31 May 1997 14:05:27 +0200 (MET DST) Cc: julian@whistle.com, julian@alpo.whistle.com, hackers@FreeBSD.ORG In-Reply-To: <199705310657.IAA21744@labinfo.iet.unipi.it> from "Luigi Rizzo" at May 31, 97 08:57:09 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > The best one can do is (probably) to implement a modified select() > which only wakes up the first process blocked (hoping it will be able > to complete the accept() successfully). Maybe this is not too hard, but > it is non-standard. After looking at /sys/kern/kern_synch.c , I think the modified select I suggest is quite difficult to implement without major changes to the kernel. First of all, all processes doing a select do a tsleep on the same wchan, &selwait. Secondly, the identifier used in tsleep/wakeup is actually hashed and collisions might occur. Since the hash table is relatively small (128 entries) collisions are not that unlikely. For both reasons, waking up only one process with a wakeup might likely fail to get up the correct one. I think it would be nice to have a more effective mechanism to implement multiple servers on the same port (the problem is the same for httpd, nfsiod and probably others) but that needs a careful design first. Cheers Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________