28
<Insert Picture Here> InnoDB: Status, Architecture and New Features MySQL Conference and Expo, 2010 3:05 pm, April 13, 2010 Calvin Sun, Principal Software Engineer, Oracle/InnoDB Rob Young, Sr. Product Manager, Oracle/MySQL

InnoDB: Status, Architecture and New Features

Embed Size (px)

DESCRIPTION

What’s New Since Last UC? InnoDB Architecture

Citation preview

Page 1: InnoDB: Status, Architecture and New Features

<Insert Picture Here>

InnoDB: Status, Architecture and New FeaturesMySQL Conference and Expo, 2010

3:05 pm, April 13, 2010

Calvin Sun, Principal Software Engineer, Oracle/InnoDBRob Young, Sr. Product Manager, Oracle/MySQL

Page 2: InnoDB: Status, Architecture and New Features

2

Agenda

• What’s New Since Last UC?

• InnoDB Architecture

Page 3: InnoDB: Status, Architecture and New Features

3

• Where were you on 2005-Oct-7 at 5:14pm EDT?

• 81% of MySQL shops use InnoDB

• Oracle’s commitment• Be the technology leader for InnoDB/MySQL• Community involvement• Strategic, integrated product direction• Align Engineering/Product teams• The best technical support. Period.

• Goal = “Make MySQL a better MySQL”

• First fruits in MySQL 5.1, 5.5

Make MySQL a better MySQL

Page 4: InnoDB: Status, Architecture and New Features

4

• Barracuda FILE FORMAT (more animals to come…)• Default for executing threads = unlimited• Faster Index Creation• Efficient Data Compression• Off-page storage options for Large Objects, Variable

Length Columns• New INFORMATION_SCHEMA tables• More…

From UC 2009InnoDB 1.0 Announced!

Page 5: InnoDB: Status, Architecture and New Features

5

Performance/Availability improvements (since 1.0.3):• Better control of Spin Lock polling• Dynamic control of insert buffering, adaptive hash indexing • Group commit is back!• Improved read ahead algorithms• Enabled multiple background threads• Making buffer cache scan resistant• Improved crash recovery performance• More…

Better Instrumentation/Diagnostics• Optimized SHOW ENGINE INNODB MUTEX

GA!Making MySQL 5.1 a better MySQL

InnoDB 1.0 is now option in MySQL 5.1.46

Page 6: InnoDB: Status, Architecture and New Features

6

MySQL Server

CSV

Enterprise Management Tools and

Utilities

MySQL Enterprise MonitorMySQL Query Analyzer

MySQL WorkBenchBackup & Recovery

SecurityReplication

ClusterPartitioning

INFORMATION_SCHEMAPERFORMANCE_SCHEMA

MySQL 5.1 Pluggable Architecture

1.0

GA!

Page 7: InnoDB: Status, Architecture and New Features

7

My.cnf ignore_builtin_innodb plugin-load=innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so; ...

Command Linemysqld --ignore-builtin-innodb --plugin-load=innodb=ha_innodb_plugin.so;...

Options for Installing/Enabling in 5.1

INSTALL PLUGININSTALL PLUGIN INNODB SONAME 'ha_innodb_plugin.so';...

GA!

Page 8: InnoDB: Status, Architecture and New Features

8

Performance improvements (relative to 1.0):• Multiple Buffer Pool Instances• Multiple Rollback Segments• Extended Change Buffering with delete buffering and purge

bufferingBetter isolation of threads and mutex contention

• Improved Purge Scheduling • Improved Log Sys mutex• Separate Flush List mutex

Better Instrumentation/Diagnostics• InnoDB stats in 5.5 PERFORMANCE_SCHEMA

Beta

“InnoDB Plugin: Performance Features and Benchmarks”, InnoDB Team, Thurs, 10:50 am, Ballroom C

Making MySQL 5.5 a better MySQL

InnoDB 1.1 is a better InnoDB 1.0!

Page 9: InnoDB: Status, Architecture and New Features

9

MySQL 5.5/InnoDB 1.1 SysBench Benchmarks

Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10

MySQL 5.1.40(InnoDB built in)

MySQL 5.1.40 (InnoDB 1.0)

MySQL 5.5.4 (InnoDB 1.1)

At 1024 Connections:• 188% performance gain for MySQL 5.5 over 5.1.40 (InnoDB 1.0)• 200% performance gain for MySQL 5.5 over 5.1.40 (InnoDB built in)

Page 10: InnoDB: Status, Architecture and New Features

10

MySQL 5.5/InnoDB 1.1 SysBench Benchmarks

MySQL 5.1.40(InnoDB built in)

MySQL 5.1.40 (InnoDB 1.0)

MySQL 5.5.4 (InnoDB 1.1)

Intel Xeon X7460 x86_64 4 CPU x 6 Cores/CPU 2.66 GHz, 32GB RAM Fedora 10

At 1024 Connections:• 164% performance gain for MySQL 5.5 over 5.1.40 (InnoDB 1.0)• 364% performance gain for MySQL 5.5 over 5.1.40 (InnoDB built in)

Page 11: InnoDB: Status, Architecture and New Features

11

MySQL 5.5 / InnoDB 1.1 ScalabilitydbStress

MySQL 5.5.4 is reaching higher TPS levels than othersMySQL 5.5.4 is better prepared now to scale up to 32 coreshttp://dimitrik.free.fr/blog/archives/2010/04/mysql-performance-554-dbstress.html

Read-only

Read-write

cores

TPS

Page 12: InnoDB: Status, Architecture and New Features

