MySQL – How to Monitor Reads/Writes to the Database

MySQLmysql-5.5

Is there a way to fetch the amount of reads / writes made to the entire DB (MySql) in a given period, e.g. the amount of read / writes in the last hour?

Best Answer

In the table GLOBAL_STATUS in information_schema.

Use the field Com_select for reads and sum the fields Com_delete, Com_insert, Com_update, Com_replace for writes.

These values are cumulativ counters, you should subtract values between an interval:

if t1=t0+60seconds, Com_select at t1 - Com_select at t0 = reads in 1 minute