Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2008 22:56:19 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        FreeBSD Net <freebsd-net@FreeBSD.org>, Andre Oppermann <andre@FreeBSD.org>, Ingo Flaschberger <if@xip.at>, Paul <paul@gtcomm.net>
Subject:   Re: Freebsd IP Forwarding performance (question, and some info) [7-stable, current, em, smp]
Message-ID:  <20080707224659.B7844@besplex.bde.org>
In-Reply-To: <20080707134036.S63144@fledge.watson.org>
References:  <4867420D.7090406@gtcomm.net> <4869ACFC.5020205@gtcomm.net> <4869B025.9080006@gtcomm.net> <486A7E45.3030902@gtcomm.net> <486A8F24.5010000@gtcomm.net> <486A9A0E.6060308@elischer.org> <486B41D5.3060609@gtcomm.net> <alpine.LFD.1.10.0807021052041.557@filebunker.xip.at> <486B4F11.6040906@gtcomm.net> <alpine.LFD.1.10.0807021155280.557@filebunker.xip.at> <486BC7F5.5070604@gtcomm.net> <20080703160540.W6369@delplex.bde.org> <486C7F93.7010308@gtcomm.net> <20080703195521.O6973@delplex.bde.org> <486D35A0.4000302@gtcomm.net> <alpine.LFD.1.10.0807041106591.19613@filebunker.xip.at> <486DF1A3.9000409@gtcomm.net> <alpine.LFD.1.10.0807041303490.20760@filebunker.xip.at> <486E65E6.3060301@gtcomm.net> <alpine.LFD.1.10.0807052356130.2145@filebunker.xip.at> <4871DB8E.5070903@freebsd.org> <20080707191918.B4703@besplex.bde.org> <4871FB66.1060406@freebsd.org> <20080707213356.G7572@besplex.bde.org> <20080707134036.S63144@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 7 Jul 2008, Robert Watson wrote:

> Since you're doing fine-grained performance measurements of a code path that 
> interests me a lot, could you compare the cost per-send on UDP for the 
> following four cases:
>
> (1) sendto() to a specific address and port on a socket that has been bound 
> to
>    INADDR_ANY and a specific port.
>
> (2) sendto() on a specific address and port on a socket that has been bound 
> to
>    a specific IP address (not INADDR_ANY) and a specific port.
>
> (3) send() on a socket that has been connect()'d to a specific IP address and
>    a specific port, and bound to INADDR_ANY and a specific port.
>
> (4) send() on a socket that has been connect()'d to a specific IP address
>    and a specific port, and bound to a specific IP address (not INADDR_ANY)
>    and a specific port.
>
> The last of these should really be quite a bit faster than the first of 
> these, but I'd be interested in seeing specific measurements for each if 
> that's possible!

Not sure if I understand networking well enough to set these up quickly.
Does netrate use one of (3) or (4) now?

I can tell you vaguely about old results for netrate (send()) vs ttcp
(sendto()).  send() is lighter weight of course, and this made a difference
of 10-20%, but after further tuning the difference became smaller, which
suggests that everything ends up waiting for something in common.

Now I can measure cache misses better and hope that a simple count of
cache misses will be a more reproducible indicator of significant
bottlenecks than pps.  I got nowhere trying to reduce instruction
counts, possibly because it would take avoiding 100's of instructions
to get the same benefit as avoiding a single cache miss.

Bruce



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