21
InnoDB usage and diagonstics sarah novotny – [email protected] MySQL and LAMP services www.BlueGecko.net

innodb usage and diagnostics

Embed Size (px)

DESCRIPTION

InnoDB is the most similar storage engine for an Oracle developer. Understanding specifics such as the clustered primary key, secondary indexes sizes, page fill factor options and TEXT/BLOB management are important design needs developers need to know. Being able to monitor and analyze the available instrumentation and learn specifics for example auto-inc or gap locking contention, thread concurrency management options and data/log I/O options are also key in mastering InnoDB diagnostics.

Citation preview

Page 1: innodb usage and diagnostics

InnoDB usage and diagonstics

sarah novotny – [email protected] and LAMP services

www.BlueGecko.net

Page 2: innodb usage and diagnostics

①innodb architecture②indexing curiosities③scaling issues④ops concerns⑤3p tools

www.BlueGecko.net

Page 3: innodb usage and diagnostics

www.BlueGecko.net

① InnoDB Architecture

MVCCrow level lockingtransactionsforeign keystablespacesundo logsredo logs

Page 4: innodb usage and diagnostics

www.BlueGecko.net

the special sauce!

clustered indexingnatural orderpage directory

Page 5: innodb usage and diagnostics

two short operational diversions

innodb_flush_method = O_DIRECTis worth benchmarking on your system.

choose smart primary keys

www.BlueGecko.net

Page 6: innodb usage and diagnostics

www.BlueGecko.net

② indexing curiosities

secondary indexes point to the clustered index

BLOB, VARCHAR, TEXT can be stored in overflow pages

ERROR HY000: Too big row.

Page 7: innodb usage and diagnostics

③scaling issues

when it’s time togo big, where arethe bottlenecks?

www.BlueGecko.net

Page 8: innodb usage and diagnostics

innodb locking

auto- incrementgap locking

www.BlueGecko.net

Page 9: innodb usage and diagnostics

a view of locking in innotop

www.BlueGecko.net

Page 10: innodb usage and diagnostics

concurrency

google: domas concurrency and click “I feel lucky!”

http://bit.ly/domas_inno_concurrency

www.BlueGecko.net

Page 11: innodb usage and diagnostics

InnoDB thread concurrency

www.BlueGecko.net

Page 12: innodb usage and diagnostics

balance between i/o capabilities and mutex contention

innodb_thread_concurrency

multi cores, faster disk work to be done

www.BlueGecko.net

Page 13: innodb usage and diagnostics

④operational concerns

www.BlueGecko.net

Page 14: innodb usage and diagnostics

④ operational concerns

mysql> show innodb status;

this gives you snapshot information

trending gives you framework to see when things are going wrong

http://code.google.com/p/mysql-cacti-templates

www.BlueGecko.net

Page 15: innodb usage and diagnostics

indirect measures to see what is happening

www.BlueGecko.net

Page 16: innodb usage and diagnostics

④ operational concerns

the combination of historical data with current status from the host is invaluable in determining cause

www.BlueGecko.net

Page 17: innodb usage and diagnostics

④ operational concerns

www.BlueGecko.net

Page 18: innodb usage and diagnostics

⑥free tools

InnotopMySQL proxy/ tcpdumpmysql-cacti-templatesgdb (poormansprofiler.org)

www.BlueGecko.net

Page 19: innodb usage and diagnostics

additional resources

• irc.freenode.org– #mysql– #maatkit

• mysql.com• HPM2e -Baron Schwartz,

Peter Zaitsev, Vadim Tkachenko, and Jeremy Zawodny

www.BlueGecko.net

Page 20: innodb usage and diagnostics

credits

flickr

• hk architecture – davelau• special sauce – fotoosvanrobin• yellow pages - f-r-a-n-k• Bell Labs - sodapop81• lock - darwinbell

• License plate - severud• voodoo - heungsub• clones - adactio• tools – meanestindian• console - hermzz

www.BlueGecko.net

Page 21: innodb usage and diagnostics

Blue Gecko and contact info

[email protected][email protected]• @sarahnovotny• @bluegecko• senk on #mysql

www.BlueGecko.net

Blue Gecko provides Remote DBA services for companies around the world

7x24x365 support including monitoring, performance analysis, proactive maintenance and architectural guidance for small and large datasets.