12

InnoDB Architecture

Page 13: InnoDB: Status, Architecture and New Features

13

InnoDB Architecture: Component Model

Handler API

Server

Access Methods

Storage and IO Manager

Concurrency Control / Locking

Memory / Buffer Pool Manager

Transaction Manager

Logging and Recovery

Monitoring and Diagnostics

Page 14: InnoDB: Status, Architecture and New Features

14

InnoDB Architecture: Runtime Model

InnoDB Code

Memory Threads:-master-read io-write io-ibuf io-log io-lock timeout-monitor

Buffer Pool-data-index-undo-adaptive hash index

Background threads

FilesLog

buffer buffer pool Misc buffer

Page 15: InnoDB: Status, Architecture and New Features

15

Just Like Traffic System

Threads

Synchronization

Resources Scheduling

Page 16: InnoDB: Status, Architecture and New Features

16

How to Solve Traffic Problem? Threads

Have more lanes• multiple background I/O threads

Build another road• Split purge thread

Car pool / batch• group commit• delete buffering and purge buffering

Page 17: InnoDB: Status, Architecture and New Features

17

How to Solve Traffic Problem?Synchronization

Better / faster signals• faster locking for improved scalability • using a portable PAUSE to InnoDB spin loop• control over Spin lock polling

Change signal location• Improved log sys mutex • Separate flush list mutex

Page 18: InnoDB: Status, Architecture and New Features

18

How to Solve Traffic Problem?

ResourcesMore resource providers

• multiple buffer pool instances• multiple rollback segments

Better resource management• using operating system memory allocators• native asynchronous I/O on Linux

Page 19: InnoDB: Status, Architecture and New Features

19

How to Solve Traffic Problem?Scheduling

Better scheduling / flow control• Changes in read ahead algorithm• Making buffer cache scan resistant • Controlling master thread I/O rate• Controlling flushing rate of dirty pages

Faster accident handling• Improvements to crash recovery performance

Monitoring• Performance schema for InnoDB

Page 20: InnoDB: Status, Architecture and New Features

20

InnoDB Architecture: Data Storage

Extent

Segment

Extent

Extent Extent

an extent = 64 pages

Extent

Trx id

Row

Field 1

Roll pointer

Field pointers

Field 2 Field n

Row

Page

Row

Row

Row Row

Leaf node segment

Tablespace

Rollback segment

Non-leaf node segment

RowRow

Page 21: InnoDB: Status, Architecture and New Features

21

InnoDB Architecture: Data Storage

Data compression: Compress data & index pages from normal 16 KB size to specified compressed page size

New row format: New DYNAMIC mode stores long columns entirely “off-page”.

Multiple rollback segments: from 1 to 128 TRUNCATE TABLE re-creates the *.ibd file to

reclaim space

Page 22: InnoDB: Status, Architecture and New Features

22

What about InnoDB Hot Backup?

Now called “MySQL Enterprise Backup” Backs up running databases without

locking InnoDB data Supports InnoDB and MyISAM Features:

• Compressed backup• Partial backup• Point-in-time recovery

“Backup Strategies with MySQL Enterprise Backup”, InnoDB Team, Wed, 3:05 pm, Ballroom D

Page 23: InnoDB: Status, Architecture and New Features

23

New Features in Backup 3.5

Incremental backup Support of Barracuda file format

• Backup of compressed tables Backup of additional files, such as partition

files• Backup of in-memory database with

--exec-when-locked option

Email [email protected] to register for beta.

Beta

Page 24: InnoDB: Status, Architecture and New Features

24

Recap: Plugin 1.0 Top Ten Performance and Scalability Enhancements1. Faster locking for improved scalability2. Using operating system memory allocators3. Multiple background I/O threads4. Group commit is back5. Controlling master thread I/O rate6. Controlling flushing rate of dirty pages7. Changes in read ahead algorithm8. Using a portable PAUSE to InnoDB spin loop9. Making buffer cache scan resistant10. Improvements to crash recovery performance

Page 25: InnoDB: Status, Architecture and New Features

25

Recap: Plugin 1.1 Performance and Scalability Enhancements Multiple buffer pool instances Multiple rollback segments Improved purge scheduling Improved Log Sys mutex Separate flush list mutex Extended change buffering with delete buffering and

purge buffering: speed up random deletes Native async I/O support on Linux Performance schema for InnoDB

Page 26: InnoDB: Status, Architecture and New Features

26

Deep Dive

Backup Strategies with MySQL Enterprise Backup, InnoDB Team, Wed, 3:05 pm, Ballroom D

InnoDB Plugin: Performance Features and Benchmarks, InnoDB Team, Thurs, 10:50 am, Ballroom C

BLOGS•http://blogs.innodb.com/innodb-performance-recovery, Inaam Rana•http://blogs.innodb.com/innodb-multiple-rollback-segments, Sunny Bains•http://blogs.innodb.com/innodb-performance-schema, Jimmy Yang•http://mikaelronstrom.blogspot.com/, Mikael Ronstrom•http://dimitrik.free.fr/blog/archives/2010/04/mysql-performance-554-dbstress.html, Dimitri Kravtchuk

TALKS

Page 27: InnoDB: Status, Architecture and New Features

27

AQ&Q U E S T I O N SQ U E S T I O N S

A N S W E R SA N S W E R S

Page 28: InnoDB: Status, Architecture and New Features

28

InnoDB: Status, Architecture and New FeaturesMySQL Conference and Expo, 2010

3:05 pm, April 13, [email protected] [email protected]

Thanks for attending!