本文指导您如何实现自动开启网卡多队列。
将以下脚本写入到开机脚本中,可以实现开机时自动开启网卡多队列。
#!/bin/bash nics=$(ip link | grep -v 'lo: ' | grep '^[0-9]' | awk -F':' '{print $2}') for nic in $nics; do queue=$(ethtool -l $nic | grep Combined: | awk '{print $2}' | head -1) if [ x"$queue" = x ]; then continue fi if [ $queue -gt 1 ];then ethtool -L $nic combined $queue fi done