Help Center/ ModelArts/ Model Inference/ Inference Deployment (New Version)/ Performing Custom Service Deployment/ Deploying a Real-Time Inference Service Using Multi-Node PD Disaggregation
Updated on 2026-07-07 GMT+08:00

Deploying a Real-Time Inference Service Using Multi-Node PD Disaggregation

Real-time services have two versions. The new version is recommended.

Overview

In ultra-large-scale LLM inference scenarios (10B to 100B+ parameters), traditional single-node deployment faces pain points such as insufficient VRAM, high time-to-first-token (TTFT) latency, low concurrent throughput, and poor resource utilization. Consequently, it cannot meet the high-concurrency, low-latency, and high-stability demands of enterprise-grade generative AI (text generation, multimodal generation).

Multi-node PD disaggregation is designed specifically for generative scenarios such as LLMs, text-to-image generation, and long-context dialogues. It is perfectly suited for the following core scenarios:

  • Ultra-large-scale model inference (34B/70B/175B+ parameters): Scenarios where the VRAM of a single node cannot accommodate the complete model weights.
  • High-concurrency request scenarios: Scenarios requiring boosted inference throughput and reduced TTFT.
  • Resource utilization optimization: Scenarios that need to align with the differentiated computing demands of the prefill phase (compute-intensive) and the decode phase (concurrency-intensive).

Core Principles

Generative inference for LLMs is divided into two core phases, each with significantly different compute and VRAM requirements:

  • Prefill: Processes the user's input prompt and calculates the input sequence's KV cache all at once. This phase requires high VRAM and high compute, but has short execution time and low concurrency.
  • Decode: Generates the output token-by-token based on the KV cache. This phase requires low VRAM and low compute, but has long execution time and high concurrency.

Deployment mode comparison:

  • Multi-node prefill-decode (PD) co-location (multi-role separation – co-location): PD co-location refers to deploying both the prefill and decode stages of LLM inference onto the same set of compute nodes (such as NPUs/GPUs) to share KV cache resources. This mode is suitable for resource-constrained scenarios or when architecture simplification is required. When using the vLLM framework in a co-location scenario, you are advised to set the first unit as the vLLM master node and place the remaining worker nodes in other units. For details about multi-node PD co-location, see Deploying a Real-Time Inference Service Using Multi-Node PD Co-location.
  • Multi-node PD disaggregation (multi-role separation – isolation): In the multi-role separation mode, the prefill and decode units are deployed on different physical nodes to achieve complete resource isolation. This mode delivers optimal performance but incurs higher costs. This topic focuses on multi-node PD disaggregation.

Based on the ModelArts multi-role separation deployment mode, the two phases are split across different nodes to achieve multi-node collaboration:

  • Unit splitting: Creates two types of independent inference units, prefill units (high-compute nodes) and decode units (high-concurrency nodes).
  • Intelligent routing: The platform automatically distributes requests. A user request is first processed by the prefill unit to generate the KV cache, and is then forwarded to the decode unit to complete the token-by-token generation.
  • Resource isolation: The two types of units are scheduled and scaled independently, allowing resources to be matched precisely on demand.
  • Multi-node collaboration: Relying on the distributed capabilities of dedicated resource pools, the multi-node cluster communicates via a high-speed internal network to complete cross-node PD task collaboration.

Constraints

  • Deployment mode constraints: The multi-role separation mode must be selected, consisting of at least one prefill unit and one decode unit.
  • Resource specification constraints: Supports dedicated resource pools (including heterogeneous ones) and public resource pools. Physical pools that have already created logical subpools are currently not supported. When deploying on a heterogeneous resource pool, the instance specifications of the prefill and decode units must match the specifications of the node pool.
  • Image/Model requirements: The model image must be adapted to the multi-role separation architecture and support independent deployment of prefill and decode; otherwise, the deployment will fail. The model must also support KV cache separation.
  • Call mode constraints: Both synchronous and asynchronous calls are supported.

Prerequisites

Notes

Resource pools allocate quota for real-time services even when they are Abnormal or Stopped. If the quota is insufficient and no more services can be deployed, delete some abnormal services to release resources.

  • Quota calculation:

    The quota stays the same when you deploy real-time services with a dedicated resource pool. It only changes if you create, modify, or delete a resource pool.

  • Usage metering:

    Deploying real-time services in a dedicated resource pool is not metered. Only the usage of the dedicated resource pool itself is metered.

  • Mounting SFS Turbo:

    Before mounting an SFS Turbo file system to a real-time service, associate the dedicated resource pool network with the file system.

