Your SlideShare is downloading. ×
0
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
innodb usage and diagnostics
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

innodb usage and diagnostics

1,143

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 …

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,143
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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

    • 1. InnoDB usage and diagonstics
      sarah novotny – sarah@bluegecko.net
      MySQL and LAMP services
      www.BlueGecko.net
    • 2. innodb architecture
      indexing curiosities
      scaling issues
      ops concerns
      3p tools
      www.BlueGecko.net
    • 3. InnoDB Architecture
      MVCC
      row level locking
      transactions
      foreign keys
      tablespaces
      undo logs
      redo logs
      www.BlueGecko.net
    • 4. the special sauce!
      clustered indexing
      natural order
      page directory
      www.BlueGecko.net
    • 5. two short operational diversions
      innodb_flush_method = O_DIRECT
      is worth benchmarking on your system.
      choose smart primary keys
      www.BlueGecko.net
    • 6. indexing curiosities
      secondary indexes point to the clustered index
      BLOB, VARCHAR,
      TEXT can be stored
      in overflow pages
      ERROR HY000:
      Too big row.
      www.BlueGecko.net
    • 7. scaling issues
      when it’s time to
      go big,where are
      the bottlenecks?
      www.BlueGecko.net
    • 8. innodb locking
      auto- increment
      gap locking
      www.BlueGecko.net
    • 9. a view of locking in innotop
      www.BlueGecko.net
    • 10. concurrency
      google: domas concurrency
      and click “I feel lucky!”
      http://bit.ly/domas_inno_concurrency
      www.BlueGecko.net
    • 11. InnoDB thread concurrency
      www.BlueGecko.net
    • 12. balance between i/o capabilities and mutex contention
      innodb_thread_concurrency
      multi cores, faster disk work to be done
      www.BlueGecko.net
    • 13. operational concerns
      www.BlueGecko.net
    • 14. operational concerns
      mysql> show innodbstatus;
      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
    • 15. indirect measures to see what is happening
      www.BlueGecko.net
    • 16. operational concerns
      the combination of historical data with current status from the host is invaluable in determining cause
      www.BlueGecko.net
    • 17. operational concerns
      www.BlueGecko.net
    • 18. free tools
      Innotop
      MySQL proxy/
      tcpdump
      mysql-cacti-templates
      gdb
      (poormansprofiler.org)
      www.BlueGecko.net
    • 19. additional resources
      irc.freenode.org
      #mysql
      #maatkit
      mysql.com
      HPM2e -Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, and Jeremy Zawodny
      www.BlueGecko.net
    • 20. 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
    • 21. Blue Gecko and contact info
      sarah@bluegecko.net
      sarah.novotny@gmail.com
      @sarahnovotny
      @bluegecko
      senk on #mysql
      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.
      www.BlueGecko.net

    ×