Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Implementation Procedure

Updated on 2025-01-16 GMT+08:00
  1. Create a policy.

    1. Log in to the APIG console and create a request throttling 2.0 policy.
    2. In the navigation pane, choose API Management > API Policies. Click Create Policy, and select Request Throttling 2.0.
    3. Configure basic policy information to meet your demands.
      Table 1 Policy basic Information

      Parameter

      Description

      Name

      Set this name as planned.

      Throttling

      Select High-performance.

      Policy Type

      Select API-specific, which means measuring and throttling requests of a single API.

      Period

      Throttling period. Set this parameter to 60s.

  2. Configure basic throttling.

    As required in 1, set Max. API Requests to 10 times per 60s and Max. User Requests to 5 times per 60s.

    Table 2 Basic throttling

    Parameter

    Description

    Max. API Requests

    10

    Max. User Requests

    5

  3. Configure parameter-based throttling.

    1. As required in 2, enable parameter-based throttling, and define the header and rule.
      1. Click Add Parameter, select header for Parameter Location, and enter Host for Parameter.
      2. In the Rules area, click Add Rule, and set Max. API Requests to 10 and Period to 60 seconds. Then click , and set the matching condition Host = www.abc.com.
      3. Click OK. The header matching rule Host = www.abc.com is generated, indicating that an API bound with this policy can only be called 10 times per 60s by requests whose Host header is www.abc.com.
    1. As required in 3 and 4, define multiple rules with parameter Path.
      1. In the Rules area, click Add Rule, and set Max. API Requests to 10 and Period to 60 seconds. Then click to open the Condition Expressions dialog box.
      2. Add these three condition expressions: reqPath = /fc, reqPath = /list, and method = get.
      3. Click Set Lower Level.
      4. Put the two reqPath expressions in an OR relationship. This means the condition is met when either of the two paths is matched.
      5. Select reqPath = /list and method = get, click Set Lower Level, and select AND.

      6. Click OK. It indicates that APIs with path /list and method GET or APIs with path /fc bound with this policy can only be called 10 times per 60s.

  4. Configure excluded throttling.

    As required in 5, enable excluded throttling. Add an excluded tenant with a threshold of 5 requests per 60s.

    Table 3 Excluded throttling

    Parameter

    Description

    Account ID

    Tenant ID

    Threshold

    5

  5. Click OK. The request throttling 2.0 policy is configured.
  6. Bind this policy to an API.

    1. Click the policy name to go to the policy details page.
    2. In the APIs area, select environment RELEASE and click Bind to APIs. Select an API and click OK.

  7. Verify the API.

    Call the API and verify whether the request throttling 2.0 policy has taken effect.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback