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.
#!/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: 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.Q: How can I batch apply network tuning to an ECS fleet using Cloud Assistant? A: You can batch apply network tuning by creating a Base64-encoded shell script and executing it across your fleet using the ECS Cloud Assistant RunCommand API. Target your instances by InstanceIds or tags, ensure they are in a Running state with the agent active, and monitor progress via DescribeInvocationResults.
Q: How do I remotely configure TCP parameters across an Alibaba Cloud Linux fleet? A: Remotely configure TCP parameters by embedding sysctl commands into a Cloud Assistant script and deploying it to your Alinux instances. Override the default execution timeout to prevent stalls during kernel reloads, and validate the changes with a follow-up remote command.
Q: How can I roll out Shared Memory Communication (SMC) acceleration across multiple instances? A: Roll out SMC acceleration by adding the modprobe smc command to a Cloud Assistant optimization script and executing it across your target fleet. Verify that your instances run a compatible Alibaba Cloud Linux kernel with CONFIG_SMC=y enabled, and confirm module loading using a remote lsmod check.