Top Banner
MySQL/NoSQL/Cloud Monitoring with New Relic EffectiveMySQL.com - Performance, Scalability & Business Continuity Ronald Bradford http://ronaldbradford.com Buenos Aires, Argentina 2013-10
100

Monitoring your technology stack with New Relic

May 12, 2015

Download

Technology

Ronald Bradford

There is no excuse to not have monitoring of your LAMP stack, NoSQL database like MongoDB/Redis/Cassandra/Memcache, Cloud services and much more when you can use the popular New Relic tool for free. As the MySQL plugin author I can offer the following link will give you access to free monitoring http://j.mp/newrelic-mysql There can never be an excuse to not know how your application is performing, from 1 server to 100+ servers.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Monitoring your technology stack with New Relic

MySQL/NoSQL/Cloud Monitoring with New

Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Ronald Bradfordhttp://ronaldbradford.com

Buenos Aires, Argentina2013-10

Page 2: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

ABOUT AUTHOR

24 years of RDBMS experience,14 years with MySQL

MySQL Inc (2006-2008)

Oracle Corporation (1996-1999)

Published Author (4 books)

Oracle ACE Director

MySQL community member of the year (2009 & 2013)

All time top MySQL blogger

Ronald Bradford

Provide independent MySQL/LAMP/Cloud consulting

Page 3: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Why Monitor?

Page 4: Monitoring your technology stack with New Relic

TextText

Page 5: Monitoring your technology stack with New Relic
Page 6: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Monitoring Options

Cacti

OpenTSDB

DataDogBoundary

New Relic

Munin

MySQL Enterprise Monitor

Nagios

Zabbix

Hyperic

Ganglia

http://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems

CollectD

StatsD

Zenoss

Page 7: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

New Relic

Page 8: Monitoring your technology stack with New Relic
Page 9: Monitoring your technology stack with New Relic
Page 10: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

New Relic

Application Monitoring

Server Monitoring

Software as a Service (SaaS)

Agent-like

Historically

Page 11: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

The cloud - SaaS

Minimal installation

Minimal administration

Cloud based management

Web

Mobile

Integrations to other products

Page 12: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

New Relic

Application Monitoring

Server Monitoring

NOW - New Relic Platform

<insert product here>

Introducing

Page 13: Monitoring your technology stack with New Relic
Page 14: Monitoring your technology stack with New Relic
Page 15: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

NEw Relic

Subscription per server

Standard ($24 p.s. p.m.)

Pro ($149 p.s. p.m.)

YOU CAN GET UNLIMITED STANDARD FREE BECAUSE BY THE

MySQL PLUGIN AUTHOR

http://j.mp/newrelic-mysql

Page 16: Monitoring your technology stack with New Relic

No Credit Card Details required

http://j.mp/newrelic-mysql

1

3

4

2

Page 17: Monitoring your technology stack with New Relic
Page 18: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

NAVIGATION

Page 19: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

LICENSE

Page 20: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

ALERTs

Page 21: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Server

Ubuntu/Debian/RedHat/CentOS/Linux/Windows

Page 22: Monitoring your technology stack with New Relic
Page 23: Monitoring your technology stack with New Relic
Page 24: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

SERVER INSTALL

LICENSE_KEY="<enter key here>"sudo rpm -Uvh http://download.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpmsudo yum install -y newrelic-sysmondsudo nrsysmond-config --set license_key=${LICENSE_KEY}sudo /etc/init.d/newrelic-sysmond start

Helps to use good hostnames

Page 25: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Application

PHP/Ruby/.NET/Java/Python/Node.js

Page 26: Monitoring your technology stack with New Relic

PHP, Ruby, .NET, Java, Python, Node.js

Page 27: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

PHP INSTALL

LICENSE_KEY="<enter key here>"sudo rpm -Uvh http://download.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpmsudo yum install -y newrelic-php5sudo newrelic-install install# prompted for LICENSE_KEYsudo service httpd restart

Page 28: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Platform

MySQL/Memcached/Apache/Redis/MongoDB/AWS/...

Page 29: Monitoring your technology stack with New Relic
Page 30: Monitoring your technology stack with New Relic

JRE (on some server)

https://github.com/newrelic-platform/newrelic_mysql_java_plugin/

