一、查看分区磁盘的速度命令
$ hdparm -Tt /dev/sda1
在终端打印出如下信息:
/dev/sda1:
Timing cached reads: 1770 MB in 2.00 seconds = 885.55 MB/sec
Timing buffered disk reads: 218 MB in 3.03 seconds = 71.92 MB/sec
二、查看 ubuntu 配置信息
Linux查看物理CPU个数、核数、逻辑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
# 查看内存信息
cat /proc/meminfo
CPU:
型号:grep "model name" /proc/cpuinfo |awk -F ':' '{print $NF}'
数量:lscpu | grep "CPU socket" | awk '{print $NF}' 或 lscpu | grep "Socket" | awk '{print $NF}'
每个CPU的核数:lscpu |grep "Core(s) per socket" |awk '{print $NF}'
内存:
卡槽数量:sudo dmidecode -t memory | grep "Number Of Devices" |awk '{print $NF}' 或 sudo dmidecode -t memory |grep "Associated Memory Slots" |awk '{print $NF}'
内存数量:sudo dmidecode -t memory | grep -A16 "Memory Device$" |grep 'Size:.*MB' |wc -l
内存型号:
内存支持类型:sudo dmidecode -t memory | grep -A16 "Memory Device$" | grep "Type:"
每个内存频率:sudo dmidecode -t memory | grep -A16 "Memory Device$" | grep "Speed:"
每个内存大小:sudo dmidecode -t memory | grep -A16 "Memory Device$" | grep "Size:"
释放缓冲区内存:echo 3 > /proc/sys/vm/drop_caches
硬盘:
硬盘数量、大小:sudo fdisk -l |grep "Disk /dev/sd"
硬盘型号:sudo hdparm -i /dev/sda |grep "Model"