hugowan / maatkit

Automatically exported from code.google.com/p/maatkit
0 stars 0 forks source link

Create mk-loadavg #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some of the tools can benefit from measuring server load somehow and
throttling their activity.  mk-table-checksum, mk-table-sync, mk-archiver.

Possible metrics:

* number of locked connections
* slave lag
* Trevor's measure of server load for innotop (in Baron's email archive)

The metric needs to be a simple number so it can easily be used as an
argument to a command-line option.  mk-table-checksum already has this
notion with slave lag.

Original issue reported on code.google.com by baron.schwartz on 4 Nov 2008 at 5:44

GoogleCodeExporter commented 9 years ago
Here is Trevor Price's explanation of his load calculation:

I = number of selects running for a given show processlist poll.  Where
running is Command = query.

S = # of selects per second for a given time interval T

So I run about 100 show processlists in sequence.  Each poll provides a
calculation for I.  Average all the different I samples and calcuate S by
show status before and after the show processlist polls.  Then

A = average query response time

A = I / S

You need to take enough show processlist samples to get a good average for
I.  The absolute # I get from this looks pretty good. It seems to match up
with #'s from show profiles.  Which is the only technique I know to get < ms
timing info.

Original comment by baron.schwartz on 8 Nov 2008 at 3:49

GoogleCodeExporter commented 9 years ago
I see the need also for a tool, call it mk-loadavg, that can calculate the 
metric and
if it's over X, grab various info (STATUS, INNODB STATUS, PROCESSLIST) and 
print to
STDOUT, email, or save it to a file.

Original comment by baron.schwartz on 8 Nov 2008 at 4:25

GoogleCodeExporter commented 9 years ago
A major reason to make this a daemonizable tool: "too many connections" could 
keep a
crontab-ed program from connecting :)

Description was: "Develop some metric of server load observable from MySQL 
only, and
apply to tools"

Original comment by baron.schwartz on 11 Nov 2008 at 6:56

GoogleCodeExporter commented 9 years ago
Other metrics:

* An arbitrary number/sec of any item in SHOW STATUS.
* An arbitrary absolute number of any item in SHOW STATUS.

The following from SHOW INNODB STATUS:

* Transactions waiting for locks to be released
* Transactions waiting in the queue.

Original comment by baron.schwartz on 19 Nov 2008 at 2:49

GoogleCodeExporter commented 9 years ago
From SHOW INNODB STATUS:

* Semaphores waited for.

Original comment by baron.schwartz on 20 Nov 2008 at 3:18

GoogleCodeExporter commented 9 years ago

Original comment by baron.schwartz on 4 May 2009 at 2:14

GoogleCodeExporter commented 9 years ago
If anyone has any further ideas for this script, please place them under 
mk-loadavg
in NewScripts.

Closing this issue to get it out of the list.  NewScripts links here so nothing 
is lost.

Original comment by dan...@percona.com on 5 Jun 2009 at 3:02