Page 31: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

MYSQL INSTALL

sudo su -LICENSE_KEY="<enter key here>"wget -O /tmp/newrelic.tar.gz https://raw.github.com/newrelic-platform/newrelic_mysql_java_plugin/master/dist/newrelic_mysql_plugin-1.0.6.tar.gzcd /usr/localtar xvfz /tmp/newrelic.tar.gzmv newrelic_mysql_plugin-1.* newrelic_mysql_plugincd /usr/local/newrelic_mysql_pluginecho "licenseKey=${LICENSE_KEY}" > config/newrelic.propertiesecho "java.util.logging.ConsoleHandler.level = INFOcom.newrelic.metrics.publish.handlers = java.util.logging.ConsoleHandler" > config/logging.propertiesecho '[ { "name" : "'`hostname -s`'", "host" : "localhost", "metrics" : "status,newrelic,innodb,innodb_status,innodb_mutex,slave" }]' > config/mysql.instance.json#mysql < mysql_user.sqlnohup java -jar newrelic_mysql_plugin-*.jar &

Version 1 - Needs streamlining

https://github.com/newrelic-platform/newrelic_mysql_java_plugin/

Page 32: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

General Views

Page 33: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

navigation

Page 34: Monitoring your technology stack with New Relic

Summary View

Page 35: Monitoring your technology stack with New Relic
Page 36: Monitoring your technology stack with New Relic
Page 37: Monitoring your technology stack with New Relic

More

Page 38: Monitoring your technology stack with New Relic

More

Page 39: Monitoring your technology stack with New Relic
Page 40: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

MYSQL Sources

SHOW GLOBAL STATUS

SHOW MASTER STATUS

SHOW SLAVE STATUS

SHOW ENGINE INNODB STATUS

SHOW ENGINE INNODB MUTEX

<Any SQL statement>

Page 41: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Coding Features

SHOW ENGINE INNODB MUTEX

Dynamic metric namesRollup, supporting different formats

in 5.5, 5.6, Percona etc

Page 42: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Coding Features

SHOW ENGINE INNODB STATUS

Page 43: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Version 1

Your input and feedback

See limitations

Page 44: Monitoring your technology stack with New Relic
Page 45: Monitoring your technology stack with New Relic

Default is “PHP Application”

/etc/php.d/newrelic.incnewrelic.appname = "PHP Application"

Page 46: Monitoring your technology stack with New Relic
Page 47: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Other Products

Page 48: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

MEMCACHE INSTALL

LICENSE_KEY="<enter key here>"sudo pip install newrelic-plugin-agentsudo cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.cfg \ /etc/newrelic/newrelic_plugin_agent.cfg

