Documente Academic
Documente Profesional
Documente Cultură
PERFORMANCE TUNING
Adzmely Mansor
ABOUT ME
CONSULTANT/FOUNDER OF
NEXOPRIMA SDN. BHD.
Adzmely Mansor
1. INTRO TO SCALING
2. THE BASICS
CPU
MEMORY
NETWORK
3. EXPERIENCES
SHARING
AGENDA
INTRO TO
SCALING
INTRO TO SCALING
SCALABILITY?
WIKIPEDIA
PERFORMANCE TUNING?
WIKIPEDIA
INTRO TO SCALING
VERTICALLY?
WIKIPEDIA
INTRO TO SCALING
INTRO TO SCALING
HORIZONTALLY?
when vertical / performance tuning
already maximise
why?
INTRO TO SCALING
INTRO TO SCALING
INTRO TO SCALING
THE
BASICS
THE BASICS
CPU
CPU utilisation depend on accessed resources
Linux Kernel has a scheduler, and scheduler give priorities
to the different resources:
scheduling two kind of resources:
interrupts
threads
THE BASICS
THE BASICS
CPU - SCHEDULER
smallest unit of process execution called thread
the system scheduler:
determines which processor run a thread
and for how long the threads run
however the scheduler have priorities
THE BASICS
THE BASICS
THE BASICS
CPU - CORES
Linux consider / view each core on n-way Hyper Threaded
processor as an:
INDEPENDENT Processor
eg: Dual Core Processor = two independent processor
THE BASICS
THE BASICS
THE BASICS
THE BASICS
CPU - UTILISATION
defined as the percentage of usage of a CPU
mostly CPU utilisation falls under following categories:
User Time: percentage of time CPU spends executing threads in the
User Space
System Time: percentage of time CPU spends in executing kernel
threads and interrupts
Wait IO: the persentage of time a CPU spends idle because all process
threads are blocked waiting for IO requests to complete
Idle: the percentage of time a processor spends in completely idle
state
THE BASICS
CPU - Performance
Monitoring - a matter of
interpreting performance of:
- run queue
- utilisation
- context switching
the basics
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
top
THE BASICS
vmstat
THE BASICS
mpstat
Memory
- Physical Memory
- Virtual Memory
the basics
THE BASICS
VIRTUAL MEMORY
Virtual Memory = SWAP space on disk + RAM/physical
memory
virtual memory divided into pages
on x86 architecture VM pages = 4kb
when writing from memory to disk, it write memory in
Pages
THE BASICS
VIRTUAL MEMORY
when application starts, it request Virtual Memory Size (VSZ)
the kernel either grants or denies VSZ request
as application use the requested memory, that memory
mapped into physical memory (RSS)
RSS (resident memory size) is amount of physical memory
a task is using
most case application use less RSS than what it requested
(VSZ)
THE BASICS
VIRTUAL MEMORY
THE BASICS
VIRTUAL MEMORY
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
vmstat
Network
- NIC Ring Buffer
- Hard IRQ
- Soft IRQ
- Networking Tools
the basics
THE BASICS
App N
App 1
Packet to
Forward
IP STACK
SKB
SKB
Queuing
Disciplines
SKB
NIC
Driver Queue
a.k.a
Ring Buffer
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
THE BASICS
by EA Faisal - NexoPrima
THE BASICS
THE BASICS
BrowserClient
SYN
SY
CK
N, A
RWI
N 65
k
Server/Web
SS
*M
IN 3
RW
ACK
GET
ACK
ke
pac
a
t
3 da
ACK
s
ts
CWIN = 3
THE BASICS
THE BASICS
BrowserClient
SYN
SY
CK
N, A
RWI
N 65
k
Server/Web
SS
*M
IN 3
RW
ACK
GET
ACK
CWIN = 5
kets
c
a
ta p
5 da
THE BASICS
THE BASICS
THE BASICS
EXPERIENCES
SHARING
EXPERIENCES SHARING
EXPERIENCES SHARING
tuned
INTERNAL
EXPERIENCES SHARING
DB CONNECTION LATENCY
Q&A
THANK YOU
adzmely@nexoprima.com
http://blog.nexoprima.com
ANNEX
REFERENCES:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/
Performance_Tuning_Guide
https://wiki.mikejung.biz/Ubuntu_Performance_Tuning
https://lonesysadmin.net/2013/12/22/better-linux-disk-caching-performance-vmdirty_ratio/
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
https://access.redhat.com/sites/default/files/attachments/
20150325_network_performance_tuning.pdf
http://www.cdnplanet.com/blog/tune-tcp-initcwnd-for-optimum-performance/
https://www.wikipedia.org/ : for various topics related
others that I might forgotten