Intelligent Routing Policy
Overview
In large-scale real-time inference, the request distribution policy directly impacts response latency, load balancing, session continuity, and service stability. ModelArts real-time inference services provide intelligent routing policies that flexibly distribute traffic according to your service requirements. Typical scenarios:
- Load balancing and traffic dispersion
In high-concurrency scenarios, requests must be evenly distributed across multiple instances to prevent single-instance overloading, reduce queuing delays, and maximize overall throughput.
- Low-latency prioritization
For scenarios such as streaming generation and real-time Q&A, requests are preferentially routed to the instance with the lowest TTFT, significantly reducing response latency.
- IP affinity access
Requests originating from the same client IP are consistently routed to the same instance, facilitating session caching, connection reuse, and log tracking.
- Service level objective (SLO) assurance
Core services are given priority access to low-latency resources, ensuring that the latency targets of high-SLO priority services are met first.
- Dynamic load scheduling
Requests are forwarded to the lightest-loaded instance based on a comprehensive evaluation of connections, TTFT, and custom metrics, thereby preventing resource waste.
Constraints
- Resource pool limitations: Intelligent routing policies are only supported in dedicated resource pools; public resource pools are not supported.
- Policy combinations: A single deployment can only be configured with one intelligent routing policy; multiple policies cannot be superimposed.
- Instance requirements: Intelligent routing only takes effect on instances that are running and healthy. Faulty or anomalous instances are excluded from scheduling.
Configuring Intelligent Routing Policies
Log in to the ModelArts console and choose Model Inference > Real-Time Inference. When deploying a real-time service, select Intelligent Routing Policy in Advanced Settings and configure the policy based on service requirements. For details about how to deploy a real-time service, see Deploying a Real-Time Inference Service Using a Single Node.
If intelligent routing is enabled, set intelligent routing policies. The following policies are supported:
| Policy | Core Rule | Use Case | Advantage | Not Applicable To |
|---|---|---|---|---|
| Round robin | Distributes requests sequentially to different instances to ensure traffic is evenly distributed across the cluster, achieving load balancing. |
| Simplest configuration, lowest scheduling overhead, and complete elimination of single-instance traffic accumulation. | Multi-turn dialogues, long-connection interactions, and services requiring fixed-instance caching. |
| Source IP hash | Calculates a hash value based on the client's IP address to allocate requests, ensuring that requests from the same IP address are consistently routed to the same instance. Suitable for session caching scenarios. |
| Inherently achieves simple session binding and features a high connection reuse rate. | Scenarios where requests pass through VPCEP, such as access of a large number of dynamic public IP addresses, mobile IP addresses, and private network access. |
| Least connections | Tracks the current number of active connections across inference instances or nodes in real time, prioritizing forwarding requests to the node with the fewest active connections to achieve load balancing and prevent single-node overloads. |
| Rapidly digests idle compute, preventing certain instances from freezing due to full loads while others remain idle. | Extreme low-latency prioritization or fixed session interaction scenarios. |
| Minimum TTFT | During request processing, intelligent routing uses TTFT (the duration from receiving a request to outputting its first token) as the key metric for routing decisions. It prioritizes forwarding requests to the node with the lowest average TTFT. |
| Minimizes first-response latency to the absolute limit, providing the optimal user experience. | Large-scale offline inference or throughput-focused services where latency is not a critical factor. |
| Overall loads | Requests are routed to the instance with the lowest overall pressure, considering factors such as the number of connections, TTFT, and custom metrics. It directs new requests to less busy instances to avoid resource waste and overloading. Overall loads require configuring the protocol (HTTPS or HTTP) and port number of the Metric Collection API. The port number must be an internal listening port of the image; choose a port number between 1024 and 65535. Recommended ports are 9090, 9100, and 8088. |
| Yields the highest global resource utilization and ensures the smoothest overall cluster operation. | Services with a single extreme performance demand or a strong binding to fixed sessions. |
| SLO priority | Pre-classifies different inference services into service level priorities (configurable from 0 to 3, where 0 is the highest) to preferentially guarantee the latency of high-priority services. |
| Strictly guarantees the SLA service metrics of core services, prioritizing their stability and availability. | Universal inference clusters where all services have equal rights and no hierarchical tiers exist. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot