Kshitij Banerjee
Kshitij Banerjee

Reputation: 1748

how to find writes per second on mysql?

Is there a mysql variable or monitoring that tells how many writes per second are being recorded ?

Can I use some variables values and compute to get the same result ?

Let's say I need to plot a graph dynamically of the same. What should i be doing ?

Im looking for command line options and not GUI based monitoring tools.

I have a mixed tokudb and innodb use case, so something non-storage engine specific would be better.

Upvotes: 0

Views: 1928

Answers (1)

Rick James
Rick James

Reputation: 142373

( Com_insert + Com_delete + Com_delete_multi +
  Com_replace + Com_update + Com_update_multi ) / Uptime

gives you "writes/sec" since startup. This is from the point of view of the user issuing queries (such as INSERT).

Or did you want "rows written / sec"?

Or "disk writes / sec"?

The values for the above expression come from either SHOW GLOBAL STATUS or the equivalent place in information_schema.

If you want "write in the last 10 minutes", then capture the counters 10 minutes ago and now. The subtract to get the 'change' and finally divide.

There are several GUIs that will do that arithmetic and much more. Consider MonYog ($$), MySQL Enterprise Monitor ($$$), cacti, etc.

Upvotes: 2

Related Questions