← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: Creating an internal admin connection

 

Hey Joshua,

  Thanks. I saw that script and was going to use it originally but I was
concerned about memory usage of mysql-proxy if it was suddenly asked to
start maintaining an in-memory record of the analysis of possibly
hundreds-of-thousands of queries on a daily basis.

 

The intent behind slow_query_log is to leave it running and perform
analysis of its contents at leisure or on regular basis. Is the same
intent present with m-p and the analyze-query.lua? Or is the lua intent
to only run it for select periods of the day or on a case-by-case basis?

 

I was hoping to turn this into a 'feature' we offer to our customers.
Leave the analysis running all the time and periodically spit out
reports to our internal customer portal.

 

MSSQL has some amazing stats that are "always on" and I'm trying to
implement most of them.

 

Another idea I just had; leave the slow_log as it is and basically
'dump' that table through m-p and let it tokenize into another table.
That possible? Or would that just be a normal LUA script? (ie: is the
tokenizer part of m-p or is it pure LUA?)

 

Hm. Another idea. Continue to use slow_log. Start m-p with a simple
script that looks for a custom command ('START SLOW ANALYSIS', etc)
which then does a select from slow log, and uses read_result to tokenize
each row and create the report. May take a while depending on size of
slow_log but then that could be scripted in a cron job or something.

 

-Matthew

 

 

From: Joshua Zhu [mailto:zhuzhaoyuan@xxxxxxxxx] 
Sent: Wednesday, February 25, 2009 8:17 PM
To: Boehm, Matthew
Cc: mysql-proxy-discuss@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Mysql-proxy-discuss] Creating an internal admin connection

 

Hi Matthew,

"Initiating a custom, internal, connection" is way too complicated. But
I guess the same purpose as you described can be achieved by
using/tweaking the analyze-query.lua script, which will build an
in-memory table named histogram.queries, analyze the queries and store
the analysis information in it. BTW, what makes it convenient is that
you can use SELECT/DELETE statements to operate this table.

Cheers!

-- 
Joshua Zhu
http://blog.zhuzhaoyuan.com


Follow ups

References