sudo useradd -m -s /bin/bash newrelicsudo mkdir -p /var/log/newrelic /var/run/newrelicsudo chown newrelic:newrelic /var/*/newrelicsudo vi /etc/newrelic/newrelic_plugin_agent.cfgsudo newrelic_plugin_agent -c \ /etc/newrelic/newrelic_plugin_agent.cfg -f

https://rpm.newrelic.com/accounts/389698/plugins/directory/53

Page 49: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Page 50: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Page 51: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Page 52: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

meetme plugin

PHP Cache HTTP Server CouchDB Edgecast CDN APIMemcached MongoDB Nginx pgBouncer PHP FPM

PostgreSQL RabbitMQRedis Riak uWSGI

Page 53: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Other Plugins

Logwatcher

Varnish

Sendgrid

Cassandra

Haproxy

Hadoop

F5

AWS EC2/RDS/ELB

Rabbit MQ

Sphinx

<write your own>

Page 54: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

User Interface

Page 55: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

History

Page 56: Monitoring your technology stack with New Relic

Click and drag for subset of time

Page 57: Monitoring your technology stack with New Relic
Page 58: Monitoring your technology stack with New Relic
Page 59: Monitoring your technology stack with New Relic
Page 60: Monitoring your technology stack with New Relic
Page 61: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Configuration

Page 62: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

MySQL Plugin

Plugin has more features than UI can support at present

Configurable namespaces

Row/Set SQL statements

Configurable metrics

Page 63: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

MySQL config

$ cat /path/to/config/mysql.instance.json [ { "name" : "db1", "host" : "localhost", "metrics" : "status,newrelic,innodb_status, innodb_mutex,master" }, { "name" : "db2", "host" : "db2.hostname.com", "user" : "monitor", "password" : "password", "metrics" : "status,newrelic,slave" }]

One agent can collect data from many MySQL Instances

Page 64: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

namespaces

$ cat /path/to/config/metric.category.json [ { "category" : "status", "SQL" : "SHOW GLOBAL STATUS", "result" : "set", "value_metrics":"Max_used_connections,....", "counter_metrics" :"Bytes_received,Bytes_sent,..." }, { "category" : "slave", "SQL" : "SHOW SLAVE STATUS", "result" : "row", "value_metrics" : "Read_Master_Log_Pos, Slave_IO_Running, Slave_SQL_Running,

Page 65: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

namespaces

$ cat /path/to/config/metric.category.json [ { "category" : "innodb_metrics", "SQL" : "SELECT name, count FROM information_schema.innodb_metrics", "result" : "set", "comment" : "MySQL 5.6 or later", "value_metrics" : "...", "counter_metrics" : "..." }, ...

Current UI does not support with default MySQL plugin, but

Page 66: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Modifying plugin

https://github.com/newrelic-platform/newrelic_mysql_java_plugin

com.newrelic.plugins.mysql.instance.GUID="new value"

Request to overload via parameter (to help with current UI limitations)

Page 67: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Limitations(Also exist with most monitoring

products)

Page 68: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

sampling

60 seconds (fixed)

Page 69: Monitoring your technology stack with New Relic

CopperEgg Example(15 second samples)

Page 70: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

averaging

Deceiving

No maximum support

Page 71: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

alerting limits

Positive range only

Summary metrics only

No low limits

Page 72: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Custom Dashboards

Enables you to group graphs together

Does not work with plugins YET!

Page 73: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Presentation

Likes lots of moving/changing data

Uninteresting values not well supported

replication lag

replication running YES/NO

Important summary alert[able] metric

Page 74: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Servers

Likes to work on per server basis

Default reporting namespace

com.newrelic.plugins.mysql.instance

[agent] /mysql/status/com_select

[agent] /mysql/status/com*

com.newrelic.plugins.mysql.topology

/mysql/status/com_select/<instance>

Current

One Goal

Page 75: Monitoring your technology stack with New Relic

What is monitoring the monitoring?

Page 76: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Usage Patterns

Page 77: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

tmp disk tables

High disk I/O - Investigate SQL

Page 78: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

query cache

Query Cache NOT working

Page 79: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Query CAcheEnabling Query Cache benefit

Page 80: Monitoring your technology stack with New Relic
Page 81: Monitoring your technology stack with New Relic
Page 82: Monitoring your technology stack with New Relic

Yes, this time the database (servers)

are on fire!

Page 83: Monitoring your technology stack with New Relic

If only I could trigger an alert on this?

Page 84: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

A Developers View

Page 85: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

SQL for developers

Drill down to running queries

Look at ALL thread SQL statements

Aggregations

Page 86: Monitoring your technology stack with New Relic

Standard Feature

Page 87: Monitoring your technology stack with New Relic
Page 88: Monitoring your technology stack with New Relic

Standard Feature

Page 89: Monitoring your technology stack with New Relic

Pro Feature

Page 90: Monitoring your technology stack with New Relic

Standard Feature

Page 91: Monitoring your technology stack with New Relic

Pro Feature

Page 92: Monitoring your technology stack with New Relic

Pro Feature

Page 93: Monitoring your technology stack with New Relic

Pro Feature

Page 94: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

A better waterfall

Page 95: Monitoring your technology stack with New Relic

Still not a DB problem, but, I need to identify and fix

Standard Feature

Page 96: Monitoring your technology stack with New Relic
Page 97: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Conclusion

Page 98: Monitoring your technology stack with New Relic

EffectiveMySQL.com - Performance, Scalability & Business Continuity

Conclusion

There is no excuse to have NO monitoring

Visualization can generally help show issues

Historical reporting can help review issues

NEITHER WILL SOLVE THE PROBLEM

Hire Ronald Bradford

Page 99: Monitoring your technology stack with New Relic