Configuring Basic Information

Log in to the ModelArts console and choose Model Inference > Real-Time Inference. On the service list page, choose More > Add Deployment on the right of the service name.
Figure 1 Adding a deployment

You can also click the service name to go to the service details page and configure deployment information on the Deploy tab page or by clicking Add Deployment in the upper right corner of the service details page.

Figure 2 Adding a deployment

On the Deploy Real-Time Service page, configure basic information, resource settings, model settings, unit settings, deployment management settings, and advanced settings.

The following table describes the basic information.
Table 1 Basic information

Parameter

Description

Example

Deployment Name

Name of the current deployment, which is used to identify and manage the deployment configuration of the real-time service. Enter a name as prompted. Only letters, digits, hyphens (-), and underscores (_) are supported. Max length: 128 characters

service

Description (Optional)

Brief description of the deployment.

/

Configuring Resource Settings

The following table describes the resource settings.
Table 2 Resource settings

Parameter

Description

Example

Resource Pool Type

Both dedicated resource pools and public resource pools support multi-role separation deployment.

  • Public Resource Pool

    Public resource pool for deploying the real-time service. The public resource pool supplies shared compute clusters assigned according to job parameters. Each job operates with its own isolated resources. This option offers cost-effective and flexible solutions for tasks like development and testing.

    Choosing the public resource pool might leave fewer resources available because of its limits. If this happens, join the queue and wait your turn.

  • Dedicated Resource Pool

    Dedicated resource pool for deploying the real-time service. The resources provided in a dedicated resource pool are exclusive and more controllable. Use dedicated resource pools for core production services to secure exclusive resources.

Dedicated Resource Pool

Resource Pool

If Resource Pool Type is set to Dedicated Resource Pool, click Select Resource Pool, select the corresponding specifications in the dedicated resource pool specifications area, and click OK. The physical pools with logical subpools created are not supported. If no dedicated resource pool is available, create one.

You can choose a heterogeneous resource pool for deploying real-time services. If you use a heterogeneous dedicated resource pool, ensure the real-time service's instance specifications match the pool's specifications.

/

Deployment Replicas

A deployment instance consists of units capable of independently completing an inference task. Specify the number of instance replicas for the deployment. The value ranges from 1 to 128.

If there is one replica, only one service instance runs. This is a standard single-node setup. With three replicas, three identical service instances run simultaneously. This spreads out requests, improves handling multiple tasks, and provides basic high availability.

2 to 4

Scheduling Policy

Two scheduling policies are available: HA scheduling and Compact scheduling. HA scheduling is enabled by default.

  • HA scheduling: Pods from different replicas will be distributed across different nodes as evenly as possible, while multiple pods under the same replica will prioritize scheduling to the same node to ensure high availability for inference services.

    If both HA scheduling and Affinity Scheduling are enabled, Affinity Scheduling takes precedence.

  • Compact scheduling: Enable bin packing for cluster workloads. The scheduler will prioritize placing pods on nodes with higher resource consumption to reduce idle resource fragmentation and improve cluster resource utilization.

    When both Compact scheduling and Affinity Scheduling are enabled, Affinity Scheduling takes precedence.

Affinity scheduling is set in More Settings of the Unit Settings. For details, see Table 2.

HA scheduling

Scheduling Priority

Resource scheduling priority for service deployment. When Service Resource Pool Settings is set to Dedicated resource pool, set this parameter. The platform handles jobs by prioritizing them from highest to lowest.

Range: 1 (lowest) to 3 (highest).

If multiple jobs have the same priority, they are scheduled in the order they were submitted. The final schedule depends on available resources. When resources are enough and priorities match, the first jobs submitted are scheduled first.

1

Configuring Model Settings

The following table describes the model settings.
Table 3 Model settings

Category

Parameter

Description

Example

Model Source

Platform asset

When deploying a real-time service, you can select either Platform asset or Custom Model as the model source.

