[Unit] Description=DSH machine performance tuning (CPU governor + disk read-ahead) Documentation=file:/home/zyw/Downloads/dl-hub/94-DSH机性能诊断/DSH机性能诊断与优化策略-20261014.md # 本机 /usr 是只读 overlay,未安装 cpupower;用最小 systemd 单元做开机持久化。 # 对应报告"阶段 A3"与"A5(read_ahead)"。回滚:systemctl disable --now dsh-perf-tune.service [Service] Type=oneshot RemainAfterExit=yes # A3: governor ondemand -> schedutil(响应更快,且比 ondemand 更省电/更少抖动) ExecStart=/bin/sh -c 'for g in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo schedutil > "$g"; done' # A5: 机械盘顺序读预读 128KB -> 1024KB ExecStart=/bin/sh -c 'test -w /sys/block/sda/queue/read_ahead_kb && echo 1024 > /sys/block/sda/queue/read_ahead_kb || true' [Install] WantedBy=multi-user.target