Updated on 2025-08-29 GMT+08:00

Configuring a Rate Limiting Policy

This policy controls the number of requests for accessing microservices to prevent the system from being damaged due to traffic impact.

Prerequisites

You have created a microservice by referring to Creating a Microservice. After the microservice starts, the service instance is registered with the corresponding service based on the configurations in the YAML file. If the microservice is not created in advance or has been deleted, the microservice is automatically created when the service instance is registered.

Configuring Rate Limiting

  1. Click the target engine.
  2. Choose Microservice Governance.

    • For engines with security authentication disabled, go to 4.
    • For engines with security authentication enabled, if the login VDC user is the user imported in Importing an IAM Account, go to 4. For other users, go to 3.

  3. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  4. Click the target microservice. Click Rate Limiting.
  5. Click New. The following table describes configuration items of rate limiting.

    Figure 1 Configuring rate limiting (for microservices accessed through Spring Cloud)
    Figure 2 Configuring rate limiting (for microservices accessed through Java chassis)

    Parameter

    Description

    Rate Limiting Object

    This configuration applies to microservices accessed through Java chassis.

    Scope for the rate limiting rule to take effect.

    Upstream Microservice

    This configuration applies to microservices accessed through Spring Cloud.

    In the microservice architecture, each microservice works with other microservices to implement service functions. Select another microservice that invokes the current microservice.

    QPS

    Requests generated per second. When the number of requests sent by the rate limiting object to the current service instance exceeds the specified value, the current service instance no longer accepts requests from the rate limiting object. The value ranges from 1 to 99999.

    If a microservice has three instances, the rate limiting of each instance is set to 2700 QPS, then the total QPS is 8100. In this case, rate limiting is triggered only when the QPS exceeds 8100.

  6. Click OK.