From owner-freebsd-net Mon Feb 11 12:12:20 2002 Delivered-To: freebsd-net@freebsd.org Received: from patrocles.silby.com (d188.as6.nwbl0.wi.voyager.net [169.207.130.62]) by hub.freebsd.org (Postfix) with ESMTP id E0FB137B405 for ; Mon, 11 Feb 2002 12:12:16 -0800 (PST) Received: from localhost (silby@localhost) by patrocles.silby.com (8.11.6/8.11.6) with ESMTP id g1BEFxq85306; Mon, 11 Feb 2002 14:16:00 GMT (envelope-from silby@silby.com) X-Authentication-Warning: patrocles.silby.com: silby owned process doing -bs Date: Mon, 11 Feb 2002 14:15:59 +0000 (GMT) From: Mike Silbersack To: Alfred Perlstein Cc: Tariq Rashid , Subject: Re: squeeze more performance out of natd? In-Reply-To: <20020211112645.F63886@elvis.mu.org> Message-ID: <20020211140933.Y84750-100000@patrocles.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 11 Feb 2002, Alfred Perlstein wrote: > * Mike Silbersack [020211 11:05] wrote: > > The best way to improve performance would probably be to rewrite natd to > > use kqueue instead of select. I'm not sure how difficult this would be, > > you might wish to talk to jlemon if you have any questions on the best way > > to tackle the project. > > That's what I thought initially, however the problem is that each > packet requires at least a select(2) then recvfrom(2) and then possibly > a sendto(2). The select(2) loop is particulary niave as the dispatched > functions will only pull one packet from the socket instead of looping > until the outstanding data is removed. > > Yes, > another way would be to loop doing recvfrom's until EAGAIN is returned, > I suspect this may give at least a 2 fold increase in performance and > is trivial to accomplish. Wow. Yeah, it sounds like that change would make more of a difference than moving away from select(). Tell us how it works, Tariq. :) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message