DaaS / Products / Batch Network Tuning Across ECS Fleet

Batch Network Tuning Across ECS Fleet

Use ECS Cloud Assistant to remotely execute network optimization scripts (TCP tuning, SMC enablement, XPS configuration) across a fleet of Alibaba Cloud Linux instances, standardizing performance settings at scale without SSH-ing into each machine.

Products involved

Scenario

When deploying high-throughput or low-latency workloads across dozens of Alibaba Cloud Linux (Alinux) instances, manually SSH-ing into each node to apply TCP tuning, enable Shared Memory Communication (SMC), or configure XPS is error-prone and unscalable. This workflow leverages ECS Cloud Assistant to push standardized network optimization scripts to an entire fleet simultaneously, ensuring consistent kernel-level performance baselines without manual intervention.

Integration steps

  1. Prepare the optimization script combining Alinux-specific tuning:
  2. ``bash #!/bin/bash modprobe smc sysctl -w net.ipv4.tcp_tw_reuse=1 sysctl -w net.core.rmem_max=16777216 echo 1 > /sys/class/net/eth0/queues/tx-0/xps_cpus ``

  3. Create a Cloud Assistant command via CreateCommand. Set Type=RunShellScript, encode the script in Base64, and pass it to CommandContent.
  4. Target your fleet by collecting InstanceIds or using TagKey/TagValue filters. Ensure all targets are Running and have the Cloud Assistant agent active.
  5. Execute the batch job using RunCommand. Example CLI:
  6. ``bash aliyun ecs RunCommand \ --RegionId cn-hangzhou \ --CommandId c-xxxxxxxxxxxx \ --InstanceIds '["i-uf614fhehhzmx", "i-uf614fhehhzmy"]' \ --Timeout 300 ``

  7. Monitor execution via DescribeInvocationResults. Poll until InvokeStatus returns Success or Failed.
  8. Validate remotely by issuing a follow-up RunCommand with sysctl net.ipv4.tcp_tw_reuse && lsmod | grep smc to confirm kernel changes.

Architecture

The workflow initiates from the ECS control plane via the RunCommand API. Requests route to the Cloud Assistant service, which pushes the Base64-encoded payload to the aliyun-service daemon on each target Alinux instance. The agent executes the script as root, applying sysctl and modprobe changes directly to the Linux kernel and network stack. Execution logs, stdout/stderr, and exit codes are asynchronously reported back to the ECS API, enabling centralized tracking without inbound SSH.

Prerequisites

Common pitfalls

Typical questions