When selecting Platform asset, the model originates from the ModelArts asset center. Click a card to select a model. You can choose from either Preset Models or My Models:

  • Preset Models: These are inference model assets built into ModelArts that you can select and use directly.
  • My Models: These are models generated by importing a local model or by completing model pre-training or model fine-tuning on ModelArts. Select your model and click OK.

Supported model assets depend on the resource pool specifications. Select a dedicated resource pool or switch to the public resource pool and try again.

Platform asset

Custom Model

When selecting a custom model, you can select the model storage type. Set the model storage address and mount path.

Supported storage types for custom models: OBS buckets, OBS parallel file systems, SFS Turbo, and pre-warmed models. For details about the parameters, see Storage Mounting.

Custom Model

Configuring Prefill Inference Units

For multi-role PD disaggregation, set the inference service deployment mode to Multi-role.

Multi-role: Requires configuring multiple inference units as needed, with each unit corresponding to a specific role within the inference deployment instance. Adding or scaling roles requires adding new units. Multiple units are combined to form a complete inference deployment instance, suitable for scenarios such as PD co-location or disaggregation.

xPyD general ratio rules

x = Number of prefill units; y = Number of decode units; x + y = Total number of units

Example: 1P2D (1 prefill unit + 2 decode units) is the standard configuration for mainstream online production environments.

For details about the inference unit parameters, see the table below. During the configuration, you can click Preview Deployment in the upper right corner to view the topology of the current deployment, as shown in Viewing the Service Deployment Topology.

You can click Clone to copy the configuration of an existing inference unit, or click Delete to delete an inference unit that is no longer used.

Table 4 Prefill inference unit parameters

Parameter

Description

Example

role-0

The default value is role-0, which can be modified. Enter up to 16 characters. Only lowercase letters, digits, and hyphens (-) are supported, and it must start and end with a letter or digit.

role-prefill

Unit Replicas

For multi-role separation, you can set or adjust the number of unit replicas to improve the unit throughput and response speed. The value ranges from 1 to 100. Set this parameter based on the number of concurrent requests.

1

Specification Type > Preset

Public resource pools only support preset specifications. Dedicated resource pools support preset specifications and custom specifications.

Select an available unit instance specification and set the number of instances per replica.

Total resource requirements of the inference unit = Unit instance specifications x Number of resource instances. For example, if the unit instance specification provides eight accelerators and you need 32 in total, enter 4.

Prefill instance type: High-compute GPU/NPU specifications recommended for compute-intensive prefill.

NOTE:

Actual consumption will be slightly higher than the selected specification due to system overhead.

/

Specification Type > Custom

Only dedicated resource pools support custom specifications.

Choose a custom specification if the preset ones do not fit your needs. GPU virtualization is enabled for this resource pool. Resources will be strictly allocated based on request volume. Configure specific vCPUs and memory. For details, see Viewing Details About a Real-Time Service.

  • CPU cores: The value must be at least 0.01 with exactly two decimal places and should not exceed the total cores available in the resource pool.
  • Memory: The memory value must be an integer of at least 4 and should not exceed the total memory available in the resource pool.
    NOTE:

    Actual consumption will be slightly higher than the selected specification due to system overhead.

When deploying a real-time service, you may select a heterogeneous dedicated resource pool—one that contains multiple architectures or specifications. For example, a resource pool might include node pool 1 (x86 architecture, CPU-only, 8 vCPUs, 32 GB), node pool 2 (x86 architecture, CPU-only, 8 vCPUs, 64 GB), and node pool 3 (Arm architecture, NPU-accelerated, 192 vCPUs, 1536 GB). When deploying a real-time service using such a heterogeneous resource pool, you can first select the node pool specifications, for example, node pool 1 with CPU-only specifications, and then select the job specifications required for deploying the service, such as the number of CPUs, memory, or accelerators required for deploying the real-time service.

If you have node pools with the same specification, like node pool 1 and node pool 2, and you choose node pool 1 during setup, the service may still be deployed in either node pool 1 or node pool 2. This depends on which pool has better resource usage at the time.

When deploying multiple inference units, you cannot use heterogeneous node pools. All inference units must be in the same node pool.

/

Image Type

Select the source of the inference image.

  • Preset image: Use images from ModelArts asset management. You can tag them with details like supported specifications and frameworks for easy management. For details, see ModelArts Images.
  • Custom image: Select your custom image. For details about how to create a custom image, see Creating a Custom Image for a Model. Use your own image via any of the following options:
    • SoftWare Repository for Container (SWR): SWR is a secure, reliable, and easy-to-use container image management service that supports full lifecycle management of container images.
    • Registered image: Select an image registered with ModelArts.
  • Image URL: Enter the image path of a custom image.
  • Pre-warmed image: Select an image pre-warmed in dedicated resource pool in advance.

    If the image warmup task is done and the status is normal, deployment speeds up automatically.

    The selected image path and the service to be deployed must be in the same region.

/

Environment Variables (Optional)

Inject environment variables into the pod. To ensure data security, do not enter sensitive information, such as plaintext passwords, in environment variables.

Environment variables are key-value pairs. For example, the key is A and the value is AAAA.

Only letters, digits, underscores (_), hyphens (-), and periods (.) are supported. They cannot start with a digit and cannot exceed 64 characters.

The value of an environment variable cannot be in HTML format, such as <p>, <^>, and <...>.

You can upload an Excel file to batch import environment variables. Only .xlsx and .xls files are supported, and up to 100 parameters can be uploaded. To ensure correct parsing, fill in the file strictly according to the template format. To download the template, click Download Template.

Click Local Upload. In the dialog box that is displayed, click Add File to import the local Excel file. Check the parsed environment variable key values. If the check result is To be modified, modify the values as required and upload the file again. After the check result is Passed, select the key values and click OK to complete the batch upload of environment variables.

/

Mount File Storage

Supports mounting file storage and specifying artifact dump path.

Supported storage types for file storage: OBS buckets, OBS parallel file systems, SFS Turbo, and pre-warmed models.

Supported storage type for artifact dumping: OBS parallel file system

You can add up to 15 storage paths for file storage and 10 storage paths for artifact dump. Artifact dump cannot share the same OBS parallel file system with file or model mounting.

For details about the storage type, storage address, and mount path, see Storage Mounting.

/

Health Check

Configure probes to monitor the model health. It can only be configured when the health check API is configured in the inference image. Otherwise, the model deployment fails.

The following probes are supported:

  • Startup Probe: This probe checks if the instance has started. If a startup probe is configured, the liveness or readiness probe is not executed until the startup probe is successful, allowing sufficient time for the application to complete initialization. If the startup probe fails, the instance is restarted. If startup probe is not configured, the service status changes to success immediately after the service is scheduled. The service may be in the Running state and the prediction cannot be performed because the model is being loaded.
  • Readiness Probe: This probe verifies whether the instance is ready to handle traffic. If the readiness probe fails (meaning the instance is not ready), the instance is taken out of the service load balancing pool. Traffic will not be routed to the instance until the probe succeeds.
  • Liveness Probe: This probe monitors the application health status. If the liveness probe fails (indicating the application is unhealthy), the instance is automatically restarted.

For details about the three types of probes involved in health check, see Real-Time Service Health Check.

/

Boot Command

Set the service boot command.

/

More Settings > Automatic Rebuild

When enabled, if a pod restarts due to deployment configuration changes or failures, the platform will automatically rebuild it using the selected policy. If disabled, the platform will not intervene. For details, see Auto Rebuild upon a Real-Time Service Fault.

/

More Settings > Auto Restart

When enabled, if an NPU, switch, or hardware fault is detected, services on the faulty node are automatically rescheduled. Some capabilities are only supported by Snt9b and Snt9b2 resources. For details, see Auto Restart upon a Real-Time Service Fault.

To ensure service continuity, configure multiple instances.

/

More Settings > Graceful Shutdown

Enabling this feature allows you to configure shutdown timeouts and commands. This prevents in-progress requests from being forcefully interrupted, thereby enhancing the availability and stability of the system.

If you have configured health checks and set a large sleep value in this command, it will result in a longer restart or stop time for the container when the health check fails.
  • Shutdown Timeout (s): This parameter indicates the maximum length of time that can pass between when a Pod receives a stop signal to when it is forcefully stopped. It is used for the Pod to perform cleanup operations (such as closing connections, releasing resources, and saving states).
  • Shutdown Command: The shutdown command is triggered when the container receives a stop signal, but it must be completed within the grace period or the shutdown times out. If this happens, the container will be forcefully stopped. You can use this command to perform operations such as closing database connections, releasing file handles, and stopping child processes.

