#!/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