查看cpu:
# 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数# 查看物理CPU个数cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l# 查看每个物理CPU中core的个数(即核数)cat /proc/cpuinfo| grep "cpu cores"| uniq# 查看逻辑CPU的个数cat /proc/cpuinfo| grep "processor"| wc -l# 查看CPU信息(型号)cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
结果:
[root@10 ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l4[root@10 ~]# cat /proc/cpuinfo| grep "cpu cores"| uniqcpu cores : 4[root@10 ~]# cat /proc/cpuinfo| grep "processor"| wc -l16[root@10 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 16 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
查看cpu实时使用:
top
结果:
top - 09:30:33 up 90 days, 23:30, 4 users, load average: 2.08, 2.17, 3.02Tasks: 320 total, 2 running, 318 sleeping, 0 stopped, 0 zombie%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 stKiB Mem : 65808120 total, 12818916 free, 17110548 used, 35878656 buff/cacheKiB Swap: 4063228 total, 4063132 free, 96 used. 47484696 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 11580 rocketmq 20 0 32.889g 6.817g 2.430g S 1.7 10.9 17:02.07 java 16181 elk 20 0 8615752 0.977g 18256 S 1.3 1.6 134:42.09 java 13253 rocketmq 20 0 9096544 561388 15500 S 0.3 0.9 1:24.11 java 27256 elk 20 0 11.089g 1.927g 138140 S 0.3 3.1 68:06.31 java 30954 zuul 20 0 12.753g 2.004g 14392 S 0.3 3.2 177:53.75 java 1 root 20 0 193656 6720 3908 S 0.0 0.0 4:55.84 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:02.14 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:02.54 ksoftirqd/0
查看内存:
cat /proc/meminfo
结果:
MemTotal: 65808120 kBMemFree: 12804772 kBMemAvailable: 47470588 kBBuffers: 132 kBCached: 34063540 kBSwapCached: 4 kBActive: 34338292 kBInactive: 14446612 kBActive(anon): 13535808 kBInactive(anon): 1570584 kBActive(file): 20802484 kBInactive(file): 12876028 kBUnevictable: 1649164 kBMlocked: 1649164 kBSwapTotal: 4063228 kBSwapFree: 4063132 kBDirty: 108 kBWriteback: 0 kBAnonPages: 16370448 kBMapped: 2841072 kBShmem: 258000 kBSlab: 1815012 kBSReclaimable: 1595996 kBSUnreclaim: 219016 kBKernelStack: 21696 kBPageTables: 68456 kBNFS_Unstable: 0 kBBounce: 0 kBWritebackTmp: 0 kBCommitLimit: 36967288 kBCommitted_AS: 26694944 kBVmallocTotal: 34359738367 kBVmallocUsed: 257500 kBVmallocChunk: 34308747260 kBHardwareCorrupted: 0 kBAnonHugePages: 14931968 kBHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBDirectMap4k: 307136 kBDirectMap2M: 28004352 kBDirectMap1G: 40894464 kB
查看剩余内存:
#-m代表M单位,-g代表G单位 free -m
结果:
[root@10 ~]# free -m total used free shared buff/cache availableMem: 64265 47209 275 3250 16781 13082Swap: 3967 944 3023
查看硬盘信息:
fdisk -l
结果:
[root@10 ~]# fdisk -l磁盘 /dev/sda:53.7 GB, 53687091200 字节,104857600 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos磁盘标识符:0x000d7a33 设备 Boot Start End Blocks Id System/dev/sda1 * 2048 1026047 512000 83 Linux/dev/sda2 1026048 104857599 51915776 8e Linux LVM
查看硬盘使用情况:
df -h
结果:
[root@10 ~]# df -h文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/cl-root 36G 22G 15G 61% /devtmpfs 32G 0 32G 0% /devtmpfs 32G 84K 32G 1% /dev/shmtmpfs 32G 3.2G 29G 11% /runtmpfs 32G 0 32G 0% /sys/fs/cgroup/dev/sda1 497M 167M 330M 34% /boot
查看磁盘io:
ulimit -a
结果:
[root@10 ~]# ulimit -acore file size (blocks, -c) 0data seg size (kbytes, -d) unlimitedscheduling priority (-e) 0file size (blocks, -f) unlimitedpending signals (-i) 256939max locked memory (kbytes, -l) 64max memory size (kbytes, -m) unlimitedopen files (-n) 1024pipe size (512 bytes, -p) 8POSIX message queues (bytes, -q) 819200real-time priority (-r) 0stack size (kbytes, -s) 8192cpu time (seconds, -t) unlimitedmax user processes (-u) 256939virtual memory (kbytes, -v) unlimitedfile locks (-x) unlimited
查看磁盘实时io:
iostat -x 10
结果:
[root@10 ~]# iostat -x 10Linux 3.10.0-514.el7.x86_64 (10.1.4.34) 2018年08月31日 _x86_64_ (16 CPU)avg-cpu: %user %nice %system %iowait %steal %idle 0.35 0.00 0.10 0.03 0.00 99.52Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %utilfd0 0.00 0.00 0.00 0.00 0.00 0.00 8.00 0.00 51.00 51.00 0.00 51.00 0.00sda 0.00 0.25 0.01 2.14 0.54 19.79 18.86 0.09 40.32 18.75 40.42 10.47 2.26sdb 0.00 0.03 0.02 0.38 0.67 30.53 157.34 0.03 81.85 21.18 84.33 24.41 0.97dm-0 0.00 0.00 0.01 2.33 0.53 19.21 16.86 0.10 43.52 18.65 43.62 9.45 2.21dm-1 0.00 0.00 0.00 0.02 0.00 0.07 8.00 0.00 101.44 51.71 103.51 0.72 0.00dm-2 0.00 0.00 0.02 0.46 0.67 31.04 133.44 0.04 81.26 21.28 83.30 21.32 1.01dm-3 0.00 0.00 0.00 0.00 0.00 0.00 41.44 0.00 60.70 1.44 221.01 52.24 0.00dm-4 0.00 0.00 0.00 0.00 0.00 0.00 43.26 0.00 63.92 1.49 253.16 55.01 0.00