/

More Settings > Affinity Scheduling

You can configure the node affinity type and strength to flexibly schedule workloads in a resource pool. If no nodes are specified, the pods will be randomly scheduled according to the default cluster scheduling policy.

After this function is enabled, you can refine the pod deployment policy.

  • Node affinity (strong): The pod must be scheduled onto the specified node; otherwise, scheduling will not proceed.
  • Node affinity (weak): The system will try to place the pod on the specified node, but it is not guaranteed.
  • Node anti-affinity (strong): The pod must not be scheduled onto the specified node; otherwise, scheduling will not proceed.
  • Node anti-affinity (weak): The system will try to avoid deploying the pod on the specified node, but it is not guaranteed

In the Add Node list, select the nodes that meet the preceding configuration rules.

When you choose a pre-warmed model, only the pre-warmed nodes appear on the affinity scheduling page. Unwarmed nodes do not show. A message appears stating: The selected model is pre-warmed and will deploy automatically on the best node. Specifying a node might cause warmup to fail.

/

More Settings > Container User ID

If this option is selected, enter the user ID and user group ID (optional).

/

Authentication Credential

Displays when OBS is used for mounting and local storage acceleration is not enabled, or System Log Reporting is selected in Table 5.

A secret is used to verify identity and authorize access. In the information security and identity authentication fields, a secret is a key mechanism to ensure that only authorized users can access the system, resources, or services.

  • If the version of CCE Container Storage (Everest) in your dedicated resource pool is v2.4.204 or later and the cluster version is v1.28 or later, temporary credentials are enabled by default (no AK/SK is required, ensuring higher security).
  • If your CCE Container Storage (Everest) version is too low or the cluster does not support temporary credentials, you must mount the credentials using DEW. When using DEW secrets to mount storage, you must include 'accessKeyId' and 'secretAccessKey' (corresponding to your AK and SK, respectively). Ensure the information provided is correct, or the function may not work as expected.

    To create a secret, click Create Secret to go to the DEW console. For details, see Creating a Secret. Set the AK/SK in the Secret key/value tab. Enter accessKeyId and secretAccessKey in the Key column. To obtain the values, go to the DEW console, and choose My Credentials > Access Keys.

/

Configuring Decode Inference Units

Click Add Inference Unit or click Clone to copy the existing inference unit settings and configure the decode inference units.

For details about the inference unit parameters, see the table below. During the configuration, you can click Preview Deployment in the upper right corner to view the topology of the current deployment, as shown in Viewing the Service Deployment Topology.

Table 5 Decode inference unit parameters

Parameter

Description

Example

role-1.

The default value is role-1, which can be modified. Enter up to 16 characters. Only lowercase letters, digits, and hyphens (-) are supported, and it must start and end with a letter or digit.

role-decode

Unit Replicas

For multi-role separation, you can set or adjust the number of unit replicas to improve the unit throughput and response speed. The value ranges from 1 to 100. Set this parameter based on the number of concurrent requests.

2

Specification Type > Preset

Dedicated resource pools support preset specifications and custom specifications.

Select an available unit instance specification and set the number of instances per replica.

Total resource requirements of the inference unit = Unit instance specifications x Number of resource instances. For example, if the unit instance specification provides eight accelerators and you need 32 in total, enter 4.

For decode inference units, you are advised to select low-compute CPU/NPU specifications to better adapt to decode streaming generation.

NOTE:

Actual consumption will be slightly higher than the selected specification due to system overhead.

/

Specification Type > Custom

Only dedicated resource pools support custom specifications.

Choose a custom specification if the preset ones do not fit your needs. GPU virtualization is enabled for this resource pool. Resources will be strictly allocated based on request volume. Configure specific vCPUs and memory. For details, see Viewing Details About a Real-Time Service.

  • CPU cores: The value must be at least 0.01 with exactly two decimal places and should not exceed the total cores available in the resource pool.
  • Memory: The memory value must be an integer of at least 4 and should not exceed the total memory available in the resource pool.
    NOTE:

    Actual consumption will be slightly higher than the selected specification due to system overhead.

When deploying multiple inference units, you cannot use heterogeneous node pools. All inference units must be in the same node pool.

/

