Comments on: MySQL monitoring: storing, not caching https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching Blog by Shlomi Noach Thu, 08 Mar 2012 20:55:03 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-74971 Thu, 08 Mar 2012 20:55:03 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-74971 @Rick,
5 columns, *ONE* ALTER TABLE 🙂
And, yes, I’m willing, since these tables are not that large. With a year’s worth of data you get ~500MB worth of data. Not that much to refactor.

I urge you to, just for the fun of it, give mycheckpoint a try. I think you’ll be surprised at the depth and detail one can fit within such a small footprint, in one python script.

I’m not belittling other monitoring tools, of course. I can’t compare mycheckpoint to cacti, they’re on a completely different scale. I’m just saying. Try it.

]]>
By: Rick James https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-74933 Thu, 08 Mar 2012 19:10:51 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-74933 300 columns today, 305 tomorrow when you upgrade MySQL. Are you ready to generate the 5 ALTER TABLE ADD COLUMN clauses?

A couple of years ago, I looked at that and said yuck to that. I looked at key-value stores, but that performs terribly at scale. Instead, I stuffed the values into a JSON structure in a single column. Then the scripts can either do a json_decode, or a fairly simple regexp to reach into the JSON.

So, I currently have a provide the expression, the host(s) desired, timeframe, etc, and PHP does all the grunt work. It performs quite adequately.

I don’t need a WHERE clause on the status/variables.

Since I deal with hundreds of servers, from 4.0 to 5.1, and Percona, this mechanism does not care about new names. (Name changes like “table_cache” vs “table_open_cache” are a nuisance.)

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71164 Wed, 22 Feb 2012 18:23:02 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71164 Sheeri,
Will be happy if you do, and happier for any feedback.

]]>
By: Sheeri Cabral https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71162 Wed, 22 Feb 2012 17:25:32 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71162 Shlomi – ah, that’s good! One day I’ll get around to implementing your tools in my environment (now that I HAVE one that I’m in charge of at Mozilla! Consulting is great but it means you never really own anything and research isn’t always easy to do)….for now it’s back to basics for me, I’m still figuring out which machines I’m responsible for, and it’s not a small amount!

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71152 Wed, 22 Feb 2012 16:16:18 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71152 @Sheeri,
not every single variable is monitored. Some are known to be skipped, such as ssl_* and other textual columns.
On a Percona Server 5.1 installation I have 480 monitored data columns, including some custom counters added by the user.

]]>
By: Jonathan Levin https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71151 Wed, 22 Feb 2012 15:08:32 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71151 I use mycheckpoint and its brilliant.
I set it up to send me emails with reports about the servers I monitor instead of me logging into trending tools (I’m lazy that way).

I have already been using it with the user_statistics patch to see trends in some of my top tables.
I guess I could also monitor mycheckpoint data itself to get more info from it, should I choose to.

]]>
By: Sheeri Cabral https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71150 Wed, 22 Feb 2012 15:02:40 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71150 It sounds like mycheckpoint has a very wide table – one column for each status variable? There are over 300 of those….and another 300+ system variables.

I think it makes sense that 3 tools that do different things approach the problem in 3 different ways:

– The Percona Nagios plugin set is not concerned with caching, because it does not reuse any of the information it retrieves, it only uses the information once.

– The PalominoDB Nagios plugin caches because the same plugin can be used over and over to check different calculations of variables, and is designed so that the check could be run efficiently within a check interval. Ironically it was designed this way because of the benefits realized from the MySQL Cacti Templates.

– mycheckpoint stores because the data is used for graphing, but can also be used for alerting. In a way this is like cacti itself – it stores the data for graphing, and can also be used for alerting.

I made my post because I was worried folks would think “caching for monitoring is bad” – Baron specifically said that the Percona plugins are run infrequently, but I know there are many folks out there that would quickly turn his post into a “caching for monitoring is bad” myth.

]]>
By: Peter Laursen https://shlomi-noach.github.io/blog/mysql/mysql-monitoring-storing-not-caching/comment-page-1#comment-71120 Wed, 22 Feb 2012 09:13:27 +0000 https://shlomi-noach.github.io/blog/?p=4736#comment-71120 And in this respect MONyog and mycheckpoint seem to use same concept as regards storing versus caching. However the schemas are different and the ‘division of labor’ between SQL and javascript is also not exactly the same. Refer: http://www.webyog.com/blog/2009/07/29/monyog-database-schema-explained/ .. (slightly abbreviated)

1) Everytime MONyog sends a statement like SHOW VARIABLES/STATUS of some kind (or fetching a OS metric from Linux /proc folder) one row is INSERTED into [timestamp_master] table with information about current time and the metrics retrieved for each such statement will be INSERTED into [snapshot_master]. The [snapshot_master] table contains the metrics details.

2) And actually we do not always INSERT into [snapshot_master]. Only if the particular metric was changed since last time something was INSERTED for that metric we will INSERT again.

3) Finally note that [snapshot_master] does not have the names of the metrics. It is not possible to know in advance what metrics the server will return as it depends on server details (version and configuration). And actually a server may be upgraded.

]]>