0
InnoDB usage and diagonstics<br />sarah novotny – sarah@bluegecko.net<br />MySQL and LAMP services<br />www.BlueGecko.net<...
innodb architecture<br />indexing curiosities<br />scaling issues<br />ops concerns<br />3p tools<br />www.BlueGecko.net<b...
InnoDB Architecture<br />	MVCC<br />	row level locking<br />	transactions<br />foreign keys<br />tablespaces<br />	undo lo...
the special sauce!<br />clustered indexing<br />natural order<br />page directory <br />www.BlueGecko.net<br />
 two short operational diversions<br />innodb_flush_method = O_DIRECT<br />	is worth benchmarking on your system.		<br />	...
indexing curiosities<br />	secondary indexes point to the clustered index<br />	BLOB, VARCHAR, <br />TEXT can be stored <b...
scaling issues<br />when it’s time to<br />go big,where are<br />the bottlenecks?<br />www.BlueGecko.net<br />
innodb locking<br />	auto- increment<br />	gap locking<br />www.BlueGecko.net<br />
a view of locking in innotop<br />www.BlueGecko.net<br />
concurrency<br />google: domas concurrency <br />and click “I feel lucky!”<br />http://bit.ly/domas_inno_concurrency<br />...
InnoDB thread concurrency<br />www.BlueGecko.net<br />
	balance between i/o capabilities and mutex contention<br />innodb_thread_concurrency<br />	multi cores, faster disk work ...
operational concerns<br />www.BlueGecko.net<br />
operational concerns<br />mysql> show innodbstatus;<br />this gives you snapshot information<br />trending gives you frame...
indirect measures to see what is happening<br />www.BlueGecko.net<br />
operational concerns<br />the combination of historical data with current status from the host is invaluable in determinin...
operational concerns<br />www.BlueGecko.net<br />
free tools<br />Innotop<br />MySQL proxy/ <br />tcpdump<br />mysql-cacti-templates<br />gdb<br /> (poormansprofiler.org)<b...
additional resources<br />irc.freenode.org<br />#mysql<br />#maatkit<br />mysql.com<br />HPM2e -Baron Schwartz, Peter Zait...
credits<br />flickr<br />hk architecture – davelau<br />special sauce – fotoosvanrobin<br />yellow pages - f-r-a-n-k<br />...
Blue Gecko and contact info<br />sarah@bluegecko.net<br />sarah.novotny@gmail.com<br />@sarahnovotny<br />@bluegecko<br />...
Upcoming SlideShare
Loading in...5
×

innodb usage and diagnostics

1,168

