Closed GoogleCodeExporter closed 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
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
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
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
From SHOW INNODB STATUS:
* Semaphores waited for.
Original comment by baron.schwartz
on 20 Nov 2008 at 3:18
Original comment by baron.schwartz
on 4 May 2009 at 2:14
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
Original issue reported on code.google.com by
baron.schwartz
on 4 Nov 2008 at 5:44