确定核心数
cat /proc/cpuinfo
查看程序所使用的核心
taskset -p $pid
例如:
[root@M /]# taskset -p 27693
pid 27693's current affinity mask: 69
mask为16进制
0x00000069
二进制之后1101001
所以pid 27693运行在0 3 6 7 核心上
0x00000001
is processor #0
0x00000003(二进制 00000011)
is processors #0 and #1
0xFFFFFFFF
is all processors (#0 through #31)
查看多进程的时候可以使用:
SYNOPSIS
taskset [options] [mask | list ] [pid | command [arg]...]
OPTIONS