赞
踩
By default this value is set to 1, which means that once an I/O request has been completed by the block device, it will be sent back to the "group" of CPUs that the request came from. This can sometimes help to improve CPU performance due to caching on the CPU, which requires less cycles. If this value is set to 2, the block device will sent the completed request back to the actual CPU that requested it, not to the general group. If you have a beefy CPU and really want to utilize ALL THE CORES and spread the load around as much as possible then a value of 2 might provide better results.
echo 2 > /sys/block/sda/queue/rq_affinity
To make this a permanent change we will add it to /etc/rc.local
vim /etc/rc.local
##Add this above "exit 0"##
echo 0 > /sys/block/sda/queue/add_random
echo 0 > /sys/block/sda/queue/rotational
echo 2 > /sys/block/sda/queue/rq_affinit
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。