[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Determining bandwidth



On Sun, Oct 30, 2005 at 08:46:56AM -0500, Marc Abel wrote:
> If my log says
> 
> Oct 30 08:40:17.801 [notice] Average bandwidth: 9562004613/296511 =
> 32248 bytes/sec reading
> Oct 30 08:40:17.801 [notice] Average bandwidth: 10574671010/296511 =
> 35663 bytes/sec writing
> 
> do these figures represent bandwidth consumed, or useful bandwidth
> delivered?

It is a slight underestimate of the actual bandwidth used on the wire. The
reason for the discrepancy is overhead in the TLS protocol. When we send
x bytes, it gets broken up into records of at most 16 kB, with a small
header on each record that doesn't get counted in the above calculation.
(Of course, if our data transmission pattern doesn't provide easy chunks
of 16kB, then the header will be a larger proportion of the bandwidth as
the record size decreases.) Also, we don't count bytes used in the TLS
handshake phase. And lastly, TLS can request rekeying whenever it likes,
and that happens in the background and isn't counted above either.

We've been meaning to go dig into the OpenSSL internals to keep track of
all the extra bytes used also, but right now we figure we're a pretty
good approximation in most cases.

--Roger