git404hub

what is ratelimit fr?

uber-go/ratelimit — explained in plain English

Analysis updated 2026-06-26

4,696GoAudience · developerComplexity · 2/5Setup · easy

tl;dr

A tiny Go library from Uber that throttles how fast your program runs a loop or makes requests, using a leaky-bucket algorithm to smooth out bursts into a steady, controlled pace.

vibe map

mindmap
  root((ratelimit))
    What it does
      Rate limiting
      Leaky bucket
      Steady pacing
    API
      Take function
      Per second cap
      Low overhead
    Tech Stack
      Go
    Audience
      Go developers
      API integrators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Limit an API client loop to a set number of requests per second without writing your own timer logic.

VIBE 2

Smooth out bursts in a high-throughput Go service by throttling an internal loop with a single Take() call before each operation.

what's the stack?

Go

how it stacks up fr

uber-go/ratelimitgliderlabs/logspoutthe-open-agent/openagent
Stars4,6964,6974,697
LanguageGoGoGo
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperops devopsvibe coder

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

in plain english

This is a small Go library, written by the engineering team at Uber, that helps developers control how fast their programs make requests or perform operations. The specific technique it uses is called a leaky-bucket algorithm, which is a well-known method for smoothing out bursts of activity into a steady, controlled pace. You tell the library how many operations per second you want to allow, and before each operation you call a single function called Take. If you are within your allowed rate, Take returns immediately and you proceed. If you are going too fast, Take pauses your program just long enough to bring you back within the limit. This makes it straightforward to add rate limiting to any loop or repeated action without managing timers yourself. The library is intentionally minimal. It was built to have a simple API and low overhead for high-throughput situations. The README notes that for more complex rate-limiting needs, such as allowing short bursts above the limit or more fine-grained control, Go's standard extended library includes a more full-featured alternative. This package focuses on the common case where you just want a clean per-second cap with minimal code.

prompts (copy fr)

prompt 1
Using uber-go/ratelimit, limit my HTTP client to 50 requests per second by calling Take() before each request in my loop.
prompt 2
How does uber-go/ratelimit's leaky-bucket algorithm differ from Go's standard x/time/rate limiter, and when should I use each one?
prompt 3
Add uber-go/ratelimit to my existing Go batch processor so it never exceeds 200 database writes per second.

Frequently asked questions

what is ratelimit fr?

A tiny Go library from Uber that throttles how fast your program runs a loop or makes requests, using a leaky-bucket algorithm to smooth out bursts into a steady, controlled pace.

What language is ratelimit written in?

Mainly Go. The stack also includes Go.

How hard is ratelimit to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is ratelimit for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.