0

When running the status command in MySQL, one of the metrics that is sent back is "Queries per second avg: 5910.758"

I was wondering if anybody know what makes up that number?

Reason for asking is we tracked all the selects, updates, inserts from the performance_schema and we don't get anywhere near that number.

3 Answers 3

1

Tracing it through it ends up being a COM_STATISTICS in the protocol, resulting in this bit of server code.

So based this 'Queries per second avg' is the, the thread_id as the number of queries, divided by the total uptime of the server.

0

SHOW GLOBAL STATUS; You will see Questions and Uptime. Divide those to get the avg QPS (since restart). The status values are (or used to be) in information_status.GLOBAL_STATUS. What version of MySQL are you using?

Also note Com_select, Com_update, etc. They may add up toQuestions`.

Queries, I think, includes Questions, plus queries that are inside Stored Routines.

5910 is a rather large value. I would put it above the 95th percentile.

0

I figured out some more data, related to @danblack and @rickjames above:

SELECT EVENT_NAME, COUNT_STAR FROM performance_schema.events_statements_summary_global_by_event_name WHERE EVENT_NAME LIKE 'statement/sql/%' and COUNT_STAR > 0 order by COUNT_STAR;

This shows all the counts.

Summing this all gives a value, say 7 billion - dividing that by the uptime seconds, gets you to the correct answer (close any ways) to what the "status" command gives.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.