Getting to Know MySQL Enterprise Monitor


Published on

MySQL Enterprise Monitor is the monitoring and management solution for DBAs and developers delivered as part of MySQL Enterprise Edition. It provides background monitoring, alerting, trending, and analysis of the MySQL database and the statement traffic that is running within it.

View this session to learn how to install/configure, customize, and use MySQL Enterprise Monitor to suit your environment. Whether you use a single server or have hundreds of instances, MySQL Enterprise Monitor can provide great insights into how your environment is performing.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Getting to Know MySQL Enterprise Monitor

  1. 2. Getting To Know MySQL Enterprise Monitor Mark Leith (@MarkLeith)
  2. 3. Agenda <ul><li>The MySQL Enterprise Monitor Vision
  3. 4. Architecture </li></ul><ul><li>A Tour Around The UI </li></ul><ul><li>Key Configuration
  4. 5. Questions </li></ul>
  5. 6. The MySQL Enterprise Monitor Team Vision <ul><li>Continually monitor all aspects of MySQL environments </li></ul><ul><li>Analyze for problems, alerting when necessary </li></ul><ul><li>Streamline common “database problem” resolution </li></ul><ul><li>Simplify database management at scale </li></ul>
  6. 7. The MySQL Enterprise Monitor Vision <ul><li>“ MySQL is simple to use ” ... but … there are many complex interactions happening within the database </li></ul><ul><li>Much of what is happening within MySQL has historically been termed as “ a black-box ” … but … that is changing rapidly </li></ul><ul><li>No one person can continually monitor what a single database is doing, let alone 10's, or 100's, of instances </li></ul>
  7. 8. The Obligatory Black Boxes
  8. 9. The MySQL Enterprise Monitor Way
  9. 10. Agenda <ul><li>Architecture </li></ul><ul><li>A Tour Around The UI </li></ul><ul><li>Key Configuration
  10. 11. Questions </li></ul>
  11. 12. MEM Installation <ul><li>A minimal installation consists of: </li><ul><li>MEM Server (Tomcat app server, MySQL DB) </li><ul><li>Ideally on dedicated resources
  12. 13. App server and DB can have separate hardware </li></ul><li>MEM Agent (C based, multiple plugins) </li><ul><li>Ideally installed on each database server
  13. 14. Can also monitor remotely (less OS stats) </li></ul></ul></ul>
  14. 15. MEM Architecture Tomcat App Server MySQL Repository Admins MEM Server MEM Agent Monitored DB Instance
  15. 16. MEM Installation – Statement Collection <ul><li>MySQL Proxy integrated in to the Agent process </li><ul><li>Funnel “legacy” app traffic for analysis
  16. 17. Data sent via the agent plugin </li></ul><li>Connector Plugins for app side statement monitoring </li><ul><li>Allows client side monitoring of statement latency
  17. 18. Allow tracing statement origination
  18. 19. Also spreads the load of statement analysis
  19. 20. Data sent directly to the MEM server via REST </li></ul></ul>
  20. 21. MEM Architecture Java Web App MySQL Repository Admins Java App Server (or .Net) MEM Traffic App Traffic “ Legacy” App Users MEM Server Connector Plugins MEM Agent/Proxy
  21. 22. NEW – PHP and the Aggregator Admins MEM Server MEM Agent Monitored Instance PHP App MEM Traffic App Traffic MEM Aggregator
  22. 23. Agenda <ul><li>A Tour Around The UI </li></ul><ul><li>Key Configuration
  23. 24. Questions </li></ul>
  24. 25. The Monitor Tab – Server Overview Key Graphs Current Critical Events Selected Server Overview Key Indicators
  25. 26. The Monitor Tab – Support Issues / Heat Chart <ul><li>Waiting support issues </li><ul><li>MOS account in settings </li></ul><li>Status of agent and MySQL </li></ul><ul><li>Open event counts & drill down </li></ul><ul><li>Visual status of key statistics </li></ul><ul><li>See Heatchart Advisor to tune </li></ul>
  26. 27. MEM Advisors <ul><li>A collection (>160) of simple expression based “ Rules ” </li></ul><ul><ul><li>100-((%Threads_created% / %Connections%)*100) < THRESHOLD </li></ul></ul><ul><li>All check standard best practices for MySQL
  27. 28. Scheduled to run on a set frequency basis
  28. 29. “ Counters” evaluate deltas, otherwise, evaluate totals
  29. 30. Rules trigger “Events” on three levels of “ Threshold ” </li><ul><li>Info -> Warning -> Critical </li></ul></ul>
  30. 31. The Advisors Tab – Current Schedule <ul><li>Edit current settings
  31. 32. Per Group / Server
  32. 33. Quick enable/disable </li></ul>
  33. 34. Advisors Tab - Manage Rules Overview <ul><li>>1000 MySQL metrics </li><ul><li>SHOW STATUS
  38. 39. PERFORMANCE_SCHEMA </li></ul><li>~100 OS metrics
  39. 40. Custom SQL possible </li></ul>Create Custom Edit defaults Even app specific
  40. 41. Advisors Tab - Edit Rule <ul><li>The Rule is the Expression
  41. 42. Certified rules allow threshold and frequency changes
  42. 43. Default values are generally conservative
  43. 44. Gather some graph data before refining </li></ul>
  44. 45. Events Tab Current / Worst Event states Where What When Drill In
  45. 46. Event Results Advice on the problem, and how to go about drilling in to it Recommended action to resolve the problem after investigation
  46. 47. Event Results The actual evaluation Advisor Config
  47. 48. Closing Events Whether to Continue Monitoring this rule Track a history of changes made for events Choose Auto-Close wisely: Flapping events notify, a lot
  48. 49. The Graphs Tab <ul><li>Stacked for easy correlation
  49. 50. Covering key subsystems
  50. 51. InnoDB, Cluster, SQL layer activity, Query Cache, Thread Pool, Connection usage, Statement, Transaction and Row throughput, OS stats etc. </li></ul><ul>~75 Graphs </ul>~182 series ~220 data points
  51. 52. Graphs and Filtering <ul><li>When groups are selected graphs summarize (avg/min/max)
  52. 53. Drill in to servers to see raw stats
  53. 54. Filter by name with “Contains” matching or regex – i.e “^row”
  54. 55. ..or just select specific graphs
  55. 56. Time range filtering for history </li><ul><li>Keep defaults minimal
  56. 57. Data points every minute </li></ul></ul>
  57. 58. Graphs – Query Correlation Select any portion of any graph to take you to a filtered Query Analyzer view for that time period
  58. 59. The Query Analyzer Tab Correlated Graph Advanced Filtering Normalized Statements (drill down) Key Aggregated Statistics Table Scan
  59. 60. Statement Normalization <ul><li>Normalization does the following: </li><ul><li>Strip all literals, replacing each with “?”
  60. 61. Strip pure comments, leading/trailing spaces
  61. 62. Make keywords UPPER CASE
  62. 63. Roll multi-row INSERT up to “(?,?) /*, … */”
  63. 64. Roll IN() lists to “IN (? /*, … */)” </li></ul></ul>
  64. 65. Query Analysis – Example Queries Non-normalized Example statement Who it was executed by Where in the application it originated from (with connector plugins) When, and how long it took
  65. 66. Query Analysis – Explain / History How the query executed over time (rows, bytes, time, execs) Execution plan if captured
  66. 67. The Replication Tab
  67. 68. “ Your replication page shows our replication topology incorrectly, that server isn't a slave any more... ” Actually... Your topology probably is configured like that : CHANGE MASTER TO MASTER _HOST = '' RESET SLAVE ALL (now in 5.5.16)
  68. 69. The Replication Slave Details
  69. 70. Agenda <ul><li>Key Configuration </li></ul><ul><li>Questions </li></ul>
  70. 71. Key Configuration Of course, the first thing to get right is Advisors.. <ul><li>Let the monitor run for a while with no rules enabled
  71. 72. Be selective on which rules you enable
  72. 73. When enabling rules, use graph info for thresholds
  73. 74. Set notifications wisely (do you need an email alert at 5 am that a user exists without a password?) </li></ul>
  74. 75. General Settings Notification mechanisms Data retention MOS credentials
  75. 76. Notification Groups Short Messages MEM Server Events Custom Event subjects
  76. 77. Query Analysis Configuration Collect Normalized Data Also get non-normalized example Threshold for how Long a statement Should run, before Generating an EXPLAIN
  77. 78. Key Configuration Files $mem_server_dir/apache-tomcat/bin/ <ul><li>Configure Java options (heap space) </li></ul>$mem_server_dir/mysql/my.cnf <ul><li>Database options – For larger installs, tune InnoDB </li></ul>$mem_agent_dir/share/items/items-mysql-monitor.xml <ul><li>Tweak SQL based data collection items </li></ul>
  78. 79. Tweaking / Adding SQL Collections <class> <namespace>mysql</namespace> <classname>foo_bar</classname> <query><![CDATA[SELECT foo, bar, FROM … ]]></query> <attributes> <attribute name=&quot;foo&quot; counter=&quot;false&quot; type=&quot;STRING&quot; /> <attribute name=&quot;bar&quot; counter=&quot;true&quot; type=&quot;INTEGER&quot; /> </attributes> </class>
  79. 80. Some resources.. <ul><li>Download - </li></ul><ul><li> </li></ul><ul><li> </li></ul>
  80. 81. Q&A