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.
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.
``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 ``
CreateCommand. Set Type=RunShellScript, encode the script in Base64, and pass it to CommandContent.InstanceIds or using TagKey/TagValue filters. Ensure all targets are Running and have the Cloud Assistant agent active.RunCommand. Example CLI:``bash aliyun ecs RunCommand \ --RegionId cn-hangzhou \ --CommandId c-xxxxxxxxxxxx \ --InstanceIds '["i-uf614fhehhzmx", "i-uf614fhehhzmy"]' \ --Timeout 300 ``
DescribeInvocationResults. Poll until InvokeStatus returns Success or Failed.RunCommand with sysctl net.ipv4.tcp_tw_reuse && lsmod | grep smc to confirm kernel changes.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.
AliyunECSAssistantAccess attached to instances.cloudassistant.aliyuncs.com (or regional VPC endpoint).Running state with valid VPC routing and security group egress rules.com.aliyun.ecs.cloudassistant) for private routing.modprobe and sysctl reloads can stall. Always override the default 60s limit with --Timeout 300 in RunCommand.sysctl values on reboot. Persist settings via /etc/sysctl.d/99-network-tune.conf and disable conflicting NM profiles.CONFIG_SMC=y. On legacy Alinux 2 kernels, modprobe smc fails silently. Verify with uname -r and upgrade kernel if unsupported.