SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Linux monitoring &
optimization
preCloud
May 29, 2020
Materials
● System performance reporting
● monitoring
● System optimization basics
● Storage design
● Q/A
70min
● System performance
reporting
50min
● monitoring
60min
● System optimization
basics
30 mins
● Storage design
15 mins
● Q/A
System Performance
Reporting
Tuning Introduction
Tunning is
● the process of finding bottlenecks in
a system and tuning the operating
system to eliminate these
bottlenecks.
● about achieving balance between
the different sub-systems of an OS.
Tunning is not
● performance tuning can be a
“cook book” approach
● setting some parameters in the
kernel will simply solve a problem
Application Type
IO Bound
● requires heavy use of memory and
the underlying storage system.
● IO bound application is processing
(in memory) large amounts of data.
● IO bound applications use CPU
resources to make IO requests and
then often go into a sleep state.
CPU Bound
● CPU bound applications require the CPU
for batch processing and/or mathematical
calculations.
● High volume web servers, and any kind of
rendering server.
Basic command line tools for monitoring
● Network monitoring (ping, tcpdump, netstat, nmap, traceroute, ...)
● Process monitoring (ps, pgrep, top, htop, …)
● Memory monitoring (vmstat)
● Disk monitoring (iostat)
Process monitoring
Ps, pstree, pgrep - process monitor
● To see every process on the system - standard syntax
○ $ ps -ef
● To see every process on the system - BSD syntax
○ $ ps aux
● Print a process tree:
○ $ ps -ejH
○ $ pstree
● look up or signal processes based on name and other attributes
○ $ pgrep syslog
Process monitoring
top - display Linux processes
● every process that needs to be served enters a run queue before the kernel scheduler can allocate it
to run on a CPU core.
● average number of processes that is waiting to be served at any given moment.
● the number indicated as the load average should not be much higher than the total number of CPU
cores
● if server has four cores, four processes can be handled at the same time, and the CPU load should
not be higher than four.
top
Load Average
us
Percentage of time the CPU spends handling processes in user mode.
sy
Percentage of time the CPU spends in kernel mode.
id
Percentage of time the processor spends in the idle loop.
wa
Time the processor spends waiting for noninterruptible I/O, such as requests to disks,
hard-mounted NFS, and tape units.
hi
Time the processor spends handling hardware interrupts. A high value may indicate faulty
hardware.
top
CPU Performance Parameters
KiB Mem Total amount of physical memory in KiB (1 KiB = 1024 bytes)
used Total amount of RAM that is used for any purpose
free Total amount of RAM that is not used for anything
buffers
Total amount of used memory that is used for storing unstructured Data
cached
Mem
Total amount of memory that is used to cache files that have recently been fetched from
disk
top
Memory Usage
Sysstat - disk monitoring
Iostat - Report CPU statistics and input/output statistics for devices
and partitions.
● find out which I/O devices have
been used intensively and what
amount of I/O has been
happening on these devices.
●
iostat
%user - Show the percentage of CPU utilization that occurred while executing at the user level (application).
%nice - Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
%system - Show the percentage of CPU utilization that occurred while executing at the system level (kernel).
%iowait - Show the percentage of time that the CPU or CPUs were idle during which the system had an out
standing disk I/O request.
%steal - Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor
was servicing another virtual processor.
%idle - Show the percentage of time that the CPU or CPUs were idle and the system did not have an out
standing disk I/O request.
tps - Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to
the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of
indeterminate size.
Sysstat - memory monitoring
Vmstat - Report virtual memory statistics
● find out which I/O devices have
been used intensively and what
amount of I/O has been
happening on these devices.
●
Vmstat
Definitions: what is metric?
● The National Institute of Standards and Technology (NIST) define metrics as: “Tools designed to
facilitate decision-making and improve performance and accountability through collection, analysis
and reporting of relevant performance-related data”
● Metrics are simply a standard or system of measurement
Howto get metrics from server, app,
infrastructure ?!
● Prometheus is an open source,
metrics-based monitoring system.
● Prometheus does one thing and it does it
well. (get metrics)
● It does not try to solve problems outside of
the metrics space, leaving those to other
more appropriate tools.
● Metrics from server can big gathered with
prometheus-node-exporter package:
● # apt install prometheus-node-exporter
● curl localhost:9100/metrics
Monitoring
System Optimization
System Optimization Basics
● Linux kernel offers a complicated framework to have your server
behave in the best possible way
● Linux performance tuning should be done by experts who know
what they are doing.
● Tuned: tuning service can adapt the operating system to perform
better under certain workloads by setting a tuning profile
Understanding the Role of the Linux Kernel
● The Linux kernel is the heart of the operating system
● It is the layer between the user who works with Linux from a shell environment and the hardware that
is available in the computer on which the user is working.
● The kernel doing many essential operating system tasks. the scheduler that makes sure
● that processes that are started on the operating system are handled by the CPU, for example.
Analyzing What the Kernel Is Doing
● The dmesg utility ( or use journalctl --dmesg )
○ This utility shows the contents of the kernel ring buffer, an area of memory where the Linux kernel keeps its
recent log messages.
● The /proc file system
○ It contains files with detailed actual status information on what is happening on your server.
○ Many of the performance-related tools mine the /proc file system for more information.
● The uname utility
○ $ uname -a
■ Print all kernel information
○ $ uname -r
■ Which kernel version currently is used
/proc File System
● The key to Linux performance tuning is in the /proc file system.
● Many, if not all, the system utilities (including lscpu, uname, top, ps,
lsmod, and many more) are getting the information they show from
the /proc file system.
/proc Performance Related Files
Process ID (PID) directories
● Apart from the configuration files mentioned,
there are also the process ID (PID)
directories.
● Every process that runs on Linux has a unique
PID, and each of these processes builds its
own environment.
Get info from /proc
/proc/sys
● Key to optimizing Linux performance is the /proc/sys directory
● In this directory, you’ll find tunables, divided in different categories
Tunable Explanation
kernel The kernel interface. Contains many useful tunables
net The network interface. Contains many useful tunables
fs The interface to the virtual file system. Contains a few useful tunables, such
as file-max, which specifies the maximum number of files that can be pened
simultaneously.
vm The virtual memory interface. Contains many useful tunables.
Using /proc/sys to manipulate a running kernel
optimization parameters
Howto change optimization parameters?
● Use echo to write the new parameter
to the kernel tunable file.
○ # echo 1 >
/proc/sys/net/ipv4/ip_forward
● Use sysctl -w to write the parameter
to the kernel tunable.
○ # sysctl -w
net.ipv4.ip_forward=1
● Use /etc/sysctl.conf file to save as
persistent
● Use /etc/sysctl.conf file to save as
persistent
○ # vim /etc/sysctl.conf
■ net.ipv4.ip_forward=0
○ sysctl -p
● Sysctl -a : Display all values
currently available
End of last session
Q&A

