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:~$

ubuntu下查看服务器的CPU详细情况的更多相关文章

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

    1. 查看 Linux 服务器的 CPU 详细情况 判断依据: 具有相同的 core id 的 CPU 是同意个 core 超线程. 具有相同的 physical id 的 CPU 是同一个 CPU ...

  2. Ubuntu下查看服务器cpu是否支持VT

    http://blog.51cto.com/zhangmingqian/1249522 Ubuntu下查看服务器cpu是否支持VT 原创wazjajl 2013-07-15 16:25评论(0)119 ...

  3. Linux下查看内核、CPU、内存及各组件版本的命令和方法

    Linux下查看内核.CPU.内存及各组件版本的命令和方法 Linux查看内核版本: uname -a                        more /etc/*release       ...

  4. 怎么查看服务器的cpu和内存的硬件信息

    在linux 下怎么查看服务器的cpu和内存的硬件信息     可以按照如下方式进行操作: 一.查看cpu总个数方法: 1.首先执行top命令,如下图中内容所表示. 2.在top命令的显示界面,按数字 ...

  5. Ubuntu下查看软件版本及安装位置【转】

    Ubuntu下查看软件版本及安装位置 查看软件版本:     aptitude show xxx 也可用apt-show-versions (要先安装sudo apt-get install apt- ...

  6. Ubuntu下Zabbix服务器监控工具部署

    Ubuntu下Zabbix服务器监控工具部署 一 安装安装Apache.Mysql.Php.zabbix sudo apt-get update sudo apt-get install apache ...

  7. 性能测试分析过程(三)linux下查看最消耗CPU/内存的进程

    linux下查看最消耗CPU  内存的进程 1.CPU占用最多的前10个进程:  ps auxw|head -1;ps auxw|sort -rn -k3|head -10  2.内存消耗最多的前10 ...

  8. Ubuntu下查看so文件的函数列表

    Ubuntu下查看so文件的函数列表   可使用如下命令: 1.nm -D XXX.so 2.objdump -tT  XXX.so   nm libcyusb.so | grep "usb ...

  9. ubuntu下apache服务器操作方法小结,具有参考借鉴价值

    这篇文章主要介绍了ubuntu下apache服务器操作方法小结,非常不错,具有参考借鉴价值,需要的朋友可以参考下(http://www.0831jl.com)Linux系统为Ubuntu 一.Star ...

随机推荐

  1. MongoDB小结15 - find【查询条件$ne】

    $ne表示不相等 db.user.find({"name":{"$ne":"william"}})

  2. Redis官网下载步骤(含windows版)

    ①.百度redis ,进入官网 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  3. 在Linux上安装zsh

    简单介绍: 相对于绝大多数linux发行版默认的shell--bash,zsh绝对是一个优秀的替代品.zsh是交互型shell,同一时候它也是一个强大的编程语言,很多bash,ksh,tcsh优秀的地 ...

  4. JAVA 学习 IDEA安装及破解

    1.到官网下载安装包 网址:https://www.jetbrains.com/idea/download/#section=windows 选择  “”Ultimate “”这个版本点击“Downl ...

  5. unity3D游戏开发实战原创视频讲座系列13之帽子戏法游戏开发(预告)

    文件夹 第一讲  游戏演示项目创建 第二讲 游戏场景的编辑 第三讲  帽子的移动 第四讲  炮弹的产生 第六讲  游戏界面的完好 第七讲 各种UI的制作 第八讲  分数和爆炸特效   视持续更新中.. ...

  6. Codeforces Round #319 (Div. 2) C. Vasya and Petya's Game 数学题

                                                     C. Vasya and Petya's Game                           ...

  7. 【OI】对拍

    对拍的方法是先用生成器生成几组随机数据,然后用暴力算法和当前算法对比结果来确保正确性. 数据生成器: 引入cstdlib与ctime两个库,然后通过srand初始化随机数: srand(time(0) ...

  8. 容器ArrayList原理(学习)

    一.概述 动态数组,容量能动态增长,元素可以为null,用数组存储,非线程同步(vector线程同步) 每个 ArrayList 实例都有一个容量,该容量是指用来存储列表元素的数组的大小,自动增长(默 ...

  9. Spring 的Bean管理的常用注解

    属性注入的注解(使用注解注入的方式,可以不用提供set方法) @Value 用于注入普通类型 @Autowired 自动装配 :默认按类型进行装配  按名称注入 @Qualifier 强制使用名称注入 ...

  10. Linux在终端启动程序关闭终端不退出的方法

    一般情况下关闭终端时,那么在这个终端中启动的后台程序也会终止,要使终端关闭后,后台程序保持执行,使用这个指令: nohup 命令 & 如:nohup ./studio.sh & 网上其 ...