Re: Buffering Sockets

From: Nick Landsberg (
Date: 07/07/04

Date: Wed, 07 Jul 2004 11:49:43 GMT

Richard wrote:
> wrote...
>>Based on some measurements taken many years ago on a 400 MHZ
>>processor, the overhead for TCP/IP can be approximated by
>>100 usec per packet + 100 usec per kilobyte.
>>At small buffer sizes this goes way off scale since the 100 usec
>>per packet tends to dominate. (i.e. don't send 1 byte packets!
>>It's even worse than that, but I won't go into the details.)
>>I have found that this scales with processor speed, but YMMV.
> That's good data. You don't have a reference for the original
> measurements, do you -- and or, what the scaling function (curve) is
> for processor speed (logrithmic, linear, etc.) ?

Nope, no public reference. I did the work about 6 years
ago paritally to see what additional overhead our in-house
wrapper functions were adding. Every once in a while
I run a few ad-hoc tests when I switch projects and the
results appear to scale linearly with CPU speed. But,
I've never actually repeated that first controlled experiment.

Also note that these numbers are dwarfed by the
overhead of setting up the socket connection in
the first place. Ever since that experiment,
I try to set up all connections at startup and
keep them open as long as possible to avoid
that overhead (which was about 15 milliseconds
back then).

"It is impossible to make anything foolproof
because fools are so ingenious"
  - A. Bloch