innodb usage and diagnostics
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.TRANSCRIPT
![Page 2: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/2.jpg)
①innodb architecture②indexing curiosities③scaling issues④ops concerns⑤3p tools
www.BlueGecko.net
![Page 3: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/3.jpg)
www.BlueGecko.net
① InnoDB Architecture
MVCCrow level lockingtransactionsforeign keystablespacesundo logsredo logs
![Page 4: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/4.jpg)
www.BlueGecko.net
the special sauce!
clustered indexingnatural orderpage directory
![Page 5: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/5.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/6.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/7.jpg)
③scaling issues
when it’s time togo big, where arethe bottlenecks?
www.BlueGecko.net
![Page 8: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/8.jpg)
innodb locking
auto- incrementgap locking
www.BlueGecko.net
![Page 9: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/9.jpg)
a view of locking in innotop
www.BlueGecko.net
![Page 10: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/10.jpg)
concurrency
google: domas concurrency and click “I feel lucky!”
http://bit.ly/domas_inno_concurrency
www.BlueGecko.net
![Page 11: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/11.jpg)
InnoDB thread concurrency
www.BlueGecko.net
![Page 12: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/12.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/13.jpg)
④operational concerns
www.BlueGecko.net
![Page 14: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/14.jpg)
④ 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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/15.jpg)
indirect measures to see what is happening
www.BlueGecko.net
![Page 16: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/16.jpg)
④ 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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/17.jpg)
④ operational concerns
www.BlueGecko.net
![Page 18: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/18.jpg)
⑥free tools
InnotopMySQL proxy/ tcpdumpmysql-cacti-templatesgdb (poormansprofiler.org)
www.BlueGecko.net
![Page 19: innodb usage and diagnostics](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/19.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/20.jpg)
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](https://reader036.vdocument.in/reader036/viewer/2022081513/554c9985b4c905f0178b4b35/html5/thumbnails/21.jpg)
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.