# Rate-Limit

A quite popular feature of BullMQ is the possibility to activate a rate-limit on a queue. This rate-limit guarantees that no more jobs than what the rate-limit defines will ever be processed, in the case of the proxy this means that the calls to the endpoint will always be within the rate-limit.

Lets add the limiter property to our WorkerMetadata interface:

```typescript
interface WorkerMetadata {
  opts?: {
    limiter?: {
      max: number; // integer representing max number of jobs to process on "duration"
      duration: number: // number of millisecons
    }
    // .. more options
  }
  // .. more options
}
```

The limiter just takes 2 properties, "max" defines the maximum number of jobs that will be processed during "duration", which is some time span defined in milliseconds. So for example, to limit to 100 jobs per second we could just use this object:

{% tabs %}
{% tab title="Curl" %}

```powershell
curl --location 'http://localhost:8080/workers' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1234' \
--data '{
    "queue": "my-test-queue",
    "opts": {
      "concurrency": 300,
      "limiter": {
        "max": 100,
        "duration": 1000
      }
    },
    "endpoint": {
        "url": "http://mydomain.dev",
        "method": "post"
    }
}'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bullmq.net/http-api/workers/adding-workers/rate-limit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
