##hardware profiling前端
##RH442 Getting to know your hardware緩存
###Hardware profiling Before tuning the performance, it's important to understand the capabilities of your system CPU 內部寄存器:硬件,時鐘週期一致.1級緩存:靜態內存,2級緩存:動態高速內存 Memory 相對緩存更慢 Storage 更慢 到磁盤,終止。 Farthe from CPU,slower,bigger,less frequently accessed Three elements of X86 machine, the ways to use system 針對X86結構 I/O address IRQ DMA架構
###CPU profile 指標app
grep CPU /proc/cpuinfoless
model name : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzsocket
model name : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzide
Model,Hz 操做系統認爲你有兩個cpu,Hz是跑步的頻率,步子多大無關係 Caches size, L1, L2, L3, private or shared >lscpu >L1d cache:32k L1緩存分爲數據緩存 >L1i cache:32k &指令緩存 >L2 cache:3072K >cpu(s):4 cpu數量爲1 >Thread(s) per core:1 每顆物理CPU,1爲無超線程 >Core(s) per socket:2 每顆物理CPU有兩個核心 >Socket(s):2 兩顆物理CPU CPU features-VT,Architecture 虛擬化,架構64/32 >是否支持64 cat /proc/cpuinfo |egrep '(lm)|(pae)' Motherboard chipset 主板芯片組,決定主板和CPU效率 No.of sockets,cores,hyper thereading support Interconnect between sockets 物理CPU多顆時。前端總線聯繫FSB/qpi/amd 物理CPU之間通信手段
###TOP CPUsui
intel E7-8830 8 cores,16 threads 8核,16線程 24M cache, 2.13 GHz,QPI AMD 6284 SE 16 cores 16M cache 2.7GHz
##Memory profile 內存操作系統
Memory size, max allowed > free -m >cat /proc/meminfo Memory technology,bandwidth and latency 內存第幾代技術,以及帶寬延時 >DDR2(2 bits),DDR3(4bits),DDR4(8 bits),Rambus(pS/2) >Latency(wait time before read agin,in ns) 反映速度 納秒級 列刷新頻率 >ECC 內存故障修復 發現內存位失效 糾正 減速 slower safer Method of memory accessing- UMA NUMA 頻率/2=速率 2133/2~~ 1G UMA or SMP >MCH 內存控制器 速度瓶頸 pcieX16 顯卡佔用 卡死了 這是北橋 >ICH 南橋連外設 sata usb pcie*1 NUMA 架構 >兩個CPU本身管理本身內存,MCH內置到CPU >IOH 僞北橋,IO控制器 >ICH 南橋同樣 NUMA form apple Mac Pro >MCH & ICH ->I/O HUB 內設& I/O CONTROLLER 外設..GPU很近
##Storage Profile線程
Type of storage used > Mechanical magnetic platters 盤片 ,磁碟 > SSD devices
###Hardware RAID level, no. of disks, striping size
Interconnect type for direct attached storage 內部存儲 >SATA SAS IDE IDE沒人用了 sata企業級,第三代sata完虐sas sas可靠 SCSI,FIBRE,CHANNEL,ISCSI PCI總線接駁,光纖,互聯網 > 帶寬,納秒級,便宜 burstspped vs. average speed 順序讀寫 隨機讀寫
###SSD
Electronic disk , no moving mechanical components No start-up time Very low latency on read and write Faster than traditional HD sequence 500M/S 200M/S Silent ,not so hot ,vibration free, magnet free,light,less power required Much more expensive,lesser capacity Potentially longer life time MLC 一個單元存多位閃的多壽命短 SLC 很貴,很是貴 每次讀至少一個block ####SSD TRIM COMMAND when os erases a file, the file will typically be marked for deletion SSD 不停作垃圾回收 ssd 掛載 fstab default,discard >IDE UP 133MB/S >SATA2 300 >SATA3 600 >SCSI 320 >USB2 60 >USB3 600 >ISCSI GIGA NIC 125 >FIBRE CHANNEL 531 ###PCI EXPRESS >1.0a 2Gb/s bandwidth:2.5GT/s singleLane:250Mb/s full16:8GB/s >2.1 4 5 500 16 >3 8 8 1GB/s 32
##Networking profile
Network card model Network technology Connection to switch(Speed) Separated network, special purpose network -Storage,VDI,administration,useradta I/O virtualization >cmd >dmesg >/var/log/dmesg >lscpu,lscpu -p >getconf -a >x86info
##profiling commands
>cmd >dmidecode >/sys/class/dmi >lspci [-v[-v[-v]]] >lsusb [-v] >ethtool >sosreport >powertop