Image Type

Select the source of the inference image.

  • Preset image: Use images from ModelArts asset management. You can tag them with details like supported specifications and frameworks for easy management. For details, see ModelArts Images.
  • Custom image: Select your custom image. For details about how to create a custom image, see Creating a Custom Image for a Model. Use your own image via any of the following options:
    • SoftWare Repository for Container (SWR): SWR is a secure, reliable, and easy-to-use container image management service that supports full lifecycle management of container images.
    • Registered image: Select an image registered with ModelArts.
  • Image URL: Enter the image path of a custom image.
  • Pre-warmed image: Select an image pre-warmed in dedicated resource pool in advance.

    If the image warmup task is done and the status is normal, deployment speeds up automatically.

    The selected image path and the service to be deployed must be in the same region.

Custom Images > SWR

Environment Variables (Optional)

Inject environment variables into the pod. To ensure data security, do not enter sensitive information, such as plaintext passwords, in environment variables.

Environment variables are key-value pairs. For example, the key is A and the value is AAAA.

Only letters, digits, underscores (_), hyphens (-), and periods (.) are supported. They cannot start with a digit and cannot exceed 64 characters.

The value of an environment variable cannot be in HTML format, such as <p>, <^>, and <...>.

You can upload an Excel file to batch import environment variables. Only .xlsx and .xls files are supported, and up to 100 parameters can be uploaded. To ensure correct parsing, fill in the file strictly according to the template format. To download the template, click Download Template.

Click Local Upload. In the dialog box that is displayed, click Add File to import the local Excel file. Check the parsed environment variable key values. If the check result is To be modified, modify the values as required and upload the file again. After the check result is Passed, select the key values and click OK to complete the batch upload of environment variables.

/

Mount File Storage

Supports mounting file storage and specifying artifact dump path.

Supported storage types for file storage: OBS buckets, OBS parallel file systems, SFS Turbo, and pre-warmed models.

Supported storage type for artifact dumping: OBS parallel file system

You can add up to 15 storage paths for file storage and 10 storage paths for artifact dump. Artifact dump cannot share the same OBS parallel file system with file or model mounting.

For details about the storage type, storage address, and mount path, see Storage Mounting.

Object Storage Service – Bucket

Health Check

Configure probes to monitor the model health. It can only be configured when the health check API is configured in the inference image. Otherwise, the model deployment fails.

The following probes are supported:

  • Startup Probe: This probe checks if the application instance has started. If a startup probe is configured, the liveness or readiness probe is not executed until the startup probe is successful, allowing sufficient time for the application to complete initialization. If the startup probe fails, the instance is restarted. If startup probe is not configured, the service status changes to success immediately after the service is scheduled. The service may be in the Running state and the prediction cannot be performed because the model is being loaded.
  • Readiness Probe: This probe verifies whether the application instance is ready to handle traffic. If the readiness probe fails (meaning the instance is not ready), the instance is taken out of the service load balancing pool. Traffic will not be routed to the instance until the probe succeeds.
  • Liveness Probe: This probe monitors the application health status. If the liveness probe fails (indicating the application is unhealthy), the instance is automatically restarted.

For details about the three types of probes involved in health check, see Real-Time Service Health Check.

/

Boot Command

Set the service boot command.

/

More Settings > Automatic Rebuild

When enabled, if a pod restarts due to deployment configuration changes or failures, the platform will automatically rebuild it using the selected policy. If disabled, the platform will not intervene. For details, see Auto Rebuild upon a Real-Time Service Fault.

/

More Settings > Auto Restart

When enabled, if an NPU, switch, or hardware fault is detected, services on the faulty node are automatically rescheduled. Some capabilities are only supported by Snt9b and Snt9b2 resources. For details, see Auto Restart upon a Real-Time Service Fault.

To ensure service continuity, configure multiple instances.

/

More Settings > Graceful Shutdown

Enabling this feature allows you to configure shutdown timeouts and commands. This prevents in-progress requests from being forcefully interrupted, thereby enhancing the availability and stability of the system.

