SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Fast Incremental Backups
with Percona Server and Percona XtraBackup
Laurynas
Biveinis
Agenda
• Incremental XtraBackup: performance
• Incremental XtraBackup with bitmaps:
performance
• The cost of the feature
• INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• Implementation
– Bitmap file format
– New server thread
2
Incremental XtraBackup:
Performance
3
0.10% 1.00% 10.00% 100.00%
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
Delta Size
BackupTime
• Does time to backup depend on the % of changed data?
Incremental XtraBackup: How Data
Page Copying Works
4
LSN = 950
LSN = 960LSN = 960
LSN = 1002
LSN = 1003
LSN = 940
LSN = 1010
table.ibd
LSN
>
1000
?
Base Backup
LSN = 1000
read
read
read
read
read
read
write
write
write
Table.ibd.delta
Can we avoid reading
the old pages?
MySQL
Incremental XtraBackup: Can We
Avoid Reading the Old Pages?
• http://bit.ly/FBIncBackup
5
Incremental XtraBackup: Can We
Avoid Reading the Old Pages?
• How do we know which pages to read
then?
• Two ways to get the modification LSN of a
page:
– It is written on the page, - or -
– We can figure it out from the redo log
• The log is cyclical, we must, in the server,
save the info before it is overwritten
6
Changed Page Tracking
• Server:
– --innodb-track-changed-pages=TRUE
– Documentation at
http://bit.ly/psbmpdoc
– 5.1/5.5/5.6
• XtraBackup:
– Zero configuration!
7
Incremental XtraBackup with
Changed Page Tracking
8
LSN = 950
LSN = 960LSN = 960
LSN = 1002
LSN = 1003
LSN = 940
LSN = 1010
table.ibd
LSN
>
1000
?
Base Backup
LSN = 1000
read
read
read
write
write
write
Table.ibd.delta
Percona
Server
…
Changed pages between
LSNs 980 and 1020:
1002, 1003, 1010
...
Incremental XtraBackup with
Changed Page Tracking: Performance
9
0.00% 0.01% 1.00% 100.00%
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
Full Scan
Bitmap
Delta Size
BackupTime
Percona Server with Changed Page
Tracking: Server Overhead
• Nothing is ever free!
– But the price might be very well
acceptable
• Potential overhead #1: extra disk
space requirements
• Potential overhead #2: extra code
running in the server
1
0
Percona Server with Changed Page
Tracking: Server Overhead
1
1
1 2 3 4 5 6 7 8
0
100
200
300
400
500
600
700
800
Log and bitmap file size comparison
Bitmap file #
Logbytes/bitmapbyte
• A good case: > 100 log bytes for 1 bmp byte
Percona Server with Changed Page
Tracking: Server Overhead
1
2
• A bad case: 3-15 log bytes per 1 bmp byte
• https://bugs.launchpad.net/bugs/1269547
– We are considering fix options
Percona Server with Changed Page
Tracking: Server Overhead
• Impact on TPS and response time:
– Couldn't find it
– If you ever do find it, report it to us and
try
--innodb_log_checksum_algorithm=crc32
●
http://bit.ly/pslogcrc32
1
3
Bitmap File Naming & Sizing
• ib_modified_log_<seq>_<LSN>.xdb
– <Seq>: 1, 2, 3, ...
– <LSN>: the server LSN at the file create
time
• Rotated on
–Server start
–innodb_max_bitmap_file_size
1
4
Bitmap File Management
• PURGE CHANGED_PAGE_BITMAPS BEFORE <lsn>
– ib_1_8192.xdb
– ib_2_10000.xdb
– ib_3_20000.xdb
– Full backup taken, LSN = 22000
– PURGE C_P_B BEFORE 22000;
– ib_4_30000.xdb
– Incremental backup taken, LSN = 33000
– PURGE C_P_B BEFORE 33000;
1
5
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• Percona Server can read the bitmaps too
1
6
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
CREATE TABLE `INNODB_CHANGED_PAGES` (
`space_id` int(11) unsigned NOT NULL DEFAULT '0',
`page_id` int(11) unsigned NOT NULL DEFAULT '0',
`start_lsn` bigint(21) unsigned NOT NULL DEFAULT '0',
`end_lsn` bigint(21) unsigned NOT NULL DEFAULT '0'
)
• start_lsn and end_lsn are always at the checkpoint boundary
• Does not show the exact LSN of a change
• Does not show the number of changes for one page
• Does show the number of flushes for a page over the workload
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
1
7
SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
space_id page_id start_lsn end_lsn
0 0 8204 38470
0 1 8204 38470
5 0 8204 38470
5 3 8204 38470
0 1 38471 50000
5 3 38471 50000
5 3 50001 60000
• Don't query like that in production!
– It will read all the bitmaps you have. Gigabytes, terabytes, ...
– Add WHERE start_lsn > X AND end_lsn < Y (index condition pushdown
implemented for this case)
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• Which tables are written to?
1
8
SELECT DISTINCT space_id FROM
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE ...;
space_id
0
10
SELECT DISTINCT t1.space_id AS space_id, t2.schema AS db,
t2.name AS tname
FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES AS t1,
INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t2
WHERE t1.space_id = t2.space AND t1.start_lsn >...
space_id db tname
0 SYS_FOREIGN
0 SYS_FOREIGN_COLS
10 test foo
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• What are the hottest tables?
1
9
SELECT space_id,
COUNT(space_id) AS number_of_flushes
FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
GROUP BY space_id
ORDER BY number_of_flushes DESC;
space_id number_of_flushes
0 65
10 5
11 4
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• What are the hottest pages?
2
0
SELECT space_id, page_id,
COUNT(page_id) AS number_of_flushes
FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
GROUP BY space_id, page_id
HAVING number_of_flushes > 2
ORDER BY number_of_flushes DESC
LIMIT 8;
space_id page_id number_of_flushes
0 5 3
0 7 3
0 0 2
0 11 2
10 3 2
0 1 2
0 12 2
0 2 2
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• For complex queries, copy data first
2
1
CREATE TEMPORARY TABLE icp (
space_id INT(11) NOT NULL,
page_id INT(11) NOT NULL,
start_lsn BIGINT(21) NOT NULL,
end_lsn BIGINT(21) NOT NULL,
INDEX page_id(space_id, page_id),
INDEX start_lsn(start_lsn),
INDEX end_lsn(end_lsn)) ENGINE=InnoDB;
INSERT INTO icp SELECT * FROM
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE
start_lsn > 8000;
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
• For complex queries, copy data first
2
2
EXPLAIN SELECT DISTINCT space_id FROM
INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
id select_type table type possible_keys key key_len
ref rows Extra
1 SIMPLE INNODB_CHANGED_PAGES ALL NULL NULL NULL
NULL NULL Using temporary
EXPLAIN SELECT DISTINCT space_id FROM icp;
id select_type table type possible_keys key key_len
ref rows Extra
1 SIMPLE icp index NULL page_id 8 NULL 74 Using
index
Implementation: File Format
2
3
Data for checkpoint at LSN 9000
LSN 10000
LSN 10500
A sequence of per-checkpoint varying number of data pages:
For each checkpoint:
space, start page space, start page space, start page
4KB
Each page contains a bitmap for the next 32480 pages in space starting
from start page
Implementation: Server Side
• A new XtraDB thread
– 1. Wait for log checkpoint completed event
– 2. Read the log up to the checkpoint, write the bitmap
– 3. goto 1
• Little data sharing with the rest of XtraDB
– log_sys->mutex for:
●
setting and getting LSNs;
●
calculating log read offset from LSN.
• Little extra code for the query threads
– Unread log overwrite check
– Firing of the log checkpoint completed event
2
4
Implementation: Things We Had to
Account For
• Maximum checkpoint age violation
– Destroys untracked log data
– Make effort to avoid, but in the end we
allow to overwrite it
– Responding server > fast backups
• Crash recovery
– Re-read the log if available
2
5
Conclusions
• Percona Server together with Percona XtraBackup:
• Enable faster incremental backups
• Enable more frequent incremental backups
• Does not hurt server operation, but have to
manage the bitmaps now
• New INFORMATION_SCHEMA table for gaining
insight into data change patterns
• Is actually being used, http://bit.ly/psbmpbugs
• Thank you! Questions?
2
6

