---
id: "in-process-limiter"
type: "component"
kind: "rate-limiter"
provider: "default"
category: "edge"
docs: "https://en.wikipedia.org/wiki/Token_bucket"
url: "https://localhost:3000/catalogue/components/in-process-limiter"
---

# In-process rate limiter

Library rate limiter holding state inside the application process.

| | |
|---|---|
| Provider | [default](https://localhost:3000/catalogue?provider=default) |
| Kind | [Rate limiter](https://localhost:3000/catalogue/kinds/rate-limiter) |
| Category | Edge |
| Official docs | [https://en.wikipedia.org/wiki/Token_bucket](https://en.wikipedia.org/wiki/Token_bucket) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `algorithm` | enum | `token-bucket`, `leaky-bucket`, `sliding-window`, `fixed-window`, `adaptive` | no | "token-bucket" | inherited |
| `atomicOps` (advanced) | boolean | — | no | true | **true** |
| `distributed` | boolean | — | no | false | **false** |
| `failMode` | enum | `open`, `closed` | no | "open" | inherited |
| `managed` | boolean | — | no | false | inherited |
| `perReplicaQuotaDivision` | boolean | — | no | false | inherited |
| `placement` | enum | `edge`, `gateway`, `sidecar`, `in-process` | no | "gateway" | **"in-process"** |
| `scope` | enum | `global`, `user`, `ip`, `api-key`, `concurrency` | no | "user" | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 6

- [Cloudflare Rate Limiting](https://localhost:3000/catalogue/components/cloudflare-rate-limiting.md) `cloudflare-rate-limiting` — cloudflare
- [Cloudflare Waiting Room](https://localhost:3000/catalogue/components/cloudflare-waiting-room.md) `cloudflare-waiting-room` — cloudflare
- [Envoy rate limit service](https://localhost:3000/catalogue/components/envoy-ratelimit.md) `envoy-ratelimit` — default
- [NGINX limit_req](https://localhost:3000/catalogue/components/nginx-limit-req.md) `nginx-limit-req` — default
- [Generic rate limiter](https://localhost:3000/catalogue/components/rate-limiter.md) `rate-limiter` — default
- [Redis rate limiter](https://localhost:3000/catalogue/components/redis-rate-limiter.md) `redis-rate-limiter` — default

## Use it in a design

```yaml
nodes:
  - { id: "in-process-limiter", component: "in-process-limiter" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# In-process rate limiter (library): per-replica state, so quotas are not shared across instances.
schemaVersion: "1"
type: "component"
id: "in-process-limiter"
kind: "rate-limiter"
provider: "default"
docs: "https://en.wikipedia.org/wiki/Token_bucket"
defaults:
  placement: "in-process"
  distributed: false
  atomicOps: true
properties:
  perReplicaQuotaDivision:
    type: "boolean"
    default: false
```

Human page: https://localhost:3000/catalogue/components/in-process-limiter
