From owner-freebsd-hackers Sat May 18 22:15:58 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id 42EA837B408 for ; Sat, 18 May 2002 22:15:47 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4J5Fk118502 for ; Sat, 18 May 2002 22:15:47 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id A1FC539F9; Sat, 18 May 2002 22:15:46 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Hiten Pandya Cc: Doug White , Omar Thameen , freebsd-hackers@FreeBSD.ORG Subject: Re: tuning a CPU bound server In-Reply-To: <20020516230902.A398@hpdi.ath.cx> Date: Sat, 18 May 2002 22:15:46 -0700 From: Peter Wemm Message-Id: <20020519051546.A1FC539F9@overcee.wemm.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hiten Pandya wrote: > --- Peter Wemm wrote: > > The only real problem that I know of with postfix is that it still > > suffers from select(2) collisions (FreeBSD kernel problem) when it tries > > to shut down a bunch of idle smtp senders. That can cause transient load > > average spikes - this can be a bit alarming but doesn't actually affect > > things very much. > > Just wondering, are these the kind of problems which can be solved by > using the kqueue(2) mechanism, or am I talking nuts again? > > Regards. Yes, kqueue solves it nicely. I overestimated the work required. In fact, it looks like it would be quite easy to do. There are three places that need work. src/util/events.c (the main event loop, keeps a persistent select mast) src/util/readable.c (quick select-until-readable) src/util/writable.c (quick select-until-writable) events.c is practically begging to be converted to kqueue as it has explicit init/register/unregister/loop type operation that allows callers to register/unregister callbacks for given fd's when they become readable or writable. This is the exact scenario that kqueue is ideal for. The other two are not heavily used and could quickly whip up their own mini kqueue for the task. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message