Contenu connexe

Tendances

Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3Sameer Kumar
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restoreVasudeva Rao
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningLenz Grimmer
 
Fail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreFail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreAlexey Kovyazin
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retoreVasudeva Rao
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recoveryimranasayed
 
[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)altistory
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsMydbops
 
Tuning Slow Running SQLs in PostgreSQL
Tuning Slow Running SQLs in PostgreSQLTuning Slow Running SQLs in PostgreSQL
Tuning Slow Running SQLs in PostgreSQLAshnikbiz
 
제3회난공불락 오픈소스 인프라세미나 - lustre
제3회난공불락 오픈소스 인프라세미나 - lustre제3회난공불락 오픈소스 인프라세미나 - lustre
제3회난공불락 오픈소스 인프라세미나 - lustreTommy Lee
 
Rman Presentation
Rman PresentationRman Presentation
Rman PresentationRick van Ek
 
Oracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesOracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesSaiful
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on awsEmanuel Calvo
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...xKinAnx
 
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...
Ibm db2 10.5 for linux, unix, and windows   getting started with db2 installa...Ibm db2 10.5 for linux, unix, and windows   getting started with db2 installa...
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...bupbechanhgmail
 
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-AsibleTommy Lee
 
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareAltinity Ltd
 

Tendances (20)

Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3
 
