Date: Sat, 31 May 1997 14:05:27 +0200 (MET DST) From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Cc: julian@whistle.com, julian@alpo.whistle.com, hackers@FreeBSD.ORG Subject: Re: WHy does Appache eat my system? Message-ID: <199705311205.OAA22027@labinfo.iet.unipi.it> In-Reply-To: <199705310657.IAA21744@labinfo.iet.unipi.it> from "Luigi Rizzo" at May 31, 97 08:57:09 am
next in thread | previous in thread | raw e-mail | index | archive | help
> 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/ _____________________________|______________________________________
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705311205.OAA22027>