From owner-freebsd-net Tue Feb 19 10:44:41 2002 Delivered-To: freebsd-net@freebsd.org Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 5AF6537B416 for ; Tue, 19 Feb 2002 10:44:36 -0800 (PST) Received: (from rizzo@localhost) by iguana.icir.org (8.11.6/8.11.3) id g1JIiWb31529; Tue, 19 Feb 2002 10:44:32 -0800 (PST) (envelope-from rizzo) Date: Tue, 19 Feb 2002 10:44:32 -0800 From: Luigi Rizzo To: Marcel de Vries Cc: freebsd-net@FreeBSD.ORG Subject: Re: network buffer problem -/- natd Message-ID: <20020219104432.A31233@iguana.icir.org> References: <5.1.0.14.2.20020219154939.00bb52d8@outshine> <5.1.0.14.2.20020219192110.01f45e48@outshine> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20020219192110.01f45e48@outshine> User-Agent: Mutt/1.3.23i 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 Tue, Feb 19, 2002 at 07:24:09PM +0100, Marcel de Vries wrote: > After 4 hours of pinging and listening to a shoutcast stream natd rised to > his state of eating 34% proctime (top) > Connection timed out, did a restart of mpd and everything is running normal > agian. somewhat unrelated, but... why are you using both mpd and natd ? wouldn't mpd do the address translation same as ppp does ? Anyways the performance problem could be easily explained by a poor implementation of the session lookup in libalias -- e.g. resulting in heavy scanning of long lists for each received packet, or things like that. From the (almost non-existent) comments in the libalias code it is not immediate to understand what is the underlying data structure -- maybe a hash table followed by lists -- nor if there are variables that one could monitor to see how the lookup strategy works (e.g. number of entries, average depth of the lists, etc. > > - i'm not an expert but truss, strace and grof show that most of the time > >is spent in sendto() ... This is probably related to a problem in natd which was fixed by Ruslan not long ago in current, and did not make it in RELENG_4_5 (it is in -stable though). The bug was that natd looped around a select which would always return the socket as writable, and it would keep retrying a sendto() until successful. The fix is to drop the packet when sendto fails, and rely on retransmissions instead. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message