All types of backups and restore
All types of backups and restoreAll types of backups and restore
All types of backups and restore
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
 
Hbase Nosql
Hbase NosqlHbase Nosql
Hbase Nosql
 
Storage spaces direct webinar
Storage spaces direct webinarStorage spaces direct webinar
Storage spaces direct webinar
 
Fail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreFail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something more
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retore
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recovery
 
[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)
 
PostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability MethodsPostgreSQL Replication High Availability Methods
PostgreSQL Replication High Availability Methods
 
Tuning Slow Running SQLs in PostgreSQL
Tuning Slow Running SQLs in PostgreSQLTuning Slow Running SQLs in PostgreSQL
Tuning Slow Running SQLs in PostgreSQL
 
Les 12 fl_db
Les 12 fl_dbLes 12 fl_db
Les 12 fl_db
 
제3회난공불락 오픈소스 인프라세미나 - lustre
제3회난공불락 오픈소스 인프라세미나 - lustre제3회난공불락 오픈소스 인프라세미나 - lustre
제3회난공불락 오픈소스 인프라세미나 - lustre
 
Rman Presentation
Rman PresentationRman Presentation
Rman Presentation
 
Oracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesOracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slides
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...
 
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...
Ibm db2 10.5 for linux, unix, and windows   getting started with db2 installa...Ibm db2 10.5 for linux, unix, and windows   getting started with db2 installa...
Ibm db2 10.5 for linux, unix, and windows getting started with db2 installa...
 
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Asible
 
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
 

En vedette

Pquery_presentation_03 2
Pquery_presentation_03 2Pquery_presentation_03 2
Pquery_presentation_03 2Alexey Bychko
 
Tracking Page Changes for Your Database and Bitmap Backups
Tracking Page Changes for Your Database and Bitmap BackupsTracking Page Changes for Your Database and Bitmap Backups
Tracking Page Changes for Your Database and Bitmap BackupsLaurynas Biveinis
 
Uc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-moreUc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-moreArvids Godjuks
 
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zarafa
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupJervin Real
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backupAndrejs Vorobjovs
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsRonald Bradford
 

En vedette (7)

Pquery_presentation_03 2
Pquery_presentation_03 2Pquery_presentation_03 2
Pquery_presentation_03 2
 
