SlideShare une entreprise Scribd logo
1  sur  34
Linux Monitoring and Troubleshooting
By
MySQL Consulting
Team
About MyDBOPS
• MySQL Consulting
• MySQL Support
• Remote DBA support.
• Expert MySQL solutions
• MariaDB, Percona, Galera, TokuDB are
supported too.
Agenda
• Introduction
• Linux Architecture
• Devices we monitor
• Important tools
• Examples
INTRODUCTION
 Unix-like computer operating system.
 The monitoring and maintenance of the system is the most important task.
 There are many commands line utilities created for this purpose.
CPU l
Network Bandwidth
Memory usage
Disk usage
Syslogs & A
Running processes
etc.
Linux Architecture
Devices we monitor
users
Important tools
netstat
free
Df
Du
ps
history
lsof
top
systat
Sar
iostat
vmstat
Pidstat
mpstat
ping
telnet
ifconfig
w & uptime
who
whoami
Top
 Small tool, pre-installed in many unix systems.
 Display all running and active real time process
in ordered list & updates it regularly.
 CPU usage, Memory usage, Swap Memory, Cache Size,
Buffer Size, Process PID, User, Commands and much
more
 shows high memory and cpu utilization of a running
processes.
sysstat
 powerful logging and monitoring tool for Linux/Unix systems.
 contains utilities to monitor system performance and usage activity.
 used to monitor system performance and troubleshoot problems.
 sysstat is a go-to for power users and can log and track pretty much everything going on
within
your Linux box.
To install :
• redhat based - yum install sysstat
• Debian based - apt-get install sysstat
sar
 Sar(System Activity Report) is part of the sysstat package.
 collects and displays ALL system activities statistics.
 can monitor performance of various Linux subsystems (CPU, Memory, I/O..) in real time.
 also collect all performance data on an on-going basis, store them, and do historical analysis to
identify bottlenecks.
 collected information can be used with ksar to plot graphs.
Sar examples
CPU Usage of ALL CPUs (sar -u)
 This gives the cumulative real-time CPU usage of all CPUs.
 sar -u 1 3 Displays real time CPU usage every 1 second
for 3 times.
 “-P ALL” indicates that it should displays statistics for ALL
the individual Cores.
%user - % of cpu utilz. that occurred while executing at user level
%nice – at user level with nice priority.
%system – at sytem level
%iowait - % of time that cpu were idle during which s/m had an
outstanding disk I/O request
%idle – idle & s/m did not have an oustanding disk i/o
%steal - % of time spent in involuntary wait by cpu/cpu’s
Sar examples
• Memory Free and Used (sar -r)
 This reports the memory statistics.
 “1 3 reports for every 1 seconds a total of 3 times.″
 focus on “kbmemfree” and “kbmemused” for free and used memory.
Sar examples
• Overall I/O Activities (sar -b)
 This reports I/O statistics.
 “1 3 reports for every 1 seconds a total of 3 times.″
 tps – Transactions per second (this includes both read and write)
 rtps – Read transactions per second
 wtps – Write transactions per second
 bread/s – Bytes read per second
 bwrtn/s – Bytes written per second
Sar examples
• Individual Block Device I/O Activities (sar -d)
 To identify the activities by the individual block devices
(i.e a specific mount point, or LUN, or partition)
 The device name (DEV column) can display the actual
device name, use “sar -d”
tps –no of transfer per second
rd_sec/s – no sector read from device
wr_sec/s – no of sectors write from
device
avgrq-sz – avg size in sectors of the
req that were issued to device.
avgqu-sz – avg queue length of
request
await – avg time for i/o req.
svctm – avg service time for i/o req
%util – % of cputime during which i/o
req where issued
Sar examples
• Reports run queue and load average (sar -q)
 This reports the run queue size and load average of last 1 minute, 5 minutes, and 15 minutes.
 “1 3 reports for every 1 seconds a total of 3 times.″
runq-sz – run queue length
(no of task wtng for run time)
plist-sz – no of tasks in the task list
Sar examples
• To view previous records(sar –f)
 To view old day records
 Followed by path of old files
 Maintains one month records
sar -f /var/log/sa/sa15
sar -f /var/log/sa/sa15 -q 1 3
LC_ALL=C sar -f /var/log/sa/sa14 -A
iostat
 simple tool that will collect and show system
input and output storage device statistics.
 often used to trace storage device performance
issues including devices, local disks, remote disks
such as NFS.
%user - % of cpu utilz. that occurred while executing at user level
%nice – at user level with nice priority.
%system – at sytem level
%iowait - % of time that cpu were idle during which s/m had an
outstanding disk I/O request
%idle – idle & s/m did not have an oustanding disk i/o
%steal - % of time spent in involuntary wait by cpu/cpu’s
blk_read/s – amt of data read from device
blk_wrtn/s – amt of data write to device
Blk_read - total no of block reads
Blk_wrtn - total no of block writes
vmstat
 Summary information of Memory, Processes, Paging etc.
 used to display statistics of virtual memory, kernerl threads, disks, system processes, I/O
blocks, interrupts, CPU activity and much more.
r: The no of processes waiting for run time. b - The no of processes in uninterruptable sle
bi: Blocks sent to a block device (blocks/s). bo-: Blocks received from a block device (blocks/s).
si – Amount of memory swapped in from disk (kB/s). so – Amount of memory swapped to disk (kB/s).
in: The no of interrupts/s including the clock. cs : The number of context switches per second.
us: user time sy: system time id: idle time
pidstat
 pidstat is a part of sysstat utility.
 To monitor an individual process which is managed by kernel and generate report.
 Can also be used for monitoring the child processes of selected tasks.
 reports various statistics including CPU used by a process, disk usage statistics of a process,
statistics for threads associated with selected tasks and child processes.
Display statistics for all running process - pidstat -p ALL
Display statistics for a particular process - pidstat -p pid (process id of application)
Display statistics based on process name - pidstat -C “mysql”
Display Statistics of Dependent Process in
Tree Format using –t - pidstat -t -C "mysql"
mpstat
 mpstat is a part of sysstat utility.
 To monitor CPU utilization in our system.
 Will be more useful if our system has multiple processor.
Print CPU utilization per processors - mpstat -P 0 , mpstat -P 1
Print all CPU Utilization - mpstat -P ALL
Print CPU utilization using intervals - mpstat 3 4
Print mpstat version - mpstat -V
netstat
 monitoring incoming and outgoing network packets statistics as well as interface statistics.
 very useful tool for every system administrator to monitor network performance and
troubleshoot network related problems..
free
 built-in command that displays the total amount of free and used physical memory on your
machine.
 also displays the buffers used by the kernel at that given moment.
df
 df is an abbreviation for disk free.
 pre-installed program in all unix systems used to display the amount of available disk space for
filesystem which the user have access to.
du
 Linux “du” (Disk Usage) is a standard Unix/Linux command.
 used to check the information of disk usage of files and
directories on a machine.
 has many parameter options that can be used to get the
results in many formats.
 also displays the files and directory sizes in a recursively
manner.
ps
 basic commands for viewing the processes running on the system
 It provides a snapshot of the current processes along with detailed information like user id, cpu
usage, memory usage, command name etc.
 It does not display data in real time like top or htop commands.
lsof
 lsof meaning 'List Open Files' is used to find out which files are open by which process.
 when a disk cannot be un-mounted as it says the files are being used.
lsof some examples
 List User Specific Opened Files
lsof -u mydbops
 Exclude User with ‘^’ Character
lsof -i -u^root
 Kill all Activity of Particular User
kill -9 `lsof -t -u mydbops`
 List all Network Connections
lsof -i
 Search by PID
lsof -p 1
ping
 used to find out whether the peer host/gateway is reachable.
 how much time it takes for that data to be exchanged.
 default ping waits for 1 second before sending the next packet. increase or decrease using
option -i.
ping 122.166.212.214
ping -i 5 122.166.212.214
ping -c 3 122.166.212.214
telnet
 used for interactive communication with another host using the TELNET protocol.
 command mode.
Syntax : telnet host port
w & uptime
 w - displays information about the users currently on the machine, and their processes
 uptime - Tell how long the system has been running.
who & whoami
 who - prints information about all users who are currently logged in.
 Displays the username, line, and time of all currently logged-in sessions.
 whoami - This command prints the username associated with the current effective user ID.
history
 The history command can be used to list Bash's log of the commands you have typed:
 The history command performs one of several operations related to recently-executed
commands recorded in a history.
Syntax: history
Eg: history | less
 Search the history using Control+R
How MyDBOPS Can Help You
• MySQL Consulting
• MySQL Support
• Remote DBA
• 24 * 7 Support
Contact : mysqlsupport@mydbops.com
Thank You

Contenu connexe

Tendances

Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux TroubleshootingKeith Wright
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernelAdrian Huang
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemHungWei Chiu
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016Brendan Gregg
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntuSim Janghoon
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQLMydbops
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersBrendan Gregg
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 InstancesBrendan Gregg
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Grant McAlister
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixBrendan Gregg
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at NetflixBrendan Gregg
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 

Tendances (20)

Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
PostgreSQL Replication Tutorial
PostgreSQL Replication TutorialPostgreSQL Replication Tutorial
PostgreSQL Replication Tutorial
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystem
 
Linux Systems Performance 2016
Linux Systems Performance 2016Linux Systems Performance 2016
Linux Systems Performance 2016
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
 
ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF SuperpowersLinux 4.x Tracing Tools: Using BPF Superpowers
Linux 4.x Tracing Tools: Using BPF Superpowers
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput Tuning PostgreSQL for High Write Throughput
Tuning PostgreSQL for High Write Throughput
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
re:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflixre:Invent 2019 BPF Performance Analysis at Netflix
re:Invent 2019 BPF Performance Analysis at Netflix
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 

Similaire à Linux monitoring and Troubleshooting for DBA's

linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning iman darabi
 
Bedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfBedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfAyushBaiswar1
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing ToolsSysdig
 
16aug06.ppt
16aug06.ppt16aug06.ppt
16aug06.pptzagreb2
 
Linux System Monitoring
Linux System Monitoring Linux System Monitoring
Linux System Monitoring PriyaTeli
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing ToolsBrendan Gregg
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems PerformanceBrendan Gregg
 
operating system
operating systemoperating system
operating systemIbbad shah
 
this is the slide design for chapter 4 of reource monitoring and mamangemnt
this is the  slide design for chapter 4 of reource monitoring and mamangemntthis is the  slide design for chapter 4 of reource monitoring and mamangemnt
this is the slide design for chapter 4 of reource monitoring and mamangemnthaile468688
 
Perf stat windows
Perf stat windowsPerf stat windows
Perf stat windowsAccenture
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementVeejeya Kumbhar
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsMeenalJabde
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating systemSyedfahadZakir
 

Similaire à Linux monitoring and Troubleshooting for DBA's (20)

linux monitoring and performance tunning
linux monitoring and performance tunning linux monitoring and performance tunning
linux monitoring and performance tunning
 
Refining Linux
Refining LinuxRefining Linux
Refining Linux
 
Bedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfBedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdf
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
16aug06.ppt
16aug06.ppt16aug06.ppt
16aug06.ppt
 
Linux System Monitoring
Linux System Monitoring Linux System Monitoring
Linux System Monitoring
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
The New Systems Performance
The New Systems PerformanceThe New Systems Performance
The New Systems Performance
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
operating system
operating systemoperating system
operating system
 
this is the slide design for chapter 4 of reource monitoring and mamangemnt
this is the  slide design for chapter 4 of reource monitoring and mamangemntthis is the  slide design for chapter 4 of reource monitoring and mamangemnt
this is the slide design for chapter 4 of reource monitoring and mamangemnt
 
Perf stat windows
Perf stat windowsPerf stat windows
Perf stat windows
 
Advanced Operating Systems......Process Management
Advanced Operating Systems......Process ManagementAdvanced Operating Systems......Process Management
Advanced Operating Systems......Process Management
 
Chapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System ConceptsChapter 1 Introduction to Operating System Concepts
Chapter 1 Introduction to Operating System Concepts
 
Os
OsOs
Os
 
Os
OsOs
Os
 
KCC_Final.pdf
KCC_Final.pdfKCC_Final.pdf
KCC_Final.pdf
 
Jana treek 4
Jana treek 4Jana treek 4
Jana treek 4
 
Types of operating system
Types of operating systemTypes of operating system
Types of operating system
 
Linux class 9 15 oct 2021-5
Linux class 9   15 oct 2021-5Linux class 9   15 oct 2021-5
Linux class 9 15 oct 2021-5
 

Plus de Mydbops

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024Mydbops
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Mydbops
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMydbops
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Mydbops
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15Mydbops
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventMydbops
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...Mydbops
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Mydbops
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mydbops
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLMydbops
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsMydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDBMydbops
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mydbops
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesMydbops
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsMydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLMydbops
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Mydbops
 

Plus de Mydbops (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
PostgreSQL Schema Changes with pg-osc - Mydbops @ PGConf India 2024
 
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
Choosing the Right Database: Exploring MySQL Alternatives for Modern Applicat...
 
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster RecoveryMastering Aurora PostgreSQL Clusters for Disaster Recovery
Mastering Aurora PostgreSQL Clusters for Disaster Recovery
 
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
Navigating Transactions: ACID Complexity in Modern Databases- Mydbops Open So...
 
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
AWS RDS in MySQL 2023 Vinoth Kanna @ Mydbops OpenSource Database Meetup 15
 
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE EventData-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
Data-at-scale-with-TIDB Mydbops Co-Founder Kabilesh PR at LSPE Event
 
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
MySQL Transformation Case Study: 80% Cost Savings & Uninterrupted Availabilit...
 
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
Scaling-MongoDB-with-Horizontal-and-Vertical-Sharding Mydbops Opensource Data...
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQLData Organisation: Table Partitioning in PostgreSQL
Data Organisation: Table Partitioning in PostgreSQL
 
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - MydbopsNavigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
Navigating MongoDB's Queryable Encryption for Ultimate Security - Mydbops
 
Data High Availability With TIDB
Data High Availability With TIDBData High Availability With TIDB
Data High Availability With TIDB
 
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
Mastering Database Migration_ Native replication (8.0) to InnoDB Cluster (8.0...
 
Enhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificatesEnhancing Security of MySQL Connections using SSL certificates
Enhancing Security of MySQL Connections using SSL certificates
 
Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops Exploring the Fundamentals of YugabyteDB - Mydbops
Exploring the Fundamentals of YugabyteDB - Mydbops
 
Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops Time series in MongoDB - Mydbops
Time series in MongoDB - Mydbops
 
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - MydbopsTiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
TiDB in a Nutshell - Power of Open-Source Distributed SQL Database - Mydbops
 
Achieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQLAchieving High Availability in PostgreSQL
Achieving High Availability in PostgreSQL
 
Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding Scaling MongoDB with Horizontal and Vertical Sharding
Scaling MongoDB with Horizontal and Vertical Sharding
 

Dernier

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Linux monitoring and Troubleshooting for DBA's

  • 1. Linux Monitoring and Troubleshooting By MySQL Consulting Team
  • 2. About MyDBOPS • MySQL Consulting • MySQL Support • Remote DBA support. • Expert MySQL solutions • MariaDB, Percona, Galera, TokuDB are supported too.
  • 3. Agenda • Introduction • Linux Architecture • Devices we monitor • Important tools • Examples
  • 4. INTRODUCTION  Unix-like computer operating system.  The monitoring and maintenance of the system is the most important task.  There are many commands line utilities created for this purpose. CPU l Network Bandwidth Memory usage Disk usage Syslogs & A Running processes etc.
  • 8. Top  Small tool, pre-installed in many unix systems.  Display all running and active real time process in ordered list & updates it regularly.  CPU usage, Memory usage, Swap Memory, Cache Size, Buffer Size, Process PID, User, Commands and much more  shows high memory and cpu utilization of a running processes.
  • 9. sysstat  powerful logging and monitoring tool for Linux/Unix systems.  contains utilities to monitor system performance and usage activity.  used to monitor system performance and troubleshoot problems.  sysstat is a go-to for power users and can log and track pretty much everything going on within your Linux box. To install : • redhat based - yum install sysstat • Debian based - apt-get install sysstat
  • 10. sar  Sar(System Activity Report) is part of the sysstat package.  collects and displays ALL system activities statistics.  can monitor performance of various Linux subsystems (CPU, Memory, I/O..) in real time.  also collect all performance data on an on-going basis, store them, and do historical analysis to identify bottlenecks.  collected information can be used with ksar to plot graphs.
  • 11. Sar examples CPU Usage of ALL CPUs (sar -u)  This gives the cumulative real-time CPU usage of all CPUs.  sar -u 1 3 Displays real time CPU usage every 1 second for 3 times.  “-P ALL” indicates that it should displays statistics for ALL the individual Cores. %user - % of cpu utilz. that occurred while executing at user level %nice – at user level with nice priority. %system – at sytem level %iowait - % of time that cpu were idle during which s/m had an outstanding disk I/O request %idle – idle & s/m did not have an oustanding disk i/o %steal - % of time spent in involuntary wait by cpu/cpu’s
  • 12. Sar examples • Memory Free and Used (sar -r)  This reports the memory statistics.  “1 3 reports for every 1 seconds a total of 3 times.″  focus on “kbmemfree” and “kbmemused” for free and used memory.
  • 13. Sar examples • Overall I/O Activities (sar -b)  This reports I/O statistics.  “1 3 reports for every 1 seconds a total of 3 times.″  tps – Transactions per second (this includes both read and write)  rtps – Read transactions per second  wtps – Write transactions per second  bread/s – Bytes read per second  bwrtn/s – Bytes written per second
  • 14. Sar examples • Individual Block Device I/O Activities (sar -d)  To identify the activities by the individual block devices (i.e a specific mount point, or LUN, or partition)  The device name (DEV column) can display the actual device name, use “sar -d” tps –no of transfer per second rd_sec/s – no sector read from device wr_sec/s – no of sectors write from device avgrq-sz – avg size in sectors of the req that were issued to device. avgqu-sz – avg queue length of request await – avg time for i/o req. svctm – avg service time for i/o req %util – % of cputime during which i/o req where issued
  • 15. Sar examples • Reports run queue and load average (sar -q)  This reports the run queue size and load average of last 1 minute, 5 minutes, and 15 minutes.  “1 3 reports for every 1 seconds a total of 3 times.″ runq-sz – run queue length (no of task wtng for run time) plist-sz – no of tasks in the task list
  • 16. Sar examples • To view previous records(sar –f)  To view old day records  Followed by path of old files  Maintains one month records sar -f /var/log/sa/sa15 sar -f /var/log/sa/sa15 -q 1 3 LC_ALL=C sar -f /var/log/sa/sa14 -A
  • 17. iostat  simple tool that will collect and show system input and output storage device statistics.  often used to trace storage device performance issues including devices, local disks, remote disks such as NFS. %user - % of cpu utilz. that occurred while executing at user level %nice – at user level with nice priority. %system – at sytem level %iowait - % of time that cpu were idle during which s/m had an outstanding disk I/O request %idle – idle & s/m did not have an oustanding disk i/o %steal - % of time spent in involuntary wait by cpu/cpu’s blk_read/s – amt of data read from device blk_wrtn/s – amt of data write to device Blk_read - total no of block reads Blk_wrtn - total no of block writes
  • 18. vmstat  Summary information of Memory, Processes, Paging etc.  used to display statistics of virtual memory, kernerl threads, disks, system processes, I/O blocks, interrupts, CPU activity and much more. r: The no of processes waiting for run time. b - The no of processes in uninterruptable sle bi: Blocks sent to a block device (blocks/s). bo-: Blocks received from a block device (blocks/s). si – Amount of memory swapped in from disk (kB/s). so – Amount of memory swapped to disk (kB/s). in: The no of interrupts/s including the clock. cs : The number of context switches per second. us: user time sy: system time id: idle time
  • 19. pidstat  pidstat is a part of sysstat utility.  To monitor an individual process which is managed by kernel and generate report.  Can also be used for monitoring the child processes of selected tasks.  reports various statistics including CPU used by a process, disk usage statistics of a process, statistics for threads associated with selected tasks and child processes. Display statistics for all running process - pidstat -p ALL Display statistics for a particular process - pidstat -p pid (process id of application) Display statistics based on process name - pidstat -C “mysql” Display Statistics of Dependent Process in Tree Format using –t - pidstat -t -C "mysql"
  • 20. mpstat  mpstat is a part of sysstat utility.  To monitor CPU utilization in our system.  Will be more useful if our system has multiple processor. Print CPU utilization per processors - mpstat -P 0 , mpstat -P 1 Print all CPU Utilization - mpstat -P ALL Print CPU utilization using intervals - mpstat 3 4 Print mpstat version - mpstat -V
  • 21. netstat  monitoring incoming and outgoing network packets statistics as well as interface statistics.  very useful tool for every system administrator to monitor network performance and troubleshoot network related problems..
  • 22. free  built-in command that displays the total amount of free and used physical memory on your machine.  also displays the buffers used by the kernel at that given moment.
  • 23. df  df is an abbreviation for disk free.  pre-installed program in all unix systems used to display the amount of available disk space for filesystem which the user have access to.
  • 24. du  Linux “du” (Disk Usage) is a standard Unix/Linux command.  used to check the information of disk usage of files and directories on a machine.  has many parameter options that can be used to get the results in many formats.  also displays the files and directory sizes in a recursively manner.
  • 25. ps  basic commands for viewing the processes running on the system  It provides a snapshot of the current processes along with detailed information like user id, cpu usage, memory usage, command name etc.  It does not display data in real time like top or htop commands.
  • 26. lsof  lsof meaning 'List Open Files' is used to find out which files are open by which process.  when a disk cannot be un-mounted as it says the files are being used.
  • 27. lsof some examples  List User Specific Opened Files lsof -u mydbops  Exclude User with ‘^’ Character lsof -i -u^root  Kill all Activity of Particular User kill -9 `lsof -t -u mydbops`  List all Network Connections lsof -i  Search by PID lsof -p 1
  • 28. ping  used to find out whether the peer host/gateway is reachable.  how much time it takes for that data to be exchanged.  default ping waits for 1 second before sending the next packet. increase or decrease using option -i. ping 122.166.212.214 ping -i 5 122.166.212.214 ping -c 3 122.166.212.214
  • 29. telnet  used for interactive communication with another host using the TELNET protocol.  command mode. Syntax : telnet host port
  • 30. w & uptime  w - displays information about the users currently on the machine, and their processes  uptime - Tell how long the system has been running.
  • 31. who & whoami  who - prints information about all users who are currently logged in.  Displays the username, line, and time of all currently logged-in sessions.  whoami - This command prints the username associated with the current effective user ID.
  • 32. history  The history command can be used to list Bash's log of the commands you have typed:  The history command performs one of several operations related to recently-executed commands recorded in a history. Syntax: history Eg: history | less  Search the history using Control+R
  • 33. How MyDBOPS Can Help You • MySQL Consulting • MySQL Support • Remote DBA • 24 * 7 Support Contact : mysqlsupport@mydbops.com