タグ

ブックマーク / text.baldanders.info (1)

  • Go による Token Bucket 実装

    Qiita で golang.org/x/time/rate でレイトリミット - Qiita という記事を見かける。 golang.org/x/time/rate は,いわゆる「トークンバケット(token bucket)」アルゴリズムを実装するためのパッケージのようだ。 トークンバケット・アルゴリズムとは A token is added to the bucket every $1/r$ seconds. The bucket can hold at the most $b$ tokens. If a token arrives when the bucket is full, it is discarded. When a packet (network layer PDU) of $n$ bytes arrives, if at least $n$ tokens are in t

    Go による Token Bucket 実装
  • 1