Skip to content
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
    • Kong Konnect
    • Kong Mesh
    • Plugin Hub
    • decK
    • Kubernetes Ingress Controller
    • Insomnia
    • Kuma

    • Docs contribution guidelines
  • Plugin Hub
  • Support
  • Community
  • Kong Academy
Early Access
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kubernetes Ingress Controller
  • Insomnia
  • Kuma

  • Docs contribution guidelines
    • Overview of Konnect
    • Architecture
    • Network Resiliency and Availability
    • Port and Network Requirements
    • Compatibility
    • Stages of Software Availability
    • Release Notes
      • Control Plane Upgrades FAQ
      • Supported Installation Options
    • Overview
    • Access a Konnect Account
    • Set up a Runtime
    • Configure a Service
    • Implement and Test the Service
      • Publish and Consume Services
      • Register Applications
    • Import Kong Gateway Entities into Konnect
    • Overview
      • Overview
      • Dashboard
      • Manage Runtime Groups with UI
      • Manage Runtime Groups with decK
      • Installation Options
      • Install with Docker
      • Install on Kubernetes
      • Install on Linux
      • Install on AWS
      • Install on Azure
      • Upgrade a Runtime Instance to a New Version
      • Renew Certificates
      • Runtime Parameter Reference
      • Overview
      • Runtime Configuration
    • Create Consumer Groups
      • Overview
      • Set Up and Use a Vault in Konnect
    • Plugin Ordering Reference
    • Troubleshoot
    • Overview
      • Konnect Services
      • Service Versions
      • Service Implementations
      • Manage Service Documentation
      • Overview
      • Configure a Plugin on a Service
      • Configure a Plugin on a Route
    • Overview
    • Access the Dev Portal
    • Sign Up for a Dev Portal Account
      • Manage Developer Access
      • Manage Application Registration Requests
      • Manage Application Connections
      • Auto Approve Dev and App Registrations
      • Azure OIDC
      • Application Overview
      • Enable and Disable App Registration
        • Okta
        • Curity
        • Auth0
      • Create, Edit, and Delete an Application
      • Register an Application with a Service
      • Generate Credentials for an Application
    • Customize Dev Portal
    • Troubleshoot
    • Introduction to Analytics
    • Summary Dashboard
    • Analyze Services and Routes
    • Generate Reports
    • Troubleshoot
      • Manage a Konnect Account or Plan
      • Change to a Different Plan
      • Manage Payment Methods and Invoices
      • Overview
        • Overview
        • Manage Teams
        • Teams Reference
        • Roles Reference
      • Manage Users
      • Set up SSO with OIDC
      • Set up SSO with Okta
    • Account and Org Deactivation
    • Troubleshoot
    • Overview
      • API Documentation
      • Identity Integration Guide
      • API Documentation
      • Overview
      • Nodes
      • Data Plane Certificiates
        • Services
        • Routes
        • Consumers
        • Plugins
        • Upstreams
        • Certificates
        • CA Certificates
        • SNIs
        • Targets
        • Vaults
      • API Spec
      • Filtering

github-edit-pageEdit this page

report-issueReport an issue

enterprise-switcher-iconSwitch to OSS

On this page
  • Create a consumer
  • Assign a consumer to a consumer group
  • Configure the Rate Limiting Advanced plugin for all consumers
  • Configure rate limiting for consumer groups
Kong Konnect
  • Home
  • Kong Konnect
  • Runtime Manager
  • Create Consumer Groups in Konnect

Create Consumer Groups in Konnect

With consumer groups, you can define any number of rate limiting tiers and apply them to subsets of consumers, instead of managing each consumer individually.

For example, you could define three consumer groups:

  • gold tier with 1000 requests per minute
  • silver tier with 10 requests per second
  • bronze tier with 6 requests per 30 seconds

The consumer_groups endpoint works together with the Rate Limiting Advanced plugin.

Consumers that are not in a consumer group default to the Rate Limiting advanced plugin’s configuration, so you can define tier groups for some users and have a default behavior for consumers without groups.

To use consumer groups for rate limiting, you must:

  • Create a consumer group and create or add consumers to it
  • Configure the Rate Limiting Advanced plugin globally with the enforce_consumer_groups and consumer_groups parameters, setting up the list of consumer groups that the plugin accepts
  • Configure a rate limiting policy for each consumer group, overriding the plugin’s global configuration

This tutorial will walk through creating a bronze tier consumer group that allows consumers in the group to make five requests every 30 seconds.

Create a consumer

In this section, you will create a consumer.

  1. From the Konnect sidebar, open the Runtime Manager section.
  2. Select the default runtime group.
  3. Open the Consumers tab, click Add consumer, and enter the following consumer information into the form:
    • Username: Amal
    • Custom ID: Amal

Assign a consumer to a consumer group

In this section, you will assign the consumer you just created to the Bronze tier consumer group.

  1. From the Runtime Manager section in the default Konnect workspace, open the Consumers tab.
  2. Click the Consumer Groups tab, and then click Add Consumer Group.
  3. Enter “Bronze” for the consumer group name and select the “Amal” consumer you just created from the drop-down.
  4. Click Create.

Configure the Rate Limiting Advanced plugin for all consumers

In this section, you will configure the Rate Limiting Advanced plugin to set the rate limit to 5 requests every 30 seconds for all consumers.

  1. In Konnect, click Runtime Manager in the sidebar.
  2. Click the default runtime group.
  3. From the menu, open Plugins, then click Add plugin.
  4. Find the Rate Limiting plugin, then click Select.
  5. Apply the plugin as Global This means the rate-limiting applies to all requests, including every service and route in the workspace.

    If you switched it to Scoped, the rate limiting would apply the plugin to only one service, route, or consumer.

    By default, the plugin is automatically enabled when the form is submitted. You can also toggle the This plugin is Enabled button to configure the plugin without enabling it. For this example, keep the plugin enabled.

  6. Complete only the following fields with the following parameters:
    • Config.limit: 5
    • Config.window_size: 30
    • Config.window_type: Sliding
    • Config.retry_after_jitter_max: 0
    • Config.enforce_consumer_groups: true
    • Config.consumer_groups: Bronze

    Besides the above fields, there may be others populated with default values. For this example, leave the rest of the fields as they are.

  7. Click Save.

Configure rate limiting for consumer groups

In this section, you will configure the Rate Limiting Advanced plugin to set the rate limit to 6 requests every 30 seconds only for consumers in the Bronze tier.

  1. In Konnect, click Runtime Manager in the sidebar.
  2. Select the default runtime group.
  3. From the menu, open Consumers, then click the Consumer Groups tab.
  4. Click the Bronze consumer group you just created.
  5. Click Add Configuration.
  6. In the dialog, complete only the following fields with the following parameters:
    • Window Size: 30
    • Window Type: Sliding
    • Limit: 6
    • Retry After Jitter Max: 0
  7. Click Save.

You have now set up a Bronze tier consumer group with one consumer, Amal, assigned to the group. Whenever the consumer Amal sends requests, they can make up to six requests every 30 seconds before hitting the rate limit. All other consumers are limited to only five requests every 30 seconds.

Thank you for your feedback.
Was this page useful?
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023