Tracking Page Changes for Your Database and Bitmap Backups
Tracking Page Changes for Your Database and Bitmap BackupsTracking Page Changes for Your Database and Bitmap Backups
Tracking Page Changes for Your Database and Bitmap Backups
 
Uc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-moreUc2010 xtra backup-hot-backups-and-more
Uc2010 xtra backup-hot-backups-and-more
 
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
Zararfa SummerCamp 2012 - Performing fast backups in large scale environments...
 
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackupPLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
PLAM 2015 - Evolving Backups Strategy, Devploying pyxbackup
 
My two cents about Mysql backup
My two cents about Mysql backupMy two cents about Mysql backup
My two cents about Mysql backup
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 

Similaire à Fast Incremental Backups with Percona Server and Percona XtraBackup / PLMCE 2014

Incremental backups
Incremental backupsIncremental backups
Incremental backupsVlad Lesin
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New FeaturesAmazon Web Services
 
Cloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analyticsamesar0
 
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTigerLet the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTigerJon Rangel
 
Resolving Firebird performance problems
Resolving Firebird performance problemsResolving Firebird performance problems
Resolving Firebird performance problemsAlexey Kovyazin
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesInMobi Technology
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudCeph Community
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudPatrick McGarry
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelDaniel Coupal
 
Lightweight Transactions at Lightning Speed
Lightweight Transactions at Lightning SpeedLightweight Transactions at Lightning Speed
Lightweight Transactions at Lightning SpeedScyllaDB
 
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014Amazon Web Services
 
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltd
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltdhbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltd
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., LtdMichael Stack
 
Demystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live scDemystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live scEmanuel Calvo
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCoburn Watson
 
ELK: Moose-ively scaling your log system
ELK: Moose-ively scaling your log systemELK: Moose-ively scaling your log system
ELK: Moose-ively scaling your log systemAvleen Vig
 
SQL Server Deep Drive
SQL Server Deep Drive SQL Server Deep Drive
SQL Server Deep Drive DataArt
 
1404 app dev series - session 8 - monitoring & performance tuning
1404   app dev series - session 8 - monitoring & performance tuning1404   app dev series - session 8 - monitoring & performance tuning
1404 app dev series - session 8 - monitoring & performance tuningMongoDB
 
High Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and SolutionsHigh Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and SolutionsYinghai Lu
 
Performance & Scalability Improvements in Perforce
Performance & Scalability Improvements in PerforcePerformance & Scalability Improvements in Perforce
Performance & Scalability Improvements in PerforcePerforce
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellEmily Ikuta
 

Similaire à Fast Incremental Backups with Percona Server and Percona XtraBackup / PLMCE 2014 (20)

Incremental backups
Incremental backupsIncremental backups
Incremental backups
 
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
(DAT402) Amazon RDS PostgreSQL:Lessons Learned & New Features
 
Cloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analytics
 
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTigerLet the Tiger Roar! - MongoDB 3.0 + WiredTiger
Let the Tiger Roar! - MongoDB 3.0 + WiredTiger
 
Resolving Firebird performance problems
Resolving Firebird performance problemsResolving Firebird performance problems
Resolving Firebird performance problems
 
PostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major FeaturesPostgreSQL 9.5 - Major Features
PostgreSQL 9.5 - Major Features
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack CloudJourney to Stability: Petabyte Ceph Cluster in OpenStack Cloud
Journey to Stability: Petabyte Ceph Cluster in OpenStack Cloud
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
 
Lightweight Transactions at Lightning Speed
Lightweight Transactions at Lightning SpeedLightweight Transactions at Lightning Speed
Lightweight Transactions at Lightning Speed
 
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
(WEB401) Optimizing Your Web Server on AWS | AWS re:Invent 2014
 
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltd
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltdhbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltd
hbaseconasia2019 Phoenix Practice in China Life Insurance Co., Ltd
 
Demystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live scDemystifying postgres logical replication percona live sc
Demystifying postgres logical replication percona live sc
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
 
ELK: Moose-ively scaling your log system
ELK: Moose-ively scaling your log systemELK: Moose-ively scaling your log system
ELK: Moose-ively scaling your log system
 
SQL Server Deep Drive
SQL Server Deep Drive SQL Server Deep Drive
SQL Server Deep Drive
 
1404 app dev series - session 8 - monitoring & performance tuning
1404   app dev series - session 8 - monitoring & performance tuning1404   app dev series - session 8 - monitoring & performance tuning
1404 app dev series - session 8 - monitoring & performance tuning
 
High Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and SolutionsHigh Performance Erlang - Pitfalls and Solutions
High Performance Erlang - Pitfalls and Solutions
 
Performance & Scalability Improvements in Perforce
Performance & Scalability Improvements in PerforcePerformance & Scalability Improvements in Perforce
Performance & Scalability Improvements in Perforce
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a Nutshell
 

Plus de Laurynas Biveinis

Percona Server for MySQL 8.0 @ Percona Live 2019
Percona Server for MySQL 8.0 @ Percona Live 2019Percona Server for MySQL 8.0 @ Percona Live 2019
Percona Server for MySQL 8.0 @ Percona Live 2019Laurynas Biveinis
 
Percona Server 5.7: Key Performance Algorithms
Percona Server 5.7: Key Performance AlgorithmsPercona Server 5.7: Key Performance Algorithms
Percona Server 5.7: Key Performance AlgorithmsLaurynas Biveinis
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsLaurynas Biveinis
 
Developing a database server: software engineer's view
Developing a database server: software engineer's viewDeveloping a database server: software engineer's view
Developing a database server: software engineer's viewLaurynas Biveinis
 
XtraDB 5.6 and 5.7: Key Performance Algorithms
XtraDB 5.6 and 5.7: Key Performance AlgorithmsXtraDB 5.6 and 5.7: Key Performance Algorithms
XtraDB 5.6 and 5.7: Key Performance AlgorithmsLaurynas Biveinis
 
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014Laurynas Biveinis
 

Plus de Laurynas Biveinis (9)

Percona Server for MySQL 8.0 @ Percona Live 2019
Percona Server for MySQL 8.0 @ Percona Live 2019Percona Server for MySQL 8.0 @ Percona Live 2019
Percona Server for MySQL 8.0 @ Percona Live 2019
 
MySQL Ecosystem in 2018
MySQL Ecosystem in 2018MySQL Ecosystem in 2018
MySQL Ecosystem in 2018
 
Percona Server 8.0
Percona Server 8.0Percona Server 8.0
Percona Server 8.0
 
Percona Server 8.0
Percona Server 8.0Percona Server 8.0
Percona Server 8.0
 
Percona Server 5.7: Key Performance Algorithms
Percona Server 5.7: Key Performance AlgorithmsPercona Server 5.7: Key Performance Algorithms
Percona Server 5.7: Key Performance Algorithms
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
 
Developing a database server: software engineer's view
Developing a database server: software engineer's viewDeveloping a database server: software engineer's view
Developing a database server: software engineer's view
 
XtraDB 5.6 and 5.7: Key Performance Algorithms
XtraDB 5.6 and 5.7: Key Performance AlgorithmsXtraDB 5.6 and 5.7: Key Performance Algorithms
XtraDB 5.6 and 5.7: Key Performance Algorithms
 
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014
Percona Server 5.6: Enterprise-Grade MySQL / PLMCE 2014
 

