https://www.cnblogs.com/liuq/p/5623565.html

全面了解 Linux 服务器 - 1. 查看 Linux 服务器的 CPU 详细情况

ubuntu下查看服务器的CPU详细情况

大文实验室/大文哥

壹捌陆捌零陆捌捌陆捌贰

21504965 AT qq.com

完成时间:2017/12/11 14:08

版本:V1.0

Posted on 2016-06-28 15:16 刘[小]倩 阅读(681) 评论(0) 编辑 收藏

1. 查看 Linux 服务器的 CPU 详细情况

判断依据:

具有相同的 core id 的 CPU 是同个 core 超线程。

具有相同的 physical id 的 CPU 是同一个 CPU 封装的线程或核心

显示物理 CPU 个数的命令:

liuqian@ubuntu:~$ cat /proc/cpuinfo | grep 'physical id' | sort| uniq | wc -l

1

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ cat /proc/cpuinfo | grep 'physical id' | sort| uniq | wc -l

1

rootroot@cm-System-Product-Name:~$

显示每个物理 CPU 中 core 的个数(即核数):

liuqian@ubuntu:~$ cat /proc/cpuinfo | grep 'cpu cores' | uniq

cpu cores    : 1

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ cat /proc/cpuinfo | grep 'cpu cores' | uniq

cpu cores : 6

rootroot@cm-System-Product-Name:~$

显示逻辑 CPU 的个数:

liuqian@ubuntu:~$ cat /proc/cpuinfo | grep 'processor' | wc -l

1

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ cat /proc/cpuinfo | grep 'processor' | wc -l

12

rootroot@cm-System-Product-Name:~$

按理说有如下等式:物理CPU个数 × 核数 = 逻辑CPU的个数

如果不相等的话,则表示你的服务器 CPU 支持超线程技术。在配置服务器的应用时,应以服务器的逻辑 CPU 个数为准。

查看系统内核版本号:

liuqian@ubuntu:~$ uname -a

Linux ubuntu 4.2.0-38-generic #45-Ubuntu SMP Wed Jun 8 21:21:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ uname -a

Linux cm-System-Product-Name 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ cat /etc/issue

Ubuntu 14.04.5 LTS \n \l

rootroot@cm-System-Product-Name:~$

【附加FreeBSD相关命令】

显示 CPU 个数:

[liuqian@SYQceshi03 ~]$ dmesg|grep cpu

cpu0 (BSP): APIC ID:  0

cpu1 (AP): APIC ID:  1

cpu0: <ACPI CPU> on acpi0

cpu1: <ACPI CPU> on acpi0

acpi_throttle0: <ACPI CPU Throttling> on cpu0

acpi_throttle1: <ACPI CPU Throttling> on cpu1

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ dmesg|grep cpu

[    0.000000] Initializing cgroup subsys cpuset

[    0.000000] Initializing cgroup subsys cpu

[    0.000000] Initializing cgroup subsys cpuacct

[    0.000000] KERNEL supported cpus:

