• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Leaky bucket algorithm
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leaky bucket algorithm


  • Subject: Re: Leaky bucket algorithm
  • From: Scott Ribe <email@hidden>
  • Date: Tue, 13 Jun 2006 09:08:42 -0600
  • Thread-topic: Leaky bucket algorithm

>> 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
overhead/payload ratio.

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.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(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

  • Follow-Ups:
    • Re: Leaky bucket algorithm
      • From: "Peter Sichel" <email@hidden>
References: 
 >Re: Leaky bucket algorithm (From: David Aames <email@hidden>)

  • Prev by Date: Re: CFNetwork FTP: Renaming Files
  • Next by Date: Re: CFNetwork FTP: Renaming Files
  • Previous by thread: Re: Leaky bucket algorithm
  • Next by thread: Re: Leaky bucket algorithm
  • Index(es):
    • Date
    • Thread