# Rate Limiting Syntax in Traefik.toml

**URL:** <https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110>\
**Category:** Traefik v1\
**Tags:** docker\
**Created:** [August 2, 2019, 1:06pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110 "2019-08-02T13:06:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratchet5000](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@ratchet5000](https://community.traefik.io/u/ratchet5000)\
**Post date:** [August 2, 2019, 1:06pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110/1 "2019-08-02T13:06:04Z")

</div>

In the documentation, it says you can add rate limiting by adding something similar to the Traefik.toml config file:

[frontends]  
[frontends.frontend1]  
[frontends.frontend1.ratelimit]  
extractorfunc = "client.ip"  
[frontends.frontend1.ratelimit.rateset.rateset1]  
period = "10s"  
average = 10  
burst = 20

But to me it's a bit unclear what frontend1 is. I've tried the putting service names from my docker-compose.yml but there was no mention of rate limiting in the Traefik container logs, and a looped curl with hundreds of iterations failed to trigger any HTTP 429 responses.

Does it have anything to do with the frontend names in the docker ui at /dashboard? However, for me everytime I call docker-compose up, the numbering is slightly different (a frontend labeled 2 could be 3 the next time etc).

---

<div class="post-metadata">

**Author:** ![daniel.tomcej](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/daniel.tomcej/32/262_2.png) [@daniel.tomcej](https://community.traefik.io/u/daniel.tomcej)\
**Post date:** [August 2, 2019, 4:00pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110/2 "2019-08-02T16:00:37Z")

</div>

Hello @ratchet5000,

If you are using the docker provider to provide configuration to traefik, you may want to use the ratelimiting labels on those containers to provide rate limiting (such as `traefik.frontend.rateLimit.extractorFunc`):

[https://docs.traefik.io/v1.7/configuration/backends/docker/#on-containers](https://docs.traefik.io/v1.7/configuration/backends/docker/#on-containers)

You probably don't want to use the File provider to accomplish this, as the file provider is not as dynamic as the docker provider is.

---

<div class="post-metadata">

**Author:** ![ratchet5000](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@ratchet5000](https://community.traefik.io/u/ratchet5000)\
**Post date:** [August 2, 2019, 4:13pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110/3 "2019-08-02T16:13:40Z")

</div>

I still run into the same problem of ambiguity for labels like traefik.frontend.rateLimit.rateSet. \< name \> .period=6

What do I put for \< name \>? Do I need to set a container name in the yml config file?

---

<div class="post-metadata">

**Author:** ![daniel.tomcej](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/daniel.tomcej/32/262_2.png) [@daniel.tomcej](https://community.traefik.io/u/daniel.tomcej)\
**Post date:** [August 2, 2019, 4:46pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110/4 "2019-08-02T16:46:19Z")

</div>

> [@ratchet5000](#):
>
> What do I put for \< name \>?

Give it a unique name, like `baconlover` or `defaultlimit`.

Because you can define multiple rate sets per container, you have the ability to give the sets names. What you name them is up to you.

---

<div class="post-metadata">

**Author:** ![ratchet5000](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@ratchet5000](https://community.traefik.io/u/ratchet5000)\
**Post date:** [August 2, 2019, 6:14pm UTC](https://community.traefik.io/t/rate-limiting-syntax-in-traefik-toml/1110/5 "2019-08-02T18:14:22Z")

</div>

Thanks, that worked great
