Jump to content

Cheatsheet: Difference between revisions

Line 862:
== Check CPU, Memory and HDD ==
 
;=== CPU ===
 
*; CPU Info
lscpu
lshw -C CPU
Line 874:
cat /proc/cpuinfo | grep processor | wc -l
 
* The number of processors shown by /proc/cpuinfo might not be the actual number of cores on the processor.
* For example a processor with 2 cores and hyperthreading would be reported as a processor with 4 cores.
So* If there are 4 different core ids., Thisthis indicates that there are 4 actual cores.
cat /proc/cpuinfo | grep 'core id'
 
# cat /proc/cpuinfo | grep 'core id'
core id : 0
core id : 2
Line 882 ⟶ 884:
core id : 3
 
*; CPU Usage
So there are 4 different core ids. This indicates that there are 4 actual cores.
 
*Usage
top -o %CPU
htop
Line 890:
sar 1 3 ==> yum install sysstat
iostat ==> yum install sysstat
 
; Top Command
 
CPU Section
 
us user cpu time % CPU time spent in user space
sy system cpu time % CPU time spent in kernel space
ni user nice cpu time % CPU time spent on low priority processes
id idle cpu time % CPU time spent idle
wa io wait cpu time % CPU time spent in wait (on disk)
hi hardware irq % CPU time spent servicing/handling hardware interrupts
si software irq % CPU time spent servicing/handling software interrupts
st steal time % CPU time stolen from a virtual machine
 
 
Main Section:
%MEM directly related to RES, percentage use of total physical memory by the process.
VIRT total memory that this process has access to shared memory, mapped pages, swapped out pages, etc.
RES total physical memory used shared or private that the process has access to.
SHR total physical shared memory that the process has access to.
 
RES is most close to the memory used by the process in memory, excluding what’s swapped out.
This includes the SHR (shared physical memory) which mean it could have been used by some other process as well.
 
;Obtain the PID with a utility:
pgrep -n python
pidof chrome - return all PIDs
pidof -s chrome - return only 1 PID
ps -C chrome -o pid= - C = CMD
 
 
 
;Memory
Line 911 ⟶ 942:
;HDD
lsblk ==> List Block Devices only in a tree structure
 
du
df
 
== Check IP and DNS info ==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.