Merge pull request #2 from RadoslavGatev/v0.11

merge branches
This commit is contained in:
Radoslav Gatev 2021-01-17 22:23:30 +02:00 committed by GitHub
commit 35bbdd5fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

View File

@ -61,7 +61,7 @@ npm install
```sh
hugo server --disableFastRender
```
3. Navigate to `http://localhost:1313/docs`
3. Navigate to `http://localhost:1313/`
## Update docs
1. Fork repo into your account

View File

@ -0,0 +1,30 @@
---
type: docs
title: "How-To: Rate limiting"
linkTitle: "How-To: Rate limiting"
weight: 1000
description: "Use Dapr rate limit middleware to limit requests per second"
type: docs
---
The Dapr Rate limit [HTTP middleware]({{< ref middleware-concept.md >}}) allows restricting the maximum number of allowed HTTP requests per second.
## Middleware Component Definition
In the following definition, the maximum requests per second are set to 10:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: ratelimit
spec:
type: middleware.http.ratelimit
metadata:
- name: maxRequestsPerSecond
value: 10
```
Once the limit is reached, the request will return *HTTP Status code 429: Too Many Requests*.
## Referencing the rate limit middleware
To be applied, the middleware must be referenced in a [Dapr Configuration]({{< ref configuration-concept.md >}}). See [Middleware pipelines]({{< ref "middleware-concept.md#customize-processing-pipeline">}}).