Patent attributes
A token bucket or leaky bucket is maintained at least partially through the use of two separate counters. A full counter, is maintained in relatively lower cost memory, and indicates the amount of tokens within the bucket on a potentially delayed basis. An intermediate counter is stored in a relatively higher cost memory that supports high access rates, and indicates the amount of tokens assigned (or unassigned) to the bucket since the full counter was last updated. Various adjustment processes remove (or add) tokens as needed for performing tasks. A background process updates the full counter from the corresponding intermediate counter on a periodic, scheduled, or other basis. The buckets are replenished (or deleted) with tokens periodically at assigned rates. Traffic management or other decisions are based on the bucket's current status, as determined from the full counter during the background process and then stored in the higher cost memory.