Mysql query to return server load average

Does anyone know of a MySQL query that returns the current server load?

+2


source to share


4 answers


Correct me if I'm wrong, but the average load variable is a property of the machine, not the MySQL server. So to get avg. you should be looking for a system call, not a SQL query.



+1


source


Do you mean the actual system load? This has nothing to do with MySQL. For example, on Linux, you can get it from /proc/loadavg

.



+2


source


You might want to look into this statement:
http://dev.mysql.com/doc/refman/5.1/en/show-status.html

SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern' | WHERE expr]

SHOW STATUS provides information about the state of the server. This information can also be obtained using the mysqladmin extended status command. How, if present, indicates which variable names to match. WHERE can be specified for row selection using more general conditions, as discussed in Section 20.28, "Extensions to SHOW Statements". This expression does not require any privilege. It only requires the ability to connect to the server.

+1


source


Do you have mytop installed?

mytop - a console (non-gui) tool for monitoring threads and overall performance of MySQL 3.22.x, 3.23.x and 4.x server

Mytop lets you track what's going on in real time, from requests per second to key request performance.

See Using Mytop: MySQL Monitor

0


source







All Articles