SlideShare a Scribd company logo
1 of 41
Download to read offline
Database in Kubernetes:
Diagnostics and Monitoring
Sveta Smirnova
Principal Support Engineering Coordinator
• MySQL Support Engineer
• Author
MySQL Troubleshooting
MySQL Cookbook, 4th Edition
• JSON UDF functions
• FILTER clause for MySQL
• Speaker
• Percona Live, OOW, Fosdem,
DevConf, HighLoad...
Sveta Smirnova
Database Performance Influencers
3
© Copyright 2023 Percona ® LLC. All rights reserved
• Standard database tools: EXPLAIN
• Interactive tools
• Log files
Query Performance Diagnostics
4
© Copyright 2023 Percona ® LLC. All rights reserved
• Interactive tools
• Same as on bare metal
Concurrency Diagnostics
5
© Copyright 2023 Percona ® LLC. All rights reserved
• Managed by Kubernetes
• Limits, set by Kubernetes
• DBA does not have access to tools,
available on bare hardware
Hardware
6
© Copyright 2023 Percona ® LLC. All rights reserved
• Supported
PMM
7
© Copyright 2023 Percona ® LLC. All rights reserved
• Supported
• All Percona operators are shipped with
PMM client
PMM
8
© Copyright 2023 Percona ® LLC. All rights reserved
• Supported
• All Percona operators are shipped with
PMM client
• PMM server needs to be installed
separately
• Install via Helm is available
PMM
9
© Copyright 2023 Percona ® LLC. All rights reserved
• Supported
• All Percona operators are shipped with
PMM client
• PMM server needs to be installed
separately
• Install via Helm is available
• Add pmm.enabled=true into
deploy/cr.yaml, configure PMM server
host and API key, then apply
PMM
10
© Copyright 2023 Percona ® LLC. All rights reserved
Database Performance Troubleshooting
11
© Copyright 2023 Percona ® LLC. All rights reserved
Database Performance Troubleshooting
12
© Copyright 2023 Percona ® LLC. All rights reserved
• Global buffers to cache "hot" data
• InnoDB Buffer Pool
• WiredTiger Cache
• Shared buffers in PostgreSQL
• Operation and thread-specific buffers
• "Internal" buffers not under user control
How Memory Used by Databases?
13
© Copyright 2023 Percona ® LLC. All rights reserved
• Physically available for nodes
• Limited by the Operator
resources:
requests:
memory: 32G
...
# limits:
# memory: 32G
Memory Limits
14
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl top pods
• kubectl top nodes
• kubectl describe nodes
Memory Diagnostics
15
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl top pods
• kubectl top nodes
• kubectl describe nodes
• Database-specific instruments
• Performance Schema in MySQL
Memory Diagnostics
16
© Copyright 2023 Percona ® LLC. All rights reserved
• Table data
• Indexes
• Log files
• Temporary data
How Disk Used by Databases?
17
© Copyright 2023 Percona ® LLC. All rights reserved
volumeSpec:
persistentVolumeClaim:
resources:
requests:
storage: 2G
Disk Limitations
18
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl get persistentvolumeclaims
Disk Diagnostics
19
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl get persistentvolumeclaims
• kubectl describe nodes
Disk Diagnostics
20
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl get persistentvolumeclaims
• kubectl describe nodes
• Error logs of the database
2018-11-28T00:03:26.322318+06:00 0 [Note] InnoDB: page_cleaner:
1000ms intended loop took 4188ms. The settings might not be optimal.
(flushed=692 and evicted=0, during the time.)
Disk Diagnostics
21
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl get persistentvolumeclaims
• kubectl describe nodes
• Error logs of the database
2018-11-28T00:03:26.322318+06:00 0 [Note] InnoDB: page_cleaner:
1000ms intended loop took 4188ms. The settings might not be optimal.
(flushed=692 and evicted=0, during the time.)
• Counters in the database
Disk Diagnostics
22
© Copyright 2023 Percona ® LLC. All rights reserved
• Handle connections
• Threads in MySQL, MongoDB
• Sub-processes in PostgreSQL
• Perform calculations
• Perform IO operations
How CPU Used by Databases?
23
© Copyright 2023 Percona ® LLC. All rights reserved
resources:
requests:
cpu: "16"
limits:
cpu: "32"
CPU Limits
24
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl top pods
• kubectl top nodes
• kubectl describe nodes
CPU Diagnostics
25
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl top pods
• kubectl top nodes
• kubectl describe nodes
• Counters in the database
CPU Diagnostics
26
© Copyright 2023 Percona ® LLC. All rights reserved
• Communication between server and
client
• Regular client
• Application
• Replicas
• Synchronous nodes
How Databases Use Network?
27
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl describe nodes
Network Diagnostics
28
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl describe nodes
• Logs and statuses of the namespace
kube-system and your CNI
Network Diagnostics
29
© Copyright 2023 Percona ® LLC. All rights reserved
• kubectl describe nodes
• Logs and statuses of the namespace
kube-system and your CNI
• Latency in databases
Network Diagnostics
30
© Copyright 2023 Percona ® LLC. All rights reserved
• By default, log files are gone after pod
failure
• Critical in such situations as database
crash
Log Files Rotation
31
© Copyright 2023 Percona ® LLC. All rights reserved
• By default, log files are gone after pod
failure
• Critical in such situations as database
crash
• Solution
• PXC Operator: separate pod to store logs
• Other operators: K8-recommended
solutions such as Grafana Loki
Log Files Rotation
32
© Copyright 2023 Percona ® LLC. All rights reserved
• Created for Support team to automate
K8 troubleshooting collections
• Owned by Support team
• In active progress
• New featurs each version
pt-k8s-debug-collector
33
© Copyright 2023 Percona ® LLC. All rights reserved
pt-stalk
• Default for bare
metal
• Bare hardware
• Such tools as
• iostat
• vmstat
• dmesg
• top
pt-k8s-debug-collector
• Default for K8
• kubectl
• Such commands
as
• get pods
• get
storageclasses
• get replicasets
• get logs
Batch Data Collection
34
© Copyright 2023 Percona ® LLC. All rights reserved
• Basic batch collections per databases
• MySQL and PXC
pt-summary
pt-mysql-summary
Log files
• MongoDB
pt-mongodb-summary
• PostgreSQL
pg_gather
Features in pt-k8s-debug-collector
35
© Copyright 2023 Percona ® LLC. All rights reserved
• Basic batch collections per databases
• MySQL and PXC
pt-summary
pt-mysql-summary
Log files
• MongoDB
pt-mongodb-summary
• PostgreSQL
pg_gather
• kubectl get
Features in pt-k8s-debug-collector
36
© Copyright 2023 Percona ® LLC. All rights reserved
• Basic batch collections per databases
• MySQL and PXC
pt-summary
pt-mysql-summary
Log files
• MongoDB
pt-mongodb-summary
• PostgreSQL
pg_gather
• kubectl get
• kubectl logs
Features in pt-k8s-debug-collector
37
© Copyright 2023 Percona ® LLC. All rights reserved
• pt-stalk
• More kubectl commands
• Extended MongoDB support
• Nicer output format for summaries
Future of the pt-k8s-debug-collector
38
© Copyright 2023 Percona ® LLC. All rights reserved
• Mind limits in cr.yaml
• Work with K8 administrators for setting
up policies, allowing you to view
hardware usage
• Setup Loki or similar solution to save the
log files after restart
• Enable online database
instrumentation
• Use PMM or similar monitoring solution
• Plan in advance
Conclusion
39
© Copyright 2023 Percona ® LLC. All rights reserved
Percona K8 Operators
PMM Demo
pt-k8s-debug-collector
pt-stalk
pg_gather
Grafana Loki
Tools Mentioned
40
© Copyright 2023 Percona ® LLC. All rights reserved
Thank you!
/svetsmirnova /svetasmirnova
/svetsmirnova /SvetaSmirnova

More Related Content

What's hot

SQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet SinghSQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet Singh
Rishu Mehra
 

What's hot (20)

MySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to HaveMySQL Database Monitoring: Must, Good and Nice to Have
MySQL Database Monitoring: Must, Good and Nice to Have
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
 
Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方Apache Hbase バルクロードの使い方
Apache Hbase バルクロードの使い方
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)
 
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UIData Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
Data Warehouses in Kubernetes Visualized: the ClickHouse Kubernetes Operator UI
 
PostgreSQLのロール管理とその注意点(Open Source Conference 2022 Online/Osaka 発表資料)
PostgreSQLのロール管理とその注意点(Open Source Conference 2022 Online/Osaka 発表資料)PostgreSQLのロール管理とその注意点(Open Source Conference 2022 Online/Osaka 発表資料)
PostgreSQLのロール管理とその注意点(Open Source Conference 2022 Online/Osaka 発表資料)
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability Practices
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
PGOを用いたPostgreSQL on Kubernetes入門(PostgreSQL Conference Japan 2022 発表資料)
PGOを用いたPostgreSQL on Kubernetes入門(PostgreSQL Conference Japan 2022 発表資料)PGOを用いたPostgreSQL on Kubernetes入門(PostgreSQL Conference Japan 2022 発表資料)
PGOを用いたPostgreSQL on Kubernetes入門(PostgreSQL Conference Japan 2022 発表資料)
 
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOps
 
InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
 
Improving Presto performance with Alluxio at TikTok
Improving Presto performance with Alluxio at TikTokImproving Presto performance with Alluxio at TikTok
Improving Presto performance with Alluxio at TikTok
 
Java11へのマイグレーションガイド ~Apache Hadoopの事例~
Java11へのマイグレーションガイド ~Apache Hadoopの事例~Java11へのマイグレーションガイド ~Apache Hadoopの事例~
Java11へのマイグレーションガイド ~Apache Hadoopの事例~
 
SQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet SinghSQL Server Profiler & Performance Monitor - SarabPreet Singh
SQL Server Profiler & Performance Monitor - SarabPreet Singh
 
PostgreSQL Internals (1) for PostgreSQL 9.6 (English)
PostgreSQL Internals (1) for PostgreSQL 9.6 (English)PostgreSQL Internals (1) for PostgreSQL 9.6 (English)
PostgreSQL Internals (1) for PostgreSQL 9.6 (English)
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 

Similar to Database in Kubernetes: Diagnostics and Monitoring

Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
DataWorks Summit
 

Similar to Database in Kubernetes: Diagnostics and Monitoring (20)

Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 
Cloud Native PostgreSQL
Cloud Native PostgreSQLCloud Native PostgreSQL
Cloud Native PostgreSQL
 
MySQL Performance for DevOps
MySQL Performance for DevOpsMySQL Performance for DevOps
MySQL Performance for DevOps
 
Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018
 
Kubernetes Internals
Kubernetes InternalsKubernetes Internals
Kubernetes Internals
 
DevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on ExadataDevOps Supercharged with Docker on Exadata
DevOps Supercharged with Docker on Exadata
 
KubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container SchedulingKubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container Scheduling
 
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
PostgreSQL on Kubernetes: Realizing High Availability with PGO (Postgres Ibiz...
 
KOCOON – KAKAO Automatic K8S Monitoring
KOCOON – KAKAO Automatic K8S MonitoringKOCOON – KAKAO Automatic K8S Monitoring
KOCOON – KAKAO Automatic K8S Monitoring
 
api_testing_k8s.pptx
api_testing_k8s.pptxapi_testing_k8s.pptx
api_testing_k8s.pptx
 
kubernetes_python_api_testing.pptx
kubernetes_python_api_testing.pptxkubernetes_python_api_testing.pptx
kubernetes_python_api_testing.pptx
 
KubeCon Prometheus Salon -- Kubernetes metrics deep dive
KubeCon Prometheus Salon -- Kubernetes metrics deep diveKubeCon Prometheus Salon -- Kubernetes metrics deep dive
KubeCon Prometheus Salon -- Kubernetes metrics deep dive
 
Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-Solving
 
Chicago spark meetup-april2017-public
Chicago spark meetup-april2017-publicChicago spark meetup-april2017-public
Chicago spark meetup-april2017-public
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
Scylla Summit 2016: Compose on Containing the Database
Scylla Summit 2016: Compose on Containing the DatabaseScylla Summit 2016: Compose on Containing the Database
Scylla Summit 2016: Compose on Containing the Database
 
NSCC Training Introductory Class
NSCC Training Introductory Class NSCC Training Introductory Class
NSCC Training Introductory Class
 
Future Science on Future OpenStack
Future Science on Future OpenStackFuture Science on Future OpenStack
Future Science on Future OpenStack
 
LISA2017 Kubernetes: Hit the Ground Running
LISA2017 Kubernetes: Hit the Ground RunningLISA2017 Kubernetes: Hit the Ground Running
LISA2017 Kubernetes: Hit the Ground Running
 

More from Sveta Smirnova

MySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации баговMySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации багов
Sveta Smirnova
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
Sveta Smirnova
 
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaСовременному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Sveta Smirnova
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 

More from Sveta Smirnova (20)

MySQL 2024: Зачем переходить на MySQL 8, если в 5.х всё устраивает?
MySQL 2024: Зачем переходить на MySQL 8, если в 5.х всё устраивает?MySQL 2024: Зачем переходить на MySQL 8, если в 5.х всё устраивает?
MySQL 2024: Зачем переходить на MySQL 8, если в 5.х всё устраивает?
 
MySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for DevelopersMySQL Cookbook: Recipes for Developers
MySQL Cookbook: Recipes for Developers
 
MySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации баговMySQL Test Framework для поддержки клиентов и верификации багов
MySQL Test Framework для поддержки клиентов и верификации багов
 
MySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your BusinessMySQL Cookbook: Recipes for Your Business
MySQL Cookbook: Recipes for Your Business
 
Introduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]sIntroduction into MySQL Query Tuning for Dev[Op]s
Introduction into MySQL Query Tuning for Dev[Op]s
 
Производительность MySQL для DevOps
 Производительность MySQL для DevOps Производительность MySQL для DevOps
Производительность MySQL для DevOps
 
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB ClusterHow to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
How to Avoid Pitfalls in Schema Upgrade with Percona XtraDB Cluster
 
How to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tearsHow to migrate from MySQL to MariaDB without tears
How to migrate from MySQL to MariaDB without tears
 
Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...Modern solutions for modern database load: improvements in the latest MariaDB...
Modern solutions for modern database load: improvements in the latest MariaDB...
 
How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?
 
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения PerconaСовременному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
Современному хайлоду - современные решения: MySQL 8.0 и улучшения Percona
 
How to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with GaleraHow to Avoid Pitfalls in Schema Upgrade with Galera
How to Avoid Pitfalls in Schema Upgrade with Galera
 
How Safe is Asynchronous Master-Master Setup?
 How Safe is Asynchronous Master-Master Setup? How Safe is Asynchronous Master-Master Setup?
How Safe is Asynchronous Master-Master Setup?
 
Introduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]sIntroduction to MySQL Query Tuning for Dev[Op]s
Introduction to MySQL Query Tuning for Dev[Op]s
 
Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?
 
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
A Billion Goods in a Few Categories: When Optimizer Histograms Help and When ...
 
Что нужно знать о трёх топовых фичах MySQL
Что нужно знать  о трёх топовых фичах  MySQLЧто нужно знать  о трёх топовых фичах  MySQL
Что нужно знать о трёх топовых фичах MySQL
 
Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?Billion Goods in Few Categories: How Histograms Save a Life?
Billion Goods in Few Categories: How Histograms Save a Life?
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in Action
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million PeopleWSO2Con2024 - Unleashing the Financial Potential of 13 Million People
WSO2Con2024 - Unleashing the Financial Potential of 13 Million People
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 

Database in Kubernetes: Diagnostics and Monitoring

  • 1. Database in Kubernetes: Diagnostics and Monitoring Sveta Smirnova Principal Support Engineering Coordinator
  • 2. • MySQL Support Engineer • Author MySQL Troubleshooting MySQL Cookbook, 4th Edition • JSON UDF functions • FILTER clause for MySQL • Speaker • Percona Live, OOW, Fosdem, DevConf, HighLoad... Sveta Smirnova
  • 3. Database Performance Influencers 3 © Copyright 2023 Percona ® LLC. All rights reserved
  • 4. • Standard database tools: EXPLAIN • Interactive tools • Log files Query Performance Diagnostics 4 © Copyright 2023 Percona ® LLC. All rights reserved
  • 5. • Interactive tools • Same as on bare metal Concurrency Diagnostics 5 © Copyright 2023 Percona ® LLC. All rights reserved
  • 6. • Managed by Kubernetes • Limits, set by Kubernetes • DBA does not have access to tools, available on bare hardware Hardware 6 © Copyright 2023 Percona ® LLC. All rights reserved
  • 7. • Supported PMM 7 © Copyright 2023 Percona ® LLC. All rights reserved
  • 8. • Supported • All Percona operators are shipped with PMM client PMM 8 © Copyright 2023 Percona ® LLC. All rights reserved
  • 9. • Supported • All Percona operators are shipped with PMM client • PMM server needs to be installed separately • Install via Helm is available PMM 9 © Copyright 2023 Percona ® LLC. All rights reserved
  • 10. • Supported • All Percona operators are shipped with PMM client • PMM server needs to be installed separately • Install via Helm is available • Add pmm.enabled=true into deploy/cr.yaml, configure PMM server host and API key, then apply PMM 10 © Copyright 2023 Percona ® LLC. All rights reserved
  • 11. Database Performance Troubleshooting 11 © Copyright 2023 Percona ® LLC. All rights reserved
  • 12. Database Performance Troubleshooting 12 © Copyright 2023 Percona ® LLC. All rights reserved
  • 13. • Global buffers to cache "hot" data • InnoDB Buffer Pool • WiredTiger Cache • Shared buffers in PostgreSQL • Operation and thread-specific buffers • "Internal" buffers not under user control How Memory Used by Databases? 13 © Copyright 2023 Percona ® LLC. All rights reserved
  • 14. • Physically available for nodes • Limited by the Operator resources: requests: memory: 32G ... # limits: # memory: 32G Memory Limits 14 © Copyright 2023 Percona ® LLC. All rights reserved
  • 15. • kubectl top pods • kubectl top nodes • kubectl describe nodes Memory Diagnostics 15 © Copyright 2023 Percona ® LLC. All rights reserved
  • 16. • kubectl top pods • kubectl top nodes • kubectl describe nodes • Database-specific instruments • Performance Schema in MySQL Memory Diagnostics 16 © Copyright 2023 Percona ® LLC. All rights reserved
  • 17. • Table data • Indexes • Log files • Temporary data How Disk Used by Databases? 17 © Copyright 2023 Percona ® LLC. All rights reserved
  • 19. • kubectl get persistentvolumeclaims Disk Diagnostics 19 © Copyright 2023 Percona ® LLC. All rights reserved
  • 20. • kubectl get persistentvolumeclaims • kubectl describe nodes Disk Diagnostics 20 © Copyright 2023 Percona ® LLC. All rights reserved
  • 21. • kubectl get persistentvolumeclaims • kubectl describe nodes • Error logs of the database 2018-11-28T00:03:26.322318+06:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4188ms. The settings might not be optimal. (flushed=692 and evicted=0, during the time.) Disk Diagnostics 21 © Copyright 2023 Percona ® LLC. All rights reserved
  • 22. • kubectl get persistentvolumeclaims • kubectl describe nodes • Error logs of the database 2018-11-28T00:03:26.322318+06:00 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4188ms. The settings might not be optimal. (flushed=692 and evicted=0, during the time.) • Counters in the database Disk Diagnostics 22 © Copyright 2023 Percona ® LLC. All rights reserved
  • 23. • Handle connections • Threads in MySQL, MongoDB • Sub-processes in PostgreSQL • Perform calculations • Perform IO operations How CPU Used by Databases? 23 © Copyright 2023 Percona ® LLC. All rights reserved
  • 24. resources: requests: cpu: "16" limits: cpu: "32" CPU Limits 24 © Copyright 2023 Percona ® LLC. All rights reserved
  • 25. • kubectl top pods • kubectl top nodes • kubectl describe nodes CPU Diagnostics 25 © Copyright 2023 Percona ® LLC. All rights reserved
  • 26. • kubectl top pods • kubectl top nodes • kubectl describe nodes • Counters in the database CPU Diagnostics 26 © Copyright 2023 Percona ® LLC. All rights reserved
  • 27. • Communication between server and client • Regular client • Application • Replicas • Synchronous nodes How Databases Use Network? 27 © Copyright 2023 Percona ® LLC. All rights reserved
  • 28. • kubectl describe nodes Network Diagnostics 28 © Copyright 2023 Percona ® LLC. All rights reserved
  • 29. • kubectl describe nodes • Logs and statuses of the namespace kube-system and your CNI Network Diagnostics 29 © Copyright 2023 Percona ® LLC. All rights reserved
  • 30. • kubectl describe nodes • Logs and statuses of the namespace kube-system and your CNI • Latency in databases Network Diagnostics 30 © Copyright 2023 Percona ® LLC. All rights reserved
  • 31. • By default, log files are gone after pod failure • Critical in such situations as database crash Log Files Rotation 31 © Copyright 2023 Percona ® LLC. All rights reserved
  • 32. • By default, log files are gone after pod failure • Critical in such situations as database crash • Solution • PXC Operator: separate pod to store logs • Other operators: K8-recommended solutions such as Grafana Loki Log Files Rotation 32 © Copyright 2023 Percona ® LLC. All rights reserved
  • 33. • Created for Support team to automate K8 troubleshooting collections • Owned by Support team • In active progress • New featurs each version pt-k8s-debug-collector 33 © Copyright 2023 Percona ® LLC. All rights reserved
  • 34. pt-stalk • Default for bare metal • Bare hardware • Such tools as • iostat • vmstat • dmesg • top pt-k8s-debug-collector • Default for K8 • kubectl • Such commands as • get pods • get storageclasses • get replicasets • get logs Batch Data Collection 34 © Copyright 2023 Percona ® LLC. All rights reserved
  • 35. • Basic batch collections per databases • MySQL and PXC pt-summary pt-mysql-summary Log files • MongoDB pt-mongodb-summary • PostgreSQL pg_gather Features in pt-k8s-debug-collector 35 © Copyright 2023 Percona ® LLC. All rights reserved
  • 36. • Basic batch collections per databases • MySQL and PXC pt-summary pt-mysql-summary Log files • MongoDB pt-mongodb-summary • PostgreSQL pg_gather • kubectl get Features in pt-k8s-debug-collector 36 © Copyright 2023 Percona ® LLC. All rights reserved
  • 37. • Basic batch collections per databases • MySQL and PXC pt-summary pt-mysql-summary Log files • MongoDB pt-mongodb-summary • PostgreSQL pg_gather • kubectl get • kubectl logs Features in pt-k8s-debug-collector 37 © Copyright 2023 Percona ® LLC. All rights reserved
  • 38. • pt-stalk • More kubectl commands • Extended MongoDB support • Nicer output format for summaries Future of the pt-k8s-debug-collector 38 © Copyright 2023 Percona ® LLC. All rights reserved
  • 39. • Mind limits in cr.yaml • Work with K8 administrators for setting up policies, allowing you to view hardware usage • Setup Loki or similar solution to save the log files after restart • Enable online database instrumentation • Use PMM or similar monitoring solution • Plan in advance Conclusion 39 © Copyright 2023 Percona ® LLC. All rights reserved
  • 40. Percona K8 Operators PMM Demo pt-k8s-debug-collector pt-stalk pg_gather Grafana Loki Tools Mentioned 40 © Copyright 2023 Percona ® LLC. All rights reserved