Herring
Herring

Reputation: 173

MySQL statistics Questions formula

I'm trying to see what Questions statistics consists of.

I'm calculating QPS graph for Questions and QPS graph for sum of:

Basically all non zero Com_* statistics. But still I have up to 200 QPS difference in graphs.

Does anyone know what wasn't taken into account?

I'm using 4.1.22 version of MySQL.

Upvotes: 1

Views: 303

Answers (2)

Uday
Uday

Reputation: 1490

I did some testing on this. I came to know we have missed one more major count.

That is Qcache_hits

Include this in the list and you will see almost similar count on both the places.

Upvotes: 1

Shlomi Noach
Shlomi Noach

Reputation: 9394

"Quits" are also taken into account. I can't find it documented, but have tested this to work:

First, I issue two successive checks on Questions to test the test itself:

[email protected]> show global status like 'questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions     | 21113 |
+---------------+-------+

[email protected]> show global status like 'questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions     | 21114 |
+---------------+-------+

So each invocation like this makes for +1 on Questions -- we will reduce this from future tests.

And now, I quit an active session, then test again:

[email protected]> show global status like 'questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions     | 21116 |
+---------------+-------+

I made sure to enable general log so as to test the Quit operation was not issuing any funny queries -- it was not.

I'm not sure if there are any more operations which should be taken into account.

By the way, as of 5.0.72 and 5.1.31 the rules change. Read this for more.

Upvotes: 0

Related Questions