Load Balancing
Load balancing distributes incoming traffic across multiple servers to prevent any single server from becoming overwhelmed, improving fault tolerance, availability, and performance for APIs and backend services.
Configuring Load Balancing
Select API for Load Balancing
Go to API Management > API List, and search for the API you want to enable load balancing for.
Select the target API, and click on the
icon to access the update page. You can either create a new API or update an existing one.

Add Multiple Target URLs and Set Traffic Distribution
In the API settings, you can add multiple Target URLs for backend services.
Locate the Target URLs field to configure the backend service URLs.

For each backend server or service that will receive traffic, specify its corresponding Target URL.
Assign a percentage of incoming traffic to each target URL. This is how load balancing is achieved. For example, you can distribute traffic as:
Target URL 1: 50%
Target URL 2: 30%
Target URL 3: 20%
Click Update to save and exit.

Testing Load Balancing
Run API Test
Go to API Management > API Test.
Select the API that you have configured for load balancing and send multiple test requests.
Monitor Traffic Distribution
Observe the responses via the API Test feature. Check if the requests are routed according to the distribution percentages set in the load balancing configuration.
You should see requests distributed across the different backend servers or services.
Check Response Data
Review the responses from each backend (target URL) to confirm that requests are handled by different servers.
For more information, please refer to API Test.
Was this helpful?