>> What are you actually trying to accomplish?
> To actually limit the _current_ speed and distribute the traffic
> evenly during the one second window.
Depends on you definition of "_current speed" and "evenly"...
Network transmissions are packetized, and any single packet will go out at
the current "wire speed" of the hardware. You can break up your transmission
into smaller and smaller packets, but you can't make the bytes of a single
packet transmit more slowly, nor is there any way to allow bytes from other
processes to be sent in between bytes of your single packet. So network
traffic at short time scales is always bursty to that degree. You could
transmit a single byte at a time, which would result in the shortest
possible packets being sent, which would be closer to an "even" spread, but
then your own process' performance would be terrible because of the huge
Now if what you care about is having multiple threads running multiple
transfers simultaneously, without hogging the network connection such that
other processes have their network performance degraded too much, how close
are you already? I don't recall from former messages exactly how you wound
up using the token bucket, but what you'd want to do is to basically
round-robin among your transfers, allowing each to transmit a single packet
in turn, with some mechanism for pausing between each transmission to limit
the average rate--so you effectively control the average rate, while by
transmitting only one packet at a time you ensure that the delay until
another process has a chance to get a packet out is as short as possible.
(303) 722-0567 voice
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden