Updated on 2026-09-08 GMT+08:00

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.

Figure 1 Intelligent Routing Policy

If intelligent routing is enabled, set intelligent routing policies. The following policies are supported:

Table 1 Intelligent routing policies

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.

  • General inference services: Image classification, text moderation, content recognition, data structuring, and other standardized inference tasks with single, independent calls and no contextual dependencies.
  • Uniform traffic stress testing: Service stress testing and cluster performance acceptance to evenly saturate the compute of all instances.
  • Basic general service clusters: Unified AI compute outlets for small and medium-sized enterprises with no special latency or session requirements.

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.

  • Fixed client access services: Enterprise intranet office AI tools and unified inference API calls by employees in fixed regions.
  • Local cache reuse scenarios: Instances cache popular inference results locally, allowing repeated requests from the same IP address to hit the cache directly, significantly boosting speed.
  • Access log traceability: Aggregates requests by client IP address, making it easier for O&M teams to troubleshoot user access anomalies and calculate regional call volumes.
  • Lightweight fixed session services: Simple interactive services that distinguish users based solely on access IP addresses without requiring account logins.

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.

  • Persistent-connection inference services: Streaming voice recognition, real-time video analysis, and long-running AI task processing.
  • Services with burst traffic fluctuations: E-commerce promotion review, content risk control during peak hours, and temporary batch inference tasks.
  • Inconsistent compute clusters: Clusters with mismatched performance configurations across instances, automatically bypassing high-load instances.
  • High-concurrency short-duration requests: Government bulk data processing and batch file AI parsing.

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.

  • LLM real-time dialogue: Intelligent customer service, online Q&A, real-time copywriting generation, and instant human-machine interaction.
  • Frontend real-time display: Web-based AI writing, in-app smart Q&A, and real-time inference feedback in pop-ups.
  • High low-latency demands: Industrial real-time quality inspection, in-vehicle real-time AI analysis, and device edge-linked inference.
  • User-experience-first C-end services: Public-facing AI tools that prioritize perceived response speeds.

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.

  • Mixed service clusters: A single cluster simultaneously handling dialogue inference, batch processing, and content moderation.
  • Unified AI inference platforms for large enterprises: Compute pools shared by multiple departments where service types are chaotic with no uniform call characteristics.
  • 24/7 stable O&M: Unattended automatic scheduling that fully balances resource pressure across all dimensions.
  • Heterogeneous compute hybrid clusters: Mixed deployment of different compute nodes (e.g., GPU and NPU) to intelligently match optimal resources.

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.

  • Government/Enterprise tiered service scheduling: High priority for core government services and livelihood-critical AI services; low priority for general office assistant AI.
  • Enterprise core service protection: Revenue-related paid AI services are prioritized over internal free testing services.
  • Service rate-limiting tiers: During peak traffic periods, priority is given to paid customers and core channel calls, while secondary service traffic is restricted.
  • Cloud compute resource quota management: Allocates compute weights based on service importance to achieve resource priority isolation.

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.