Monitoring in mysql

Please tell me how can I track the insertion rate per second for a table with mysql?

Thank!

+3
source share
2 answers

You can control it in real time just by doing something like this

  • Count the number of lines
  • Wait xseconds
  • Count the number of lines, find the delta ybetween two values
  • rate = y/x

If you do not want to do this in real time, you can analyze the MySQL binary log to see how many insert statements have been executed and received timestamps.

, , , . , , ...

SELECT count(*) AS inserted 
FROM table 
WHERE unix_timestamp(created) BETWEEN unix_timestamp()-3600 AND unix_timestamp();

, ( ), - munin ( , , ).

munin graph example

+4

SHOW STATUS LIKE 'Handler_write'

, . , . .

+1

Source: https://habr.com/ru/post/1785644/


All Articles