Skip to main content
Skip table of contents

Add a Rate Limiting Plugin

This example add a Rate Limiting Plugin to the echo-route on the echo-service. The Route will be limited to 20 requests per minute, or one request every three seconds.

Add the Plugin

  1. Click Services on the menu.
  2. Click the echo-service Service.
  3. Click the Routes tab.
  4. Click the echo-route Route.
  5. Click the Plugins tab.
  6. Click the Add action icon.
  7. Select the "Rate Limiting" plugin type.
  8. Enter the Plugin description, for example "Limit to 20 requests per minute by client IP".
  9. Enter 20 in the Rate field.
  10. Select Minute from the Per dropdown.
  11. Select Limit by - Client IP.
  12. Click SAVE.

Test the Configuration

  1. From the Console Dashboard, start the gateway or redeploy the gateway configuration.
  2. In the browser window connected to the gateway, repeatedly click the refresh button. Requests that exceed the one every 3 seconds rate second limit will return HTTP error 429 "Too Many Requests".
  3. In your browser, enter the Echo Service: 
  4. Repeatedly click the browser refresh button. The response should be returned immediately each time the refresh button is clicked.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.