2020年5月14日 星期四

How to check hardware information (CPU/MEM/Disk/PCIE card) by command under linux

How to check hardware information (CPU/MEM/Disk/PCIE card) by command under linux


How many physical cpu install
# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2

Cpu core number 
# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 2
# cat /proc/cpuinfo| grep "cpu cores"| uniq | awk {'print $4'}
2

Total CPU logical core
# cat /proc/cpuinfo| grep "processor"| wc -l
4

CPU model
#cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      4  Intel(R) Xeon(R) Platinum 8170 CPU @ 2.10GHz

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c |  awk {'print $5'}
8170

CPU code name

#cat /sys/devices/cpu/caps/pmu_name
Skylake , Haswell

CPU TDP (Need PTU linux tool)
./ptumon -s | grep -i "package tdp" | awk {'print$4'}

CPU turbo frequency
#dmidecode | grep -I "max speed" | tr -d "\n" | awk {'print$3'}


memory brand:
#dmidecode -t memory | grep -i manufacturer | tr -d "\n" | awk {'print$2'}


memory model
#dmidecode -t memory | grep -i part | tr -d "\n" | awk {'print$3'}

memory single size 
#dmidecode -t memory | grep -i size | tr -d "\n" | awk {'print$2'}

memory speed
#dmidecode -t memory | grep -i speed | tr -d "\n" | awk {'print$2'}


memory type & speed
# lshw | grep -i *-bank:0 -A 2 | sed '2!d' | awk {'print$3"-"$5'}

DDR4-2666

memory total size
#lshw -class memory | grep -i "system memory" -A 5 | sed '4!d' | awk {'print$2'}

memory slots
#midecode -t memory | grep -i part | wc -l 

Disk model

#lsblk --nodeps -o model | sed '2!d'  

Detail disk information
#smart -a /dev/yourdrive

Disk IO performance

#iostat -m

PCIE card 
# lspci | grep -i ethernet ; lspci | grep -i raid ; lspci | grep -i vga 
 

2020年5月12日 星期二

Sysbench

Sysbench

Setup :
#yum -y remove mariadb-libs

#yum install mysql-community-server -y
#yum install mysql-community-devel.x86_64
#service mysqld restart
#cd sysbench-0.4.12.14
#./autogen.sh
#./configure --with-mysql
#make 
#make install
-------------------------------------------------------------------------------
Running:

CPU benchmark
#sysbench --test=cpu --cpu-max-prime=20000 --max-time=120 run


Memory benchmark
#sysbench --test=memory  --max-time=120 run

IO benchmark
#sysbench --test=fileio --file-total-size=1G --file-test-mode=rndrw prepare

#sysbench --test=fileio --file-total-size=1G --file-test-mode=rndrw run

Clean the test file
#sysbench --test=fileio --file-total-size=1G --file-test-mode=rndrw cleanup

MySQL benchmark
#vim /etc/my.cnf
add new line under [mysqld] 
skip-grant-tables
# service mysqld restart
#mysql -u root -p
Input Aa123456
mysql>create database sbtest;

Execute in another terminal
#sysbench --test=oltp --db-driver=mysql --oltp-table-size=10000 --mysql-db=sbtest --mysql-user=root --mysql-password=Aa123456 prepare
#sysbench --test=oltp --db-driver=mysql --oltp-table-size=10000 --mysql-db=sbtest --mysql-user=root --mysql-password=Aa123456 run

Clean the test file
#sysbench --test=oltp --db-driver=mysql --oltp-table-size=10000 --mysql-db=sbtest --mysql-user=root --mysql-password=Aa123456 cleanup

Unixbench

Unixbench

https://code.google.com/archive/p/byte-unixbench/downloads 
(download 5.1.3 version)


#tar zxvf unixbench-5.1.3.tar.gz
#cd unixbench-5.1.3
#make
#./Run

It will run about 1 hour.

GPU burn

GPU burn


Install driver
Install cuda


Check all well by listing your GPUs (Command 1 below) and checking the properties of GPUs ( Command 2 below) , and checking nvcc is setup (Command 3 below). If you don’t get a meaningful response, most likely something is off with your environment variables or worst case your driver / CUDA version
  1. nvidia-smi
  2. nvidia-smi -q
  3. nvcc -V

Download gpu burn from 

#unzip gpu-burn-master.zip
#cd gpu-burn-master
#make


Running GPU Burn (Few example commands below)
  1.  ./gpu_burn  (Single precision GPU burn for 10 seconds)
  2. ./gpu_burn -d ( Double precision GPU burn for 10 seconds)
  3. ./gpu_burn 120 (Single precision GPU burn for 120 seconds)

(TOP)Temp for soulin only

123