If you have configured health checks and set a large sleep value in this command, it will result in a longer restart or stop time for the container when the health check fails.
  • Shutdown Timeout (s): This parameter indicates the maximum length of time that can pass between when a Pod receives a stop signal to when it is forcefully stopped. It is used for the Pod to perform cleanup operations (such as closing connections, releasing resources, and saving states).
  • Shutdown Command: The shutdown command is triggered when the container receives a stop signal, but it must be completed within the grace period or the shutdown times out. If this happens, the container will be forcefully stopped. You can use this command to perform operations such as closing database connections, releasing file handles, and stopping child processes.

/

More Settings > Affinity Scheduling

You can configure the node affinity type and strength to flexibly schedule workloads in a resource pool. If no nodes are specified, the pods will be randomly scheduled according to the default cluster scheduling policy.

After this function is enabled, you can refine the pod deployment policy.

  • Node affinity (strong): The pod must be scheduled onto the specified node; otherwise, scheduling will not proceed.
  • Node affinity (weak): The system will try to place the pod on the specified node, but it is not guaranteed.
  • Node anti-affinity (strong): The pod must not be scheduled onto the specified node; otherwise, scheduling will not proceed.
  • Node anti-affinity (weak): The system will try to avoid deploying the pod on the specified node, but it is not guaranteed

In the Add Node list, select the nodes that meet the preceding configuration rules.

When you choose a pre-warmed model, only the pre-warmed nodes appear on the affinity scheduling page. Unwarmed nodes do not show. A message appears stating: The selected model is pre-warmed and will deploy automatically on the best node. Specifying a node might cause warmup to fail.

/

More Settings > Container User ID

If this option is selected, enter the user ID and user group ID (optional).

/

Authentication Credential

Displays when OBS is used for mounting and local storage acceleration is not enabled, or System Log Reporting is selected in Table 5.

A secret is used to verify identity and authorize access. In the information security and identity authentication fields, a secret is a key mechanism to ensure that only authorized users can access the system, resources, or services.

  • If the version of CCE Container Storage (Everest) in your dedicated resource pool is v2.4.204 or later and the cluster version is v1.28 or later, temporary credentials are enabled by default (no AK/SK is required, ensuring higher security).
  • If your CCE Container Storage (Everest) version is too low or the cluster does not support temporary credentials, you must mount the credentials using DEW. When using DEW secrets to mount storage, you must include 'accessKeyId' and 'secretAccessKey' (corresponding to your AK and SK, respectively). Ensure the information provided is correct, or the function may not work as expected.

    To create a secret, click Create Secret to go to the DEW console. For details, see Creating a Secret. Set the AK/SK in the Secret key/value tab. Enter accessKeyId and secretAccessKey in the Key column. To obtain the values, go to the DEW console, and choose My Credentials > Access Keys.

/

Configuring Deployment Management Settings

The following table describes the deployment management settings.

Table 6 Deployment management settings

Parameter

Description

Container Protocol

The network transmission protocol used by the container. Configure it according to the API definitions in your actual setup.

If Service Protocol is set to HTTP or HTTPS in Table 2, Container Protocol can be set to HTTP or HTTPS.

If Service Protocol is set to WSS or WS in Table 2, the container protocol is the same as the service protocol by default and is not displayed on the console.

Container Port

The port number that the image listens on. Requests are sent to the instance through this port. The port number must be the same as the port number in your image.

More Settings > Deployment Timeout (Minutes)

The wait time before a single service times out. This value includes both the deployment and startup time. Set this parameter properly. The system will cancel the deployment if it exceeds the time limit.

More Settings > Max Surge Replicas (%)

The maximum number of replicas that can be created above the target count during a rolling upgrade When percentages are used, the instance count is rounded up.

Example:

When Max Surge Replicas (%) is set to 1% during a rolling upgrade of four instances, you can add one new instance at a time.

When Max Surge Replicas (%) is set to 100% during a rolling upgrade of two instances, you can add two new instances immediately.

For details about rolling upgrade, see Rolling Upgrades for Real-Time Service Deployment.

More Settings > Max Unavailable Replicas (%)

The maximum number of replicas that can be unavailable relative to the target count during a rolling update When percentages are used, the instance count is rounded down.

Example:

  • When Max Unavailable Replicas (%) is set to 1 during a rolling upgrade of four instances, four instances must remain available. An old instance can only be deleted after its replacement starts running.
  • When Max Unavailable Replicas (%) is set to 50 during a rolling upgrade of two instances, one old instance can be deleted immediately to release resources, but at least one instance must remain available.
  • If you deploy a service with Max Unavailable Replicas (%) at 20, requiring five instances, and only one fails due to lack of resources while four start successfully, the deployment succeeds, and the service status becomes Running.