[    0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106

[    0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:12 nr_node_ids:1

[    0.000000] PERCPU: Embedded 29 pages/cpu @ffff88043fc00000 s86336 r8192 d24256 u131072

[    0.000000] pcpu-alloc: s86336 r8192 d24256 u131072 alloc=1*2097152

[    0.000000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 08 09 10 11 -- -- -- --

[    0.000000] RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=12.

[    0.249748] cpuidle: using governor ladder

[    0.249749] cpuidle: using governor menu

[    0.948257] ledtrig-cpu: registered to indicate activity on CPUs

rootroot@cm-System-Product-Name:~$

[liuqian@SYQceshi03 ~]$ sysctl -a|grep cpu

cpu    HAMMER

device    cpufreq

kern.sched.cpusetsize: 8

<cpu count="2" mask="3">0, 1</cpu>

<cpu count="2" mask="3">0, 1</cpu>

kern.ccpu: 0

kern.smp.maxcpus: 64

kern.smp.cpus: 2

net.inet.tcp.per_cpu_timers: 0

debug.acpi.cpu_unordered: 0

debug.cpufreq.lowest: 0

debug.cpufreq.verbose: 0

hw.ncpu: 2

......

从上面可以看出 CPU 个数为 2

rootroot@cm-System-Product-Name:~$

rootroot@cm-System-Product-Name:~$ sysctl -a|grep cpu

sysctl: permission denied on key 'fs.protected_hardlinks'

sysctl: permission denied on key 'fs.protected_symlinks'

sysctl: permission denied on key 'kernel.cad_pid'

kernel.perf_cpu_time_max_percent = 25

kernel.sched_domain.cpu0.domain0.busy_factor = 64

kernel.sched_domain.cpu0.domain0.busy_idx = 0

kernel.sched_domain.cpu0.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu0.domain0.flags = 687

kernel.sched_domain.cpu0.domain0.forkexec_idx = 0

kernel.sched_domain.cpu0.domain0.idle_idx = 0

kernel.sched_domain.cpu0.domain0.imbalance_pct = 110

kernel.sched_domain.cpu0.domain0.max_interval = 2

kernel.sched_domain.cpu0.domain0.min_interval = 1

kernel.sched_domain.cpu0.domain0.name = SIBLING

kernel.sched_domain.cpu0.domain0.newidle_idx = 0

kernel.sched_domain.cpu0.domain0.wake_idx = 0

kernel.sched_domain.cpu0.domain1.busy_factor = 64

kernel.sched_domain.cpu0.domain1.busy_idx = 2

kernel.sched_domain.cpu0.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu0.domain1.flags = 559

kernel.sched_domain.cpu0.domain1.forkexec_idx = 0

kernel.sched_domain.cpu0.domain1.idle_idx = 0

kernel.sched_domain.cpu0.domain1.imbalance_pct = 125

kernel.sched_domain.cpu0.domain1.max_interval = 4

kernel.sched_domain.cpu0.domain1.min_interval = 1

kernel.sched_domain.cpu0.domain1.name = MC

kernel.sched_domain.cpu0.domain1.newidle_idx = 0

kernel.sched_domain.cpu0.domain1.wake_idx = 0

kernel.sched_domain.cpu1.domain0.busy_factor = 64

kernel.sched_domain.cpu1.domain0.busy_idx = 0

kernel.sched_domain.cpu1.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu1.domain0.flags = 687

kernel.sched_domain.cpu1.domain0.forkexec_idx = 0

kernel.sched_domain.cpu1.domain0.idle_idx = 0

kernel.sched_domain.cpu1.domain0.imbalance_pct = 110

kernel.sched_domain.cpu1.domain0.max_interval = 2

kernel.sched_domain.cpu1.domain0.min_interval = 1

kernel.sched_domain.cpu1.domain0.name = SIBLING

kernel.sched_domain.cpu1.domain0.newidle_idx = 0

kernel.sched_domain.cpu1.domain0.wake_idx = 0

kernel.sched_domain.cpu1.domain1.busy_factor = 64

kernel.sched_domain.cpu1.domain1.busy_idx = 2

kernel.sched_domain.cpu1.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu1.domain1.flags = 559

kernel.sched_domain.cpu1.domain1.forkexec_idx = 0

kernel.sched_domain.cpu1.domain1.idle_idx = 0

kernel.sched_domain.cpu1.domain1.imbalance_pct = 125

kernel.sched_domain.cpu1.domain1.max_interval = 4

kernel.sched_domain.cpu1.domain1.min_interval = 1

kernel.sched_domain.cpu1.domain1.name = MC

kernel.sched_domain.cpu1.domain1.newidle_idx = 0

kernel.sched_domain.cpu1.domain1.wake_idx = 0

kernel.sched_domain.cpu10.domain0.busy_factor = 64

kernel.sched_domain.cpu10.domain0.busy_idx = 0

kernel.sched_domain.cpu10.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu10.domain0.flags = 687

kernel.sched_domain.cpu10.domain0.forkexec_idx = 0

kernel.sched_domain.cpu10.domain0.idle_idx = 0

kernel.sched_domain.cpu10.domain0.imbalance_pct = 110

kernel.sched_domain.cpu10.domain0.max_interval = 2

kernel.sched_domain.cpu10.domain0.min_interval = 1

kernel.sched_domain.cpu10.domain0.name = SIBLING

kernel.sched_domain.cpu10.domain0.newidle_idx = 0

kernel.sched_domain.cpu10.domain0.wake_idx = 0

kernel.sched_domain.cpu10.domain1.busy_factor = 64

kernel.sched_domain.cpu10.domain1.busy_idx = 2

kernel.sched_domain.cpu10.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu10.domain1.flags = 559

kernel.sched_domain.cpu10.domain1.forkexec_idx = 0

kernel.sched_domain.cpu10.domain1.idle_idx = 0

kernel.sched_domain.cpu10.domain1.imbalance_pct = 125

kernel.sched_domain.cpu10.domain1.max_interval = 4

kernel.sched_domain.cpu10.domain1.min_interval = 1

kernel.sched_domain.cpu10.domain1.name = MC

kernel.sched_domain.cpu10.domain1.newidle_idx = 0

kernel.sched_domain.cpu10.domain1.wake_idx = 0

kernel.sched_domain.cpu11.domain0.busy_factor = 64

kernel.sched_domain.cpu11.domain0.busy_idx = 0

kernel.sched_domain.cpu11.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu11.domain0.flags = 687

kernel.sched_domain.cpu11.domain0.forkexec_idx = 0

kernel.sched_domain.cpu11.domain0.idle_idx = 0

kernel.sched_domain.cpu11.domain0.imbalance_pct = 110

kernel.sched_domain.cpu11.domain0.max_interval = 2

kernel.sched_domain.cpu11.domain0.min_interval = 1

kernel.sched_domain.cpu11.domain0.name = SIBLING

kernel.sched_domain.cpu11.domain0.newidle_idx = 0

kernel.sched_domain.cpu11.domain0.wake_idx = 0

kernel.sched_domain.cpu11.domain1.busy_factor = 64

kernel.sched_domain.cpu11.domain1.busy_idx = 2

kernel.sched_domain.cpu11.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu11.domain1.flags = 559

kernel.sched_domain.cpu11.domain1.forkexec_idx = 0

kernel.sched_domain.cpu11.domain1.idle_idx = 0

kernel.sched_domain.cpu11.domain1.imbalance_pct = 125

kernel.sched_domain.cpu11.domain1.max_interval = 4

kernel.sched_domain.cpu11.domain1.min_interval = 1

kernel.sched_domain.cpu11.domain1.name = MC

kernel.sched_domain.cpu11.domain1.newidle_idx = 0

kernel.sched_domain.cpu11.domain1.wake_idx = 0

kernel.sched_domain.cpu2.domain0.busy_factor = 64

kernel.sched_domain.cpu2.domain0.busy_idx = 0

kernel.sched_domain.cpu2.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu2.domain0.flags = 687

kernel.sched_domain.cpu2.domain0.forkexec_idx = 0

kernel.sched_domain.cpu2.domain0.idle_idx = 0

kernel.sched_domain.cpu2.domain0.imbalance_pct = 110

kernel.sched_domain.cpu2.domain0.max_interval = 2

kernel.sched_domain.cpu2.domain0.min_interval = 1

kernel.sched_domain.cpu2.domain0.name = SIBLING

kernel.sched_domain.cpu2.domain0.newidle_idx = 0

kernel.sched_domain.cpu2.domain0.wake_idx = 0

kernel.sched_domain.cpu2.domain1.busy_factor = 64

kernel.sched_domain.cpu2.domain1.busy_idx = 2

kernel.sched_domain.cpu2.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu2.domain1.flags = 559

kernel.sched_domain.cpu2.domain1.forkexec_idx = 0

kernel.sched_domain.cpu2.domain1.idle_idx = 0

kernel.sched_domain.cpu2.domain1.imbalance_pct = 125

kernel.sched_domain.cpu2.domain1.max_interval = 4

kernel.sched_domain.cpu2.domain1.min_interval = 1

kernel.sched_domain.cpu2.domain1.name = MC

kernel.sched_domain.cpu2.domain1.newidle_idx = 0

kernel.sched_domain.cpu2.domain1.wake_idx = 0

kernel.sched_domain.cpu3.domain0.busy_factor = 64

kernel.sched_domain.cpu3.domain0.busy_idx = 0

kernel.sched_domain.cpu3.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu3.domain0.flags = 687

kernel.sched_domain.cpu3.domain0.forkexec_idx = 0

kernel.sched_domain.cpu3.domain0.idle_idx = 0

kernel.sched_domain.cpu3.domain0.imbalance_pct = 110

kernel.sched_domain.cpu3.domain0.max_interval = 2

kernel.sched_domain.cpu3.domain0.min_interval = 1

kernel.sched_domain.cpu3.domain0.name = SIBLING

kernel.sched_domain.cpu3.domain0.newidle_idx = 0

kernel.sched_domain.cpu3.domain0.wake_idx = 0

kernel.sched_domain.cpu3.domain1.busy_factor = 64

kernel.sched_domain.cpu3.domain1.busy_idx = 2

kernel.sched_domain.cpu3.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu3.domain1.flags = 559

kernel.sched_domain.cpu3.domain1.forkexec_idx = 0

kernel.sched_domain.cpu3.domain1.idle_idx = 0

kernel.sched_domain.cpu3.domain1.imbalance_pct = 125

kernel.sched_domain.cpu3.domain1.max_interval = 4

kernel.sched_domain.cpu3.domain1.min_interval = 1

kernel.sched_domain.cpu3.domain1.name = MC

kernel.sched_domain.cpu3.domain1.newidle_idx = 0

kernel.sched_domain.cpu3.domain1.wake_idx = 0

kernel.sched_domain.cpu4.domain0.busy_factor = 64

kernel.sched_domain.cpu4.domain0.busy_idx = 0

kernel.sched_domain.cpu4.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu4.domain0.flags = 687

kernel.sched_domain.cpu4.domain0.forkexec_idx = 0

kernel.sched_domain.cpu4.domain0.idle_idx = 0

kernel.sched_domain.cpu4.domain0.imbalance_pct = 110

kernel.sched_domain.cpu4.domain0.max_interval = 2

kernel.sched_domain.cpu4.domain0.min_interval = 1

kernel.sched_domain.cpu4.domain0.name = SIBLING

kernel.sched_domain.cpu4.domain0.newidle_idx = 0

kernel.sched_domain.cpu4.domain0.wake_idx = 0

kernel.sched_domain.cpu4.domain1.busy_factor = 64

kernel.sched_domain.cpu4.domain1.busy_idx = 2

kernel.sched_domain.cpu4.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu4.domain1.flags = 559

kernel.sched_domain.cpu4.domain1.forkexec_idx = 0

kernel.sched_domain.cpu4.domain1.idle_idx = 0

kernel.sched_domain.cpu4.domain1.imbalance_pct = 125

kernel.sched_domain.cpu4.domain1.max_interval = 4

kernel.sched_domain.cpu4.domain1.min_interval = 1

kernel.sched_domain.cpu4.domain1.name = MC

kernel.sched_domain.cpu4.domain1.newidle_idx = 0

kernel.sched_domain.cpu4.domain1.wake_idx = 0

kernel.sched_domain.cpu5.domain0.busy_factor = 64

kernel.sched_domain.cpu5.domain0.busy_idx = 0

kernel.sched_domain.cpu5.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu5.domain0.flags = 687

kernel.sched_domain.cpu5.domain0.forkexec_idx = 0

kernel.sched_domain.cpu5.domain0.idle_idx = 0

kernel.sched_domain.cpu5.domain0.imbalance_pct = 110

kernel.sched_domain.cpu5.domain0.max_interval = 2

kernel.sched_domain.cpu5.domain0.min_interval = 1

kernel.sched_domain.cpu5.domain0.name = SIBLING

kernel.sched_domain.cpu5.domain0.newidle_idx = 0

kernel.sched_domain.cpu5.domain0.wake_idx = 0

kernel.sched_domain.cpu5.domain1.busy_factor = 64

kernel.sched_domain.cpu5.domain1.busy_idx = 2

kernel.sched_domain.cpu5.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu5.domain1.flags = 559

kernel.sched_domain.cpu5.domain1.forkexec_idx = 0

kernel.sched_domain.cpu5.domain1.idle_idx = 0

kernel.sched_domain.cpu5.domain1.imbalance_pct = 125

kernel.sched_domain.cpu5.domain1.max_interval = 4

kernel.sched_domain.cpu5.domain1.min_interval = 1

kernel.sched_domain.cpu5.domain1.name = MC

kernel.sched_domain.cpu5.domain1.newidle_idx = 0

kernel.sched_domain.cpu5.domain1.wake_idx = 0

kernel.sched_domain.cpu6.domain0.busy_factor = 64

kernel.sched_domain.cpu6.domain0.busy_idx = 0

kernel.sched_domain.cpu6.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu6.domain0.flags = 687

kernel.sched_domain.cpu6.domain0.forkexec_idx = 0

kernel.sched_domain.cpu6.domain0.idle_idx = 0

kernel.sched_domain.cpu6.domain0.imbalance_pct = 110

kernel.sched_domain.cpu6.domain0.max_interval = 2

kernel.sched_domain.cpu6.domain0.min_interval = 1

kernel.sched_domain.cpu6.domain0.name = SIBLING

kernel.sched_domain.cpu6.domain0.newidle_idx = 0

kernel.sched_domain.cpu6.domain0.wake_idx = 0

kernel.sched_domain.cpu6.domain1.busy_factor = 64

kernel.sched_domain.cpu6.domain1.busy_idx = 2

kernel.sched_domain.cpu6.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu6.domain1.flags = 559

kernel.sched_domain.cpu6.domain1.forkexec_idx = 0

kernel.sched_domain.cpu6.domain1.idle_idx = 0

kernel.sched_domain.cpu6.domain1.imbalance_pct = 125

kernel.sched_domain.cpu6.domain1.max_interval = 4

kernel.sched_domain.cpu6.domain1.min_interval = 1

kernel.sched_domain.cpu6.domain1.name = MC

kernel.sched_domain.cpu6.domain1.newidle_idx = 0

kernel.sched_domain.cpu6.domain1.wake_idx = 0

kernel.sched_domain.cpu7.domain0.busy_factor = 64

kernel.sched_domain.cpu7.domain0.busy_idx = 0

kernel.sched_domain.cpu7.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu7.domain0.flags = 687

kernel.sched_domain.cpu7.domain0.forkexec_idx = 0

kernel.sched_domain.cpu7.domain0.idle_idx = 0

kernel.sched_domain.cpu7.domain0.imbalance_pct = 110

kernel.sched_domain.cpu7.domain0.max_interval = 2

kernel.sched_domain.cpu7.domain0.min_interval = 1

kernel.sched_domain.cpu7.domain0.name = SIBLING

kernel.sched_domain.cpu7.domain0.newidle_idx = 0

kernel.sched_domain.cpu7.domain0.wake_idx = 0

kernel.sched_domain.cpu7.domain1.busy_factor = 64

kernel.sched_domain.cpu7.domain1.busy_idx = 2

kernel.sched_domain.cpu7.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu7.domain1.flags = 559

kernel.sched_domain.cpu7.domain1.forkexec_idx = 0

kernel.sched_domain.cpu7.domain1.idle_idx = 0

kernel.sched_domain.cpu7.domain1.imbalance_pct = 125

kernel.sched_domain.cpu7.domain1.max_interval = 4

kernel.sched_domain.cpu7.domain1.min_interval = 1

kernel.sched_domain.cpu7.domain1.name = MC

kernel.sched_domain.cpu7.domain1.newidle_idx = 0

kernel.sched_domain.cpu7.domain1.wake_idx = 0

kernel.sched_domain.cpu8.domain0.busy_factor = 64

kernel.sched_domain.cpu8.domain0.busy_idx = 0

kernel.sched_domain.cpu8.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu8.domain0.flags = 687

kernel.sched_domain.cpu8.domain0.forkexec_idx = 0

kernel.sched_domain.cpu8.domain0.idle_idx = 0

kernel.sched_domain.cpu8.domain0.imbalance_pct = 110

kernel.sched_domain.cpu8.domain0.max_interval = 2

kernel.sched_domain.cpu8.domain0.min_interval = 1

kernel.sched_domain.cpu8.domain0.name = SIBLING

kernel.sched_domain.cpu8.domain0.newidle_idx = 0

kernel.sched_domain.cpu8.domain0.wake_idx = 0

kernel.sched_domain.cpu8.domain1.busy_factor = 64

kernel.sched_domain.cpu8.domain1.busy_idx = 2

sysctl: kernel.sched_domain.cpu8.domain1.cache_nice_tries = 1

permission denied on key 'kernel.usermodehelper.bset'kernel.sched_domain.cpu8.domain1.flags = 559

kernel.sched_domain.cpu8.domain1.forkexec_idx = 0

kernel.sched_domain.cpu8.domain1.idle_idx = 0

sysctl: kernel.sched_domain.cpu8.domain1.imbalance_pct = 125

permission denied on key 'kernel.usermodehelper.inheritable'kernel.sched_domain.cpu8.domain1.max_interval = 4

kernel.sched_domain.cpu8.domain1.min_interval = 1

kernel.sched_domain.cpu8.domain1.name = MC

kernel.sched_domain.cpu8.domain1.newidle_idx = 0

kernel.sched_domain.cpu8.domain1.wake_idx = 0

kernel.sched_domain.cpu9.domain0.busy_factor = 64

kernel.sched_domain.cpu9.domain0.busy_idx = 0

kernel.sched_domain.cpu9.domain0.cache_nice_tries = 0

kernel.sched_domain.cpu9.domain0.flags = 687

kernel.sched_domain.cpu9.domain0.forkexec_idx = 0

kernel.sched_domain.cpu9.domain0.idle_idx = 0

kernel.sched_domain.cpu9.domain0.imbalance_pct = 110

kernel.sched_domain.cpu9.domain0.max_interval = 2

kernel.sched_domain.cpu9.domain0.min_interval = 1

kernel.sched_domain.cpu9.domain0.name = SIBLING

kernel.sched_domain.cpu9.domain0.newidle_idx = 0

kernel.sched_domain.cpu9.domain0.wake_idx = 0

kernel.sched_domain.cpu9.domain1.busy_factor = 64

kernel.sched_domain.cpu9.domain1.busy_idx = 2

kernel.sched_domain.cpu9.domain1.cache_nice_tries = 1

kernel.sched_domain.cpu9.domain1.flags = 559

kernel.sched_domain.cpu9.domain1.forkexec_idx = 0

kernel.sched_domain.cpu9.domain1.idle_idx = 0

kernel.sched_domain.cpu9.domain1.imbalance_pct = 125

kernel.sched_domain.cpu9.domain1.max_interval = 4

kernel.sched_domain.cpu9.domain1.min_interval = 1

kernel.sched_domain.cpu9.domain1.name = MC

kernel.sched_domain.cpu9.domain1.newidle_idx = 0

kernel.sched_domain.cpu9.domain1.wake_idx = 0

net.core.flow_limit_cpu_bitmap = 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000

sysctl: permission denied on key 'net.ipv4.tcp_fastopen_key'

vm.percpu_pagelist_fraction = 0

rootroot@cm-System-Product-Name:~$

如果CPU是多核,如何查看各颗CPU的运行状态:

[liuqian@SYQceshi03 ~] top

last pid: 42028;  load averages:  0.83,  1.66,  1.71                                                                        up 168+04:04:19 15:08:58

163 processes: 1 running, 160 sleeping, 2 stopped

CPU:  2.9% user,  0.0% nice,  1.2% system,  0.0% interrupt, 95.9% idle

Mem: 653M Active, 2302M Inact, 669M Wired, 27M Cache, 786M Buf, 291M Free

Swap: 4096M Total, 2673M Used, 1423M Free, 65% Inuse

PID USERNAME       THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND

768 mysql           42  20    0   781M   186M uwait   0  43.3H   0.00% mysqld

943 mongodb         10  20    0   650M  4880K uwait   0 457:16   0.00% mongod88098 root            17  52    0  2517M 40824K uwait   1 335:57   0.00% java

87136 root            17  20    0  2537M 40976K uwait   0 335:47   0.00% java

88884 root            17  52    0  2517M 40992K uwait   1 335:02   0.00% java

88733 root            17  52    0  2529M 40672K uwait   1 333:07   0.00% java

从上面的结果,可以知道,这是一颗双核的 CPU(看 C 那列的值的个数)

rootroot@cm-System-Product-Name:~$

(ubuntu下支持不好!!!!????)

rootroot@cm-System-Product-Name:~$ top

top - 14:10:43 up  5:12,  5 users,  load average: 0.82, 1.52, 0.76

Tasks: 293 total,   1 running, 292 sleeping,   0 stopped,   0 zombie

%Cpu(s):  0.5 us,  0.1 sy,  0.0 ni, 97.8 id,  1.5 wa,  0.0 hi,  0.0 si,  0.0 st

KiB Mem:  16373468 total, 15632456 used,   741012 free,  3917972 buffers

KiB Swap:  4687868 total,    16024 used,  4671844 free.  7148628 cached Mem

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND

20438 rootroot  20   0   29284   1672   1056 R  12.6  0.0   0:00.02 top

1 root      20   0   33956   2796   1380 S   0.0  0.0   0:01.21 init

2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd

3 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ksoftirqd/0

5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H

7 root      20   0       0      0      0 S   0.0  0.0   0:06.37 rcu_sched

8 root      20   0       0      0      0 S   0.0  0.0   0:01.25 rcuos/0

9 root      20   0       0      0      0 S   0.0  0.0   0:01.25 rcuos/1

10 root      20   0       0      0      0 S   0.0  0.0   0:02.94 rcuos/2

11 root      20   0       0      0      0 S   0.0  0.0   0:06.37 rcuos/3

12 root      20   0       0      0      0 S   0.0  0.0   0:07.15 rcuos/4

13 root      20   0       0      0      0 S   0.0  0.0   0:01.76 rcuos/5

14 root      20   0       0      0      0 S   0.0  0.0   0:00.99 rcuos/6

15 root      20   0       0      0      0 S   0.0  0.0   0:00.87 rcuos/7

16 root      20   0       0      0      0 S   0.0  0.0   0:00.89 rcuos/8

17 root      20   0       0      0      0 S   0.0  0.0   0:00.85 rcuos/9

18 root      20   0       0      0      0 S   0.0  0.0   0:00.92 rcuos/10

19 root      20   0       0      0      0 S   0.0  0.0   0:00.74 rcuos/11

20 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh

21 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/0

22 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/1

23 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/2

24 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/3

25 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/4

26 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/5

27 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/6

28 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/7

29 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/8

30 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/9

31 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/10

32 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/11

33 root      rt   0       0      0      0 S   0.0  0.0   0:00.15 migration/0

34 root      rt   0       0      0      0 S   0.0  0.0   0:00.07 watchdog/0

35 root      rt   0       0      0      0 S   0.0  0.0   0:00.06 watchdog/1

36 root      rt   0       0      0      0 S   0.0  0.0   0:00.13 migration/1

37 root      20   0       0      0      0 S   0.0  0.0   0:00.00 ksoftirqd/1

rootroot@cm-System-Product-Name:~$

04-25 07:21