442 性能調優 學習第一天

調優的過程當中通常是兩種調優node

一種是響應時間的調優
一種是吞吐量調優
兩者之中魚與熊掌不可兼得

調優必備技能 一方面是硬件 另外一方面是軟件,兩者知識結合才能更好的進行調優工做

量化系統指標,並設置一個正常的指標。

分三層調優,業務層調優-》應用層調優-》內核層調優  調優的效果會愈來愈不明顯
應擔優先思考業務是否可以進行調整,後思考應用層的調整,最後最後才考慮內核級別調優

不須要的東西能夠優先關閉

CPU 相關
查看有多少CPU
[root@localhost ~]# cat /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 15
model : 4
model name: Intel(R) Xeon(TM) CPU 3.00GHz
stepping: 3
cpu MHz : 3000.110
cache size: 2048 KB
physical id: 0
siblings: 2
core id : 0
cpu cores: 1
apicid : 0
initial apicid: 0
fpu : yes
fpu_exception: yes
cpuid level: 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc pebs bts pni dtes64 monitor ds_cpl cid cx16 xtpr
bogomips: 6000.22
clflush size: 64
cache_alignment: 128
address sizes: 36 bits physical, 48 bits virtual
power management:
#篇幅有限 省略部分

查看緩存
[root@localhost ~]# lscpu
Architecture: x86_64 #CPU架構
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4 #數量
On-line CPU(s) list: 0-3
Thread(s) per core: 2 #每一個核線程數 若是爲1表明不支持超線程
Core(s) per socket: 1 #一個物理CPU裏面有幾個核
Socket(s): 2
NUMA node(s): 1 #不支持numa的話就顯示爲1
Vendor ID: GenuineIntel
CPU family: 15
Model: 4
Stepping: 3
CPU MHz: 3000.110
BogoMIPS: 5999.18
L1d cache: 16K #一級數據緩存  L1i cache: 16K表明數據指令緩存
L2 cache: 2048K #二級緩存
NUMA node0 CPU(s): 0-3

[root@localhost ~]# lscpu -p
# The following is the parsable format, which can be fed to other
# programs. Each different item in every column has an unique ID
# starting from zero.
# CPU,Core,Socket,Node,,L1d,L2
0,0,0,0,,0,0
1,1,1,0,,1,1
2,0,0,0,,0,0
3,1,1,0,,1,1

物理CPU多顆的時候應該是怎麼聯繫的?

內存

[root@localhost ~]# free -m
            total used free shared buffers cached
Mem: 2887 2197 689 0 227 1097
-/+ buffers/cache: 872 2014
Swap: 4095 81 4014

[root@localhost ~]# cat /proc/meminfo
MemTotal: 2956360 kB
MemFree: 705444 kB
Buffers: 233004 kB
Cached: 1124116 kB
SwapCached: 4676 kB
Active: 1185600 kB
Inactive: 903772 kB
Active(anon): 554292 kB
Inactive(anon): 314724 kB
Active(file): 631308 kB
Inactive(file): 589048 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 4194296 kB
SwapFree: 4110580 kB
Dirty: 180 kB
Writeback: 0 kB
AnonPages: 731272 kB
Mapped: 97284 kB
Shmem: 136764 kB
Slab: 103268 kB
SReclaimable: 74584 kB
SUnreclaim: 28684 kB
KernelStack: 1408 kB
PageTables: 17276 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 5672476 kB
Committed_AS: 1578500 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 19940 kB
VmallocChunk: 34359706024 kB
HardwareCorrupted: 0 kB
AnonHugePages: 221184 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 7988 kB
DirectMap2M: 3137536 kB

兩個指標
第幾代技術
延遲

存儲
機械磁盤
SSD (固態

RAID 技術 軟 硬 RAID

接口技術 SATA SAS IDE


dmesg 啓動的全部信息 啓動以後還能夠改變
/var/log/dmesg 啓動的全部信息 啓動完成後不會改變

lscpu
lscpu -p

getconf -a

x86info

dmidecode

lspci 查詢pci信息

ethtool eth0 查詢網卡信息

powertop 查詢最近哪些進程最費電

sosreport 收集計算機信息,紅帽工程師在須要提供幫助的時候會但願你提供這個命令生成的文件信息
相關文章
相關標籤/搜索