Mais conteúdo relacionado

Mais procurados

How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicHow to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicCircling Cycle
 
How to Speak Intel DPDK KNI for Web Services.
How to Speak Intel DPDK KNI for Web Services.How to Speak Intel DPDK KNI for Web Services.
How to Speak Intel DPDK KNI for Web Services.Naoto MATSUMOTO
 
Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)micchie
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and DriversKernel TLV
 
System performance monitoring pcp + vector
System performance monitoring   pcp + vectorSystem performance monitoring   pcp + vector
System performance monitoring pcp + vectorSandeep Kunkunuru
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsHisaki Ohara
 
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicUnix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicCircling Cycle
 
Packet Framework - Cristian Dumitrescu
Packet Framework - Cristian DumitrescuPacket Framework - Cristian Dumitrescu
Packet Framework - Cristian Dumitrescuharryvanhaaren
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunheut2008
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksAnne Nicolas
 
Dev Conf 2017 - Meeting nfv networking requirements
Dev Conf 2017 - Meeting nfv networking requirementsDev Conf 2017 - Meeting nfv networking requirements
Dev Conf 2017 - Meeting nfv networking requirementsFlavio Leitner
 
Linux System Monitoring
Linux System Monitoring Linux System Monitoring
Linux System Monitoring PriyaTeli
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCKernel TLV
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitAndrea Righi
 
Understand and optimize Linux I/O
Understand and optimize Linux I/OUnderstand and optimize Linux I/O
Understand and optimize Linux I/OAndrea Righi
 

Mais procurados (20)

Staging driver sins
Staging driver sinsStaging driver sins
Staging driver sins
 
Fun with FUSE
Fun with FUSEFun with FUSE
Fun with FUSE
 
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicHow to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
How to Speak Intel DPDK KNI for Web Services.
How to Speak Intel DPDK KNI for Web Services.How to Speak Intel DPDK KNI for Web Services.
How to Speak Intel DPDK KNI for Web Services.
 
Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)Recent advance in netmap/VALE(mSwitch)
Recent advance in netmap/VALE(mSwitch)
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 
System performance monitoring pcp + vector
System performance monitoring   pcp + vectorSystem performance monitoring   pcp + vector
System performance monitoring pcp + vector
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicUnix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
 
Packet Framework - Cristian Dumitrescu
Packet Framework - Cristian DumitrescuPacket Framework - Cristian Dumitrescu
Packet Framework - Cristian Dumitrescu
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zun
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
 
Dev Conf 2017 - Meeting nfv networking requirements
Dev Conf 2017 - Meeting nfv networking requirementsDev Conf 2017 - Meeting nfv networking requirements
Dev Conf 2017 - Meeting nfv networking requirements
 
RedHat - Centos Firewalld
RedHat - Centos FirewalldRedHat - Centos Firewalld
RedHat - Centos Firewalld
 
Linux System Monitoring
Linux System Monitoring Linux System Monitoring
Linux System Monitoring
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
 
Understand and optimize Linux I/O
Understand and optimize Linux I/OUnderstand and optimize Linux I/O
Understand and optimize Linux I/O
 

Semelhante a linux monitoring and performance tunning

Semelhante a linux monitoring and performance tunning (20)

Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 
Refining Linux
Refining LinuxRefining Linux
Refining Linux
 
Lec 2
Lec 2Lec 2
Lec 2
 
Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
 
Lec 3
Lec 3 Lec 3
Lec 3
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Insider operating system
Insider   operating systemInsider   operating system
Insider operating system
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
 
Os
OsOs
Os
 
Os
OsOs
Os
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Operating System
Operating SystemOperating System
Operating System
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Bedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfBedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdf
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 