Dernier

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Dernier (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Fast Incremental Backups with Percona Server and Percona XtraBackup / PLMCE 2014

  • 1. Fast Incremental Backups with Percona Server and Percona XtraBackup Laurynas Biveinis
  • 2. Agenda • Incremental XtraBackup: performance • Incremental XtraBackup with bitmaps: performance • The cost of the feature • INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • Implementation – Bitmap file format – New server thread 2
  • 3. Incremental XtraBackup: Performance 3 0.10% 1.00% 10.00% 100.00% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Delta Size BackupTime • Does time to backup depend on the % of changed data?
  • 4. Incremental XtraBackup: How Data Page Copying Works 4 LSN = 950 LSN = 960LSN = 960 LSN = 1002 LSN = 1003 LSN = 940 LSN = 1010 table.ibd LSN > 1000 ? Base Backup LSN = 1000 read read read read read read write write write Table.ibd.delta Can we avoid reading the old pages? MySQL
  • 5. Incremental XtraBackup: Can We Avoid Reading the Old Pages? • http://bit.ly/FBIncBackup 5
  • 6. Incremental XtraBackup: Can We Avoid Reading the Old Pages? • How do we know which pages to read then? • Two ways to get the modification LSN of a page: – It is written on the page, - or - – We can figure it out from the redo log • The log is cyclical, we must, in the server, save the info before it is overwritten 6
  • 7. Changed Page Tracking • Server: – --innodb-track-changed-pages=TRUE – Documentation at http://bit.ly/psbmpdoc – 5.1/5.5/5.6 • XtraBackup: – Zero configuration! 7
  • 8. Incremental XtraBackup with Changed Page Tracking 8 LSN = 950 LSN = 960LSN = 960 LSN = 1002 LSN = 1003 LSN = 940 LSN = 1010 table.ibd LSN > 1000 ? Base Backup LSN = 1000 read read read write write write Table.ibd.delta Percona Server … Changed pages between LSNs 980 and 1020: 1002, 1003, 1010 ...
  • 9. Incremental XtraBackup with Changed Page Tracking: Performance 9 0.00% 0.01% 1.00% 100.00% 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Full Scan Bitmap Delta Size BackupTime
  • 10. Percona Server with Changed Page Tracking: Server Overhead • Nothing is ever free! – But the price might be very well acceptable • Potential overhead #1: extra disk space requirements • Potential overhead #2: extra code running in the server 1 0
  • 11. Percona Server with Changed Page Tracking: Server Overhead 1 1 1 2 3 4 5 6 7 8 0 100 200 300 400 500 600 700 800 Log and bitmap file size comparison Bitmap file # Logbytes/bitmapbyte • A good case: > 100 log bytes for 1 bmp byte
  • 12. Percona Server with Changed Page Tracking: Server Overhead 1 2 • A bad case: 3-15 log bytes per 1 bmp byte • https://bugs.launchpad.net/bugs/1269547 – We are considering fix options
  • 13. Percona Server with Changed Page Tracking: Server Overhead • Impact on TPS and response time: – Couldn't find it – If you ever do find it, report it to us and try --innodb_log_checksum_algorithm=crc32 ● http://bit.ly/pslogcrc32 1 3
  • 14. Bitmap File Naming & Sizing • ib_modified_log_<seq>_<LSN>.xdb – <Seq>: 1, 2, 3, ... – <LSN>: the server LSN at the file create time • Rotated on –Server start –innodb_max_bitmap_file_size 1 4
  • 15. Bitmap File Management • PURGE CHANGED_PAGE_BITMAPS BEFORE <lsn> – ib_1_8192.xdb – ib_2_10000.xdb – ib_3_20000.xdb – Full backup taken, LSN = 22000 – PURGE C_P_B BEFORE 22000; – ib_4_30000.xdb – Incremental backup taken, LSN = 33000 – PURGE C_P_B BEFORE 33000; 1 5
  • 16. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • Percona Server can read the bitmaps too 1 6 SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CHANGED_PAGES; CREATE TABLE `INNODB_CHANGED_PAGES` ( `space_id` int(11) unsigned NOT NULL DEFAULT '0', `page_id` int(11) unsigned NOT NULL DEFAULT '0', `start_lsn` bigint(21) unsigned NOT NULL DEFAULT '0', `end_lsn` bigint(21) unsigned NOT NULL DEFAULT '0' ) • start_lsn and end_lsn are always at the checkpoint boundary • Does not show the exact LSN of a change • Does not show the number of changes for one page • Does show the number of flushes for a page over the workload
  • 17. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES 1 7 SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES; space_id page_id start_lsn end_lsn 0 0 8204 38470 0 1 8204 38470 5 0 8204 38470 5 3 8204 38470 0 1 38471 50000 5 3 38471 50000 5 3 50001 60000 • Don't query like that in production! – It will read all the bitmaps you have. Gigabytes, terabytes, ... – Add WHERE start_lsn > X AND end_lsn < Y (index condition pushdown implemented for this case)
  • 18. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • Which tables are written to? 1 8 SELECT DISTINCT space_id FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE ...; space_id 0 10 SELECT DISTINCT t1.space_id AS space_id, t2.schema AS db, t2.name AS tname FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES AS t1, INFORMATION_SCHEMA.INNODB_SYS_TABLES AS t2 WHERE t1.space_id = t2.space AND t1.start_lsn >... space_id db tname 0 SYS_FOREIGN 0 SYS_FOREIGN_COLS 10 test foo
  • 19. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • What are the hottest tables? 1 9 SELECT space_id, COUNT(space_id) AS number_of_flushes FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES GROUP BY space_id ORDER BY number_of_flushes DESC; space_id number_of_flushes 0 65 10 5 11 4
  • 20. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • What are the hottest pages? 2 0 SELECT space_id, page_id, COUNT(page_id) AS number_of_flushes FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES GROUP BY space_id, page_id HAVING number_of_flushes > 2 ORDER BY number_of_flushes DESC LIMIT 8; space_id page_id number_of_flushes 0 5 3 0 7 3 0 0 2 0 11 2 10 3 2 0 1 2 0 12 2 0 2 2
  • 21. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • For complex queries, copy data first 2 1 CREATE TEMPORARY TABLE icp ( space_id INT(11) NOT NULL, page_id INT(11) NOT NULL, start_lsn BIGINT(21) NOT NULL, end_lsn BIGINT(21) NOT NULL, INDEX page_id(space_id, page_id), INDEX start_lsn(start_lsn), INDEX end_lsn(end_lsn)) ENGINE=InnoDB; INSERT INTO icp SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES WHERE start_lsn > 8000;
  • 22. INFORMATION_SCHEMA.INNODB_CHANGED_PAGES • For complex queries, copy data first 2 2 EXPLAIN SELECT DISTINCT space_id FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE INNODB_CHANGED_PAGES ALL NULL NULL NULL NULL NULL Using temporary EXPLAIN SELECT DISTINCT space_id FROM icp; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE icp index NULL page_id 8 NULL 74 Using index
  • 23. Implementation: File Format 2 3 Data for checkpoint at LSN 9000 LSN 10000 LSN 10500 A sequence of per-checkpoint varying number of data pages: For each checkpoint: space, start page space, start page space, start page 4KB Each page contains a bitmap for the next 32480 pages in space starting from start page
  • 24. Implementation: Server Side • A new XtraDB thread – 1. Wait for log checkpoint completed event – 2. Read the log up to the checkpoint, write the bitmap – 3. goto 1 • Little data sharing with the rest of XtraDB – log_sys->mutex for: ● setting and getting LSNs; ● calculating log read offset from LSN. • Little extra code for the query threads – Unread log overwrite check – Firing of the log checkpoint completed event 2 4
  • 25. Implementation: Things We Had to Account For • Maximum checkpoint age violation – Destroys untracked log data – Make effort to avoid, but in the end we allow to overwrite it – Responding server > fast backups • Crash recovery – Re-read the log if available 2 5
  • 26. Conclusions • Percona Server together with Percona XtraBackup: • Enable faster incremental backups • Enable more frequent incremental backups • Does not hurt server operation, but have to manage the bitmaps now • New INFORMATION_SCHEMA table for gaining insight into data change patterns • Is actually being used, http://bit.ly/psbmpbugs • Thank you! Questions? 2 6