If Max Unavailable Replicas equals the target replica count, there is a risk of downtime (Min Available Replicas = Total ReplicasMax Unavailable Replicas).

Example:

Setting Max. Invalid Instances to 100 allows the service stay running when an instance fails because of quick recovery. Yet, the service will not be able to perform predictions, potentially leading to interruptions.

To ensure a hitless upgrade, set Max. Invalid Instances to 1%. (This requires extra resources. Make sure you have enough, or the update will fail.)

For details about rolling upgrade, see Rolling Upgrades for Real-Time Service Deployment.

Configuring Advanced Settings

The following table describes the advanced settings.
Table 7 Advanced settings

Parameter

Description

Key Settings

Inference services support secret mounting. This uses encryption to protect sensitive data and securely mount it to containers. To protect your data, do not enter sensitive information in plaintext.

  • Custom key: Enter the key, key value, and mount path.
  • DEW: Data Encryption Workshop (DEW) is a comprehensive cloud data encryption service, including Key Management Service (KMS), Key Pair Service (KPS), and Dedicated Hardware Security Module (Dedicated HSM). To use DEW to configure the key, go to the DEW console to create a key, select the DEW key on the ModelArts console, and enter the mount path.

Choose whether to select Associate Image User Group ID. The user group ID of the user who starts the image can be associated. After the association, the secret mounting security is improved.

Intelligent Routing Policy

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

  • Round robin: Tasks are distributed sequentially to different nodes in order. This ensures an even distribution across the cluster and achieves load balancing.
  • Source IP hash: The system calculates hash values using client IP addresses to route requests from the same IP address to the same node.
  • Least connections: Requests are routed to the node with the fewest real-time connections. This method ensures that the load is distributed more evenly, improving service stability and response time.
  • Minimum time to first token: Requests are routed to the node with the lowest average time to first token. This method aims to minimize the wait time between receiving a request and starting its processing. This latency applies even when system resources are available immediately.
  • Overall loads: Requests are routed to the node with the lowest overall pressure, considering factors such as the number of connections, time to first token, and custom metrics. It directs new requests to less busy nodes to avoid resource waste and overloading.
  • SLO priority: Services are prioritized according to their assigned Service Level Objective (SLO) (0–3, where 0 is the highest). This ensures lower latency for higher-priority workloads.

For details, see Intelligent Routing Policy.

Custom Metric Collection

If this function is enabled, you need to input the metric collection port details. Custom metrics will send data to AOM's Prometheus instances for viewing on the AOM console. To query custom metrics, see Viewing Performance Metrics of a Real-Time Service on AOM and Viewing Performance Metrics of a Real-Time Service on ModelArts.

Constraints

  • ModelArts calls the HTTP API provided in the custom metric configuration every 10 seconds to obtain metric data.
  • The metric data text returned by the HTTP API provided in the custom metric configuration cannot exceed 32 KB.

Data Format of Custom Metrics

The format of custom metrics data must comply with the open metrics specifications. That is, the format of each metric must be:

<metric_name>{<tag_name>=<tag_value>,...} <sample_value> [timestamp_in_millisecond]

The following shows an example (the comment starts with #, which is optional):

# HELP http_requests_total The total number of HTTP requests.
# TYPE http_requests_total gauge
html_http_requests_total{method="post",code="200"} 1656 1686660980680
html_http_requests_total{method="post",code="400"} 2 1686660980681

System Log Reporting

Displays only for NPU dedicated resource pools. When enabled, system logs are mounted to a fixed parallel file system for O&M engineers to analyze. System logs are stored for 30 days and will be automatically deleted after that. The mount path of system logs cannot be changed.

Confirming Settings

On the Deploy Real-Time Service > Confirmation page, confirm the configuration information and click Confirm Deployment.

Deploying a service generally requires a period of time, which may be several minutes or tens of minutes depending on the amount of your data and resources.

You can go to the real-time service list to check if the deployment is complete. Once the service status changes from Deploying to Running, the service is deployed.

After a real-time service is deployed, it is started immediately.

Follow-Up Operations