Último

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Último (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

linux monitoring and performance tunning

  • 2. Materials ● System performance reporting ● monitoring ● System optimization basics ● Storage design ● Q/A
  • 3. 70min ● System performance reporting 50min ● monitoring 60min ● System optimization basics 30 mins ● Storage design 15 mins ● Q/A
  • 5.
  • 6. Tuning Introduction Tunning is ● the process of finding bottlenecks in a system and tuning the operating system to eliminate these bottlenecks. ● about achieving balance between the different sub-systems of an OS. Tunning is not ● performance tuning can be a “cook book” approach ● setting some parameters in the kernel will simply solve a problem
  • 7. Application Type IO Bound ● requires heavy use of memory and the underlying storage system. ● IO bound application is processing (in memory) large amounts of data. ● IO bound applications use CPU resources to make IO requests and then often go into a sleep state. CPU Bound ● CPU bound applications require the CPU for batch processing and/or mathematical calculations. ● High volume web servers, and any kind of rendering server.
  • 8. Basic command line tools for monitoring ● Network monitoring (ping, tcpdump, netstat, nmap, traceroute, ...) ● Process monitoring (ps, pgrep, top, htop, …) ● Memory monitoring (vmstat) ● Disk monitoring (iostat)
  • 9. Process monitoring Ps, pstree, pgrep - process monitor ● To see every process on the system - standard syntax ○ $ ps -ef ● To see every process on the system - BSD syntax ○ $ ps aux ● Print a process tree: ○ $ ps -ejH ○ $ pstree ● look up or signal processes based on name and other attributes ○ $ pgrep syslog
  • 10. Process monitoring top - display Linux processes
  • 11. ● every process that needs to be served enters a run queue before the kernel scheduler can allocate it to run on a CPU core. ● average number of processes that is waiting to be served at any given moment. ● the number indicated as the load average should not be much higher than the total number of CPU cores ● if server has four cores, four processes can be handled at the same time, and the CPU load should not be higher than four. top Load Average
  • 12. us Percentage of time the CPU spends handling processes in user mode. sy Percentage of time the CPU spends in kernel mode. id Percentage of time the processor spends in the idle loop. wa Time the processor spends waiting for noninterruptible I/O, such as requests to disks, hard-mounted NFS, and tape units. hi Time the processor spends handling hardware interrupts. A high value may indicate faulty hardware. top CPU Performance Parameters
  • 13. KiB Mem Total amount of physical memory in KiB (1 KiB = 1024 bytes) used Total amount of RAM that is used for any purpose free Total amount of RAM that is not used for anything buffers Total amount of used memory that is used for storing unstructured Data cached Mem Total amount of memory that is used to cache files that have recently been fetched from disk top Memory Usage
  • 14. Sysstat - disk monitoring Iostat - Report CPU statistics and input/output statistics for devices and partitions. ● find out which I/O devices have been used intensively and what amount of I/O has been happening on these devices. ●
  • 15. iostat %user - Show the percentage of CPU utilization that occurred while executing at the user level (application). %nice - Show the percentage of CPU utilization that occurred while executing at the user level with nice priority. %system - Show the percentage of CPU utilization that occurred while executing at the system level (kernel). %iowait - Show the percentage of time that the CPU or CPUs were idle during which the system had an out standing disk I/O request. %steal - Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor. %idle - Show the percentage of time that the CPU or CPUs were idle and the system did not have an out standing disk I/O request. tps - Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.
  • 16. Sysstat - memory monitoring Vmstat - Report virtual memory statistics ● find out which I/O devices have been used intensively and what amount of I/O has been happening on these devices. ●
  • 18. Definitions: what is metric? ● The National Institute of Standards and Technology (NIST) define metrics as: “Tools designed to facilitate decision-making and improve performance and accountability through collection, analysis and reporting of relevant performance-related data” ● Metrics are simply a standard or system of measurement
  • 19. Howto get metrics from server, app, infrastructure ?! ● Prometheus is an open source, metrics-based monitoring system. ● Prometheus does one thing and it does it well. (get metrics) ● It does not try to solve problems outside of the metrics space, leaving those to other more appropriate tools. ● Metrics from server can big gathered with prometheus-node-exporter package: ● # apt install prometheus-node-exporter ● curl localhost:9100/metrics
  • 21.
  • 22.
  • 24. System Optimization Basics ● Linux kernel offers a complicated framework to have your server behave in the best possible way ● Linux performance tuning should be done by experts who know what they are doing. ● Tuned: tuning service can adapt the operating system to perform better under certain workloads by setting a tuning profile
  • 25. Understanding the Role of the Linux Kernel ● The Linux kernel is the heart of the operating system ● It is the layer between the user who works with Linux from a shell environment and the hardware that is available in the computer on which the user is working. ● The kernel doing many essential operating system tasks. the scheduler that makes sure ● that processes that are started on the operating system are handled by the CPU, for example.
  • 26. Analyzing What the Kernel Is Doing ● The dmesg utility ( or use journalctl --dmesg ) ○ This utility shows the contents of the kernel ring buffer, an area of memory where the Linux kernel keeps its recent log messages. ● The /proc file system ○ It contains files with detailed actual status information on what is happening on your server. ○ Many of the performance-related tools mine the /proc file system for more information. ● The uname utility ○ $ uname -a ■ Print all kernel information ○ $ uname -r ■ Which kernel version currently is used
  • 27. /proc File System ● The key to Linux performance tuning is in the /proc file system. ● Many, if not all, the system utilities (including lscpu, uname, top, ps, lsmod, and many more) are getting the information they show from the /proc file system.
  • 29. Process ID (PID) directories ● Apart from the configuration files mentioned, there are also the process ID (PID) directories. ● Every process that runs on Linux has a unique PID, and each of these processes builds its own environment.
  • 30. Get info from /proc
  • 31. /proc/sys ● Key to optimizing Linux performance is the /proc/sys directory ● In this directory, you’ll find tunables, divided in different categories Tunable Explanation kernel The kernel interface. Contains many useful tunables net The network interface. Contains many useful tunables fs The interface to the virtual file system. Contains a few useful tunables, such as file-max, which specifies the maximum number of files that can be pened simultaneously. vm The virtual memory interface. Contains many useful tunables.
  • 32. Using /proc/sys to manipulate a running kernel
  • 34. Howto change optimization parameters? ● Use echo to write the new parameter to the kernel tunable file. ○ # echo 1 > /proc/sys/net/ipv4/ip_forward ● Use sysctl -w to write the parameter to the kernel tunable. ○ # sysctl -w net.ipv4.ip_forward=1 ● Use /etc/sysctl.conf file to save as persistent ● Use /etc/sysctl.conf file to save as persistent ○ # vim /etc/sysctl.conf ■ net.ipv4.ip_forward=0 ○ sysctl -p ● Sysctl -a : Display all values currently available
  • 35. End of last session Q&A