Redis 进程绑核shell脚本
更新:HHH   时间:2023-1-7


#!/bin/bash

cpuNum=cat /proc/cpuinfo | grep processor | wc -l
let coreNum=$cpuNum-1
redisPid=ps aux | grep redis-server | grep -v grep | awk '{print $2}'
startNum=0
endNum=1

for pid in $redisPid
do
echo taskset -pc $startNum,$endNum $pid
let startNum=$startNum+2
let endNum=$startNum+1
done
echo "finish"
exit 0

返回数据库教程...