Published on

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.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,168
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • table creation information in .frmMySQL’s core table locking is disabled (politely)transactions do not behave quite the same in innodb – autocommit on by default. transaction isolation == repeatable readdeadlock detection
  • b-tree primary key ++ record in index (not pointer)instead of moving ½ the records, data is added to the tablespaces and indexes in natural orderpage directory uses binary searching in sparse array fill factors are auto managed – and at my last check was still an open questionindex-organized table
  • since innodb buffers both key and data there are cases where O_DIRECT can help a lot. the idea being to avoid double cachingthere will be an arbitrary useless key that is assigned if you don’t set one!
  • secondary indexes point to clustered. no data. extra callSecondary index records must always fit on a single B-tree pageIn a clustered index, BLOB, VARCHAR and TEXT columns that are not part of the primary key may be stored on separately allocated (“overflow”) pages. We call these “off-page columns” whose values are stored on singly-linked lists of overflow pages. ERROR HY000: Too big row. InnoDB requires that each B-tree page can accommodate at least two records.
  • Much performance pain come into play with lock contentionglobal counter which held the last value for the auto-incrementing column. A lock would be placed on this counter for the duration of the SQL statement which did the inserting. until MySQL 5.1.22new server variable, innodb_autoinc_lock_mode -- limits how often global locking is used and still defaults to that if not able to preserve derterministicnessA type of gap lock called an insertion intention gap lock is set by INSERT operations prior to row insertion.next key locks combo of record lock and gap lock.
  • Much performance pain come into play with lock contentionNames changed to protect the innocent
  • can’t reprise or due justice to this talk.DomasMituzas – FB go watch it.oreilly’smysql conference 2010
  • not enough knobs, must benchmark.innodb_thread_concurrency
  • LVM and slaves give easy opportunities for creating clones for testinginnodbhotbackupxtra backup
  • You might see these graphs spike during times of high concurrency or contention. These graphs basically indicate different types of activity involved in obtaining row locks or mutexes, both of which are causes of poor scaling in standard InnoDBXtraDB, the InnoDBplugin, and the Percona-patched MySQL are improved.
  • different types of activity involved in obtaining row locks or mutexesadditionally, can see what’s going on in individual transactions.
  • watching how the i/o threads are behaving.
  • Transcript of "innodb usage and diagnostics"

    1. 1. InnoDB usage and diagonstics<br />sarah novotny – sarah@bluegecko.net<br />MySQL and LAMP services<br />www.BlueGecko.net<br />
    2. 2. innodb architecture<br />indexing curiosities<br />scaling issues<br />ops concerns<br />3p tools<br />www.BlueGecko.net<br />
    3. 3. InnoDB Architecture<br /> MVCC<br /> row level locking<br /> transactions<br />foreign keys<br />tablespaces<br /> undo logs<br /> redo logs<br />www.BlueGecko.net<br />
    4. 4. the special sauce!<br />clustered indexing<br />natural order<br />page directory <br />www.BlueGecko.net<br />
    5. 5. two short operational diversions<br />innodb_flush_method = O_DIRECT<br /> is worth benchmarking on your system. <br /> choose smart primary keys<br />www.BlueGecko.net<br />
    6. 6. indexing curiosities<br /> secondary indexes point to the clustered index<br /> BLOB, VARCHAR, <br />TEXT can be stored <br />in overflow pages<br /> ERROR HY000:<br /> Too big row. <br />www.BlueGecko.net<br />
    7. 7. scaling issues<br />when it’s time to<br />go big,where are<br />the bottlenecks?<br />www.BlueGecko.net<br />
    8. 8. innodb locking<br /> auto- increment<br /> gap locking<br />www.BlueGecko.net<br />
    9. 9. a view of locking in innotop<br />www.BlueGecko.net<br />
    10. 10. concurrency<br />google: domas concurrency <br />and click “I feel lucky!”<br />http://bit.ly/domas_inno_concurrency<br />www.BlueGecko.net<br />
    11. 11. InnoDB thread concurrency<br />www.BlueGecko.net<br />
    12. 12. balance between i/o capabilities and mutex contention<br />innodb_thread_concurrency<br /> multi cores, faster disk work to be done<br />www.BlueGecko.net<br />
    13. 13. operational concerns<br />www.BlueGecko.net<br />
    14. 14. operational concerns<br />mysql> show innodbstatus;<br />this gives you snapshot information<br />trending gives you framework to see when things are going wrong<br />http://code.google.com/p/mysql-cacti-templates<br />www.BlueGecko.net<br />
    15. 15. indirect measures to see what is happening<br />www.BlueGecko.net<br />
    16. 16. operational concerns<br />the combination of historical data with current status from the host is invaluable in determining cause <br />www.BlueGecko.net<br />
    17. 17. operational concerns<br />www.BlueGecko.net<br />
    18. 18. free tools<br />Innotop<br />MySQL proxy/ <br />tcpdump<br />mysql-cacti-templates<br />gdb<br /> (poormansprofiler.org)<br />www.BlueGecko.net<br />
    19. 19. additional resources<br />irc.freenode.org<br />#mysql<br />#maatkit<br />mysql.com<br />HPM2e -Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, and Jeremy Zawodny<br />www.BlueGecko.net<br />
    20. 20. credits<br />flickr<br />hk architecture – davelau<br />special sauce – fotoosvanrobin<br />yellow pages - f-r-a-n-k<br />Bell Labs - sodapop81<br />lock - darwinbell<br />License plate - severud<br />voodoo - heungsub<br />clones - adactio<br />tools – meanestindian<br />console - hermzz<br />www.BlueGecko.net<br />
    21. 21. Blue Gecko and contact info<br />sarah@bluegecko.net<br />sarah.novotny@gmail.com<br />@sarahnovotny<br />@bluegecko<br />senk on #mysql<br />Blue Gecko provides Remote DBA services for companies around the world <br />7x24x365 support including monitoring, performance analysis, proactive maintenance and architectural guidance for small and large datasets.<br />www.BlueGecko.net<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×