Mysql count how many queries per second are executed, is there any way?

Nikos picture Nikos · May 2, 2010 · Viewed 15.8k times · Source

i have a busy web server with LAMP installed, and i was wondering, is there any way to count how many queries per second (mysql) are executed in the server ?

Thank you.

Answer

n00b picture n00b · Jun 26, 2013
SELECT s1.variable_value / s2.variable_value
FROM information_schema.global_status s1, information_schema.global_status s2
WHERE s1.variable_name='queries'
AND s2.variable_name ='uptime';