Skip to content
Researched developer tool comparisonsPrices dated · vendor sources linked · no star ratings
Search

Stage 02 · Test · Researched comparison

Best Go Rate Limiting Libraries in 2026

x/time/rate is the first pick for most Go services. It is the maintained token bucket limiter from the Go project, it has no dependencies, and it fits single-process limits well. Choose go-redis/redis_rate when limits must be shared across several instances, and uber-go/ratelimit when you need a simple leaky bucket with a fixed interval between requests.

By
Published 27 Nov 2026 · 7 tools compared

We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

  • x/time/rate is free, open source and maintained by the Go project, which makes it the safest default for in-process limits.
  • go-redis/redis_rate and ulule/limiter store counters in Redis, so limits hold across multiple servers.
  • Most libraries on this list are free and open source; only Redis, which several of them depend on, carries a hosting cost.
  • Rate limiters are libraries, not web pages, so no request data leaves your infrastructure.

Who each pick is for

Comparison

The 7 tools at a glance
ToolBest forStandout featureListed starting priceFree plan or trial
1x/time/rateSingle-process token bucket limits in Go servicesMaintained by the Go projectFree (open source)Free plan
2go-redis/redis_rateShared rate limits across multiple Go instancesLimits are shared through RedisFree (open source)Free plan
3ulule/limiterHTTP middleware with pluggable storage backendsMiddleware for common Go routersFree (open source)Free plan
4uber-go/ratelimitLeaky bucket pacing of outbound requestsSimple APIFree (open source)Free plan
5mennanov/limitersDistributed limiters backed by Redis, etcd or ConsulSeveral algorithms and several distributed backendsFree (open source)Free plan
6didip/tollboothHTTP request limiting middleware for Go web serversReady-made HTTP middlewareFree (open source)Free plan
7sethvargo/go-limiterFramework-agnostic limiters with pluggable storesClean interfaces for stores and middlewareFree (open source)Free plan

How we picked

We picked libraries that are actively maintained, documented in their own repositories, and genuinely used for rate limiting in Go. Criteria were fit for the job (algorithm and storage model), platform support, licence and price, whether limits can be shared across instances, and the main limits of each. Sources are vendor pages, package documentation and project repositories. Prices and licences change, so confirm details on the project site before you commit.

The tools, one by one

01

x/time/rate

Best for single-process token bucket limits in Go services

Visit pkg.go.dev
x/time/rate homepage
x/time/rate homepage, captured Nov 2026

What it is and where it fits

x/time/rate is the token bucket limiter maintained under the Go project. You create a limiter with a rate and a burst size, then call Allow, Wait or Reserve. Wait blocks until a token is available, which suits outbound client calls. Reserve returns a delay you can inspect.

It runs anywhere Go runs and has no third-party dependencies. The licence is BSD-3-Clause. There is no shared state, so each process enforces its own limit. If you run ten replicas, the effective limit is ten times what you configured. It also ships no middleware, so you write the HTTP or gRPC wrapper yourself.

Skip it when you need one global limit across a fleet. In that case, pair a Redis-backed limiter with it or use one instead.

Standout: Maintained by the Go project

Pricing pointer

Free (open source), as listed by the vendor (x/time/rate website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Maintained by the Go project
  • no external dependencies

Drawbacks

  • Limits are per process only
  • no built-in metrics or HTTP middleware

Skip it if this limit matters to you: limits are per process only.

Verdict. A sensible pick for single-process token bucket limits in Go services.

Alternatives in this guide: go-redis/redis_rate, ulule/limiter, uber-go/ratelimit

02

go-redis/redis_rate

Best for shared rate limits across multiple Go instances

Visit github.com
go-redis/redis_rate homepage
go-redis/redis_rate homepage, captured Nov 2026

What it is and where it fits

redis_rate is the rate limiter from the go-redis project. It implements the GCRA algorithm, a leaky bucket variant, and stores state in Redis. Every instance that points at the same Redis server sees the same counters, so a limit of 100 requests per second holds across your whole fleet.

It needs a Redis deployment. Each check is a network round trip, so latency is higher than an in-process limiter. The library is MIT licensed and free. Redis itself is open source under a source-available licence, and managed Redis services charge for hosting.

Use it when correctness across replicas matters more than the cost of a Redis call. For a single binary, x/time/rate is simpler.

Standout: Limits are shared through Redis

Pricing pointer

Free (open source), as listed by the vendor (go-redis/redis_rate website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Limits are shared through Redis
  • uses a GCRA algorithm with clear semantics

Drawbacks

  • Requires a Redis server
  • adds network latency to each check

Skip it if this limit matters to you: requires a Redis server.

Verdict. A sensible pick for shared rate limits across multiple Go instances.

Alternatives in this guide: x/time/rate, ulule/limiter, uber-go/ratelimit

03

ulule/limiter

Best for hTTP middleware with pluggable storage backends

Visit github.com
ulule/limiter homepage
ulule/limiter homepage, captured Nov 2026

What it is and where it fits

ulule/limiter provides rate limiting middleware for Go web frameworks, including chi, gin, echo and net/http. It supports several algorithms and several stores, so you can start with in-memory counters and move to Redis without changing handler code.

The middleware sets standard rate limit headers and returns 429 responses when a client exceeds the limit. Storage configuration, such as a Redis client, is passed in by your application. The project is MIT licensed and free.

It suits teams that want middleware rather than a bare limiter type. If you only need to throttle an outbound API client, x/time/rate is lighter.

Standout: Middleware for common Go routers

Pricing pointer

Free (open source), as listed by the vendor (ulule/limiter website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Middleware for common Go routers
  • supports in-memory, Redis and other stores

Drawbacks

  • API is smaller than some alternatives
  • store setup is on you

Skip it if this limit matters to you: API is smaller than some alternatives.

Verdict. A sensible pick for HTTP middleware with pluggable storage backends.

Alternatives in this guide: x/time/rate, go-redis/redis_rate, uber-go/ratelimit

04

uber-go/ratelimit

Best for leaky bucket pacing of outbound requests

Visit github.com
uber-go/ratelimit homepage
uber-go/ratelimit homepage, captured Nov 2026

What it is and where it fits

uber-go/ratelimit is a leaky bucket limiter. You call Take, and it blocks until the next slot is available. Requests are spaced at a fixed interval, which smooths traffic rather than allowing bursts.

The API is small: construct a limiter with a per-second rate and call Take. It is MIT licensed and free. Because it blocks, it fits worker loops and client calls better than HTTP handlers where you want an immediate reject.

There is no burst setting and no shared storage. If you need to allow short bursts or coordinate across processes, look at x/time/rate or a Redis-backed option.

Standout: Simple API

Pricing pointer

Free (open source), as listed by the vendor (uber-go/ratelimit website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Simple API
  • enforces a steady interval between requests

Drawbacks

  • No burst allowance
  • no distributed storage

Skip it if this limit matters to you: no burst allowance.

Verdict. A sensible pick for leaky bucket pacing of outbound requests.

Alternatives in this guide: x/time/rate, go-redis/redis_rate, ulule/limiter

05

mennanov/limiters

Best for distributed limiters backed by Redis, etcd or Consul

Visit github.com
mennanov/limiters homepage
mennanov/limiters homepage, captured Nov 2026

What it is and where it fits

mennanov/limiters collects distributed rate limiting algorithms in one package. It covers token bucket, leaky bucket, fixed window and sliding window, with backends for Redis, etcd, Consul, DynamoDB and in-memory storage.

Each combination is a separate constructor, so you choose the algorithm and the store explicitly. The Redis implementations use Lua scripts to avoid races. The project is MIT licensed and free.

It fits systems that already run etcd or Consul and want to reuse that infrastructure for limits. The trade-off is setup effort: you configure the backend, the algorithm and the key scheme yourself.

Standout: Several algorithms and several distributed backends

Pricing pointer

Free (open source), as listed by the vendor (mennanov/limiters website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Several algorithms and several distributed backends
  • lock-free Redis scripts

Drawbacks

  • More configuration than single-node libraries
  • backend must be operated

Skip it if this limit matters to you: more configuration than single-node libraries.

Verdict. A sensible pick for distributed limiters backed by Redis, etcd or Consul.

Alternatives in this guide: x/time/rate, go-redis/redis_rate, ulule/limiter

06

didip/tollbooth

Best for hTTP request limiting middleware for Go web servers

Visit github.com
didip/tollbooth homepage
didip/tollbooth homepage, captured Nov 2026

What it is and where it fits

tollbooth is an HTTP rate limiting middleware for Go. You wrap a handler with tollbooth.LimitFuncHandler or the equivalent for your router, set a rate and optional options such as per-IP keys, and it returns 429 responses when limits are exceeded.

It is aimed at web servers rather than general-purpose throttling. The default store is in-memory, and the project documents ways to plug in external stores for multi-instance setups. It is MIT licensed and free.

Choose it when you want request limiting in an HTTP service with minimal wiring. For gRPC or outbound client pacing, another library on this list fits better.

Standout: Ready-made HTTP middleware

Pricing pointer

Free (open source), as listed by the vendor (didip/tollbooth website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Ready-made HTTP middleware
  • supports per-IP and per-path limits

Drawbacks

  • Focused on HTTP only
  • in-memory by default

Skip it if this limit matters to you: focused on HTTP only.

Verdict. A sensible pick for HTTP request limiting middleware for Go web servers.

Alternatives in this guide: x/time/rate, go-redis/redis_rate, ulule/limiter

07

sethvargo/go-limiter

Best for framework-agnostic limiters with pluggable stores

Visit github.com
sethvargo/go-limiter homepage
sethvargo/go-limiter homepage, captured Nov 2026

What it is and where it fits

sethvargo/go-limiter separates the limiter from the store. You pick a store such as the in-memory implementation or the Redis one, then wrap it in middleware for net/http or a gRPC interceptor.

The interfaces are small, which makes it easy to swap stores or write your own. The memory store is process-local; the Redis store shares state across instances. The project is Apache-2.0 licensed and free.

It suits teams that want one library for both HTTP and gRPC with a choice of backend. If you want the smallest possible dependency for a single service, x/time/rate remains simpler.

Standout: Clean interfaces for stores and middleware

Pricing pointer

Free (open source), as listed by the vendor (sethvargo/go-limiter website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Clean interfaces for stores and middleware
  • supports memory and Redis stores

Drawbacks

  • Smaller ecosystem than x/time/rate
  • you assemble the pieces

Skip it if this limit matters to you: smaller ecosystem than x/time/rate.

Verdict. A sensible pick for framework-agnostic limiters with pluggable stores.

Alternatives in this guide: x/time/rate, go-redis/redis_rate, ulule/limiter

Who should use what

A single Go binary with outbound API calls should start with x/time/rate and its Wait method. A service running several replicas behind a load balancer needs shared state, so go-redis/redis_rate or mennanov/limiters with Redis fits. A team that wants HTTP middleware with little wiring should look at ulule/limiter, tollbooth or sethvargo/go-limiter. A worker that must pace requests at a fixed interval, with no bursts, suits uber-go/ratelimit.

Questions to settle before you buy

What to check before you buy

  • Decide whether limits must be shared across instances, which rules out in-memory-only libraries.
  • Check the algorithm: token bucket allows bursts, leaky bucket paces requests, sliding window smooths edges.
  • Confirm the licence and whether the backing store, such as Redis, adds hosting cost.
  • Measure the latency of a remote store check if you limit on every request.
  • Verify the project is maintained: recent commits, tagged releases and open issue activity.

FAQ

Do I need Redis for rate limiting in Go?

No. x/time/rate and uber-go/ratelimit work in memory with no external service. You need a shared store such as Redis only when several processes must enforce one combined limit.

Which algorithm should I use?

Token bucket, as in x/time/rate, allows short bursts up to a set size and is a good default. Leaky bucket paces requests at a fixed interval. Sliding window counters give smoother limits at window edges.

Are these libraries free?

Yes. Every library on this list is free and open source under licences such as MIT, BSD-3-Clause and Apache-2.0. A backing store like Redis may carry hosting costs if you use a managed service.

Can I use these for gRPC?

Yes. x/time/rate and sethvargo/go-limiter can be wrapped in a gRPC interceptor. ulule/limiter and tollbooth focus on HTTP, so you would write the interceptor yourself.

What happens when a client exceeds the limit?

The library reports that no token is available, and your handler decides the response. Middleware libraries typically return HTTP 429 with rate limit headers. With x/time/rate you can reject immediately or wait.

Sources we checked

Method: how we score · editorial policy.

  1. x/time/rate (official site)
  2. go-redis/redis_rate (official site)
  3. ulule/limiter (official site)
  4. uber-go/ratelimit (official site)
  5. mennanov/limiters (official site)
  6. didip/tollbooth (official site)
  7. sethvargo/go-limiter (official site)

Change log. First published 27 Nov 2026.