Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 10:44:32 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        Marcel de Vries <mdevries@haveityourway.nl>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: network buffer problem -/- natd
Message-ID:  <20020219104432.A31233@iguana.icir.org>
In-Reply-To: <5.1.0.14.2.20020219192110.01f45e48@outshine>
References:  <5.1.0.14.2.20020219154939.00bb52d8@outshine> <5.1.0.14.2.20020219192110.01f45e48@outshine>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020219104432.A31233>