netdata/netdata

[Feat]: carts for mariadb circular buffers

ekexcello opened this issue · 0 comments

Problem

We use mariadb with galera. To investigate and tune it's state transfre capability, we need to track utilization of two circular buffers, namely Gcache and Redo log (innodb_log). We need to know how much history buffers are able to hold in our setup.

Description

As buffers are circular, they act like LIFO, so once the buffer is completely utilized, adding new data purges oldest records.
For each buffer we would need three charts:

  • circular buffer size
  • total amount of bytes written into the buffer
  • time since the moment the buffer is completely utilized first since mariadbd start-up.

In order not to overload mariadb with reading parameters, it's enough to have these values checked once a minute.
At the moment Netdata already collects wsrep_replicated_bytes per-second delta (shown on chart mysql.galera_bytes and Innodb log buffer per-second delta is present in mysql.innodb_io, but we need absolute values also.

Importance

really want

Value proposition

  • For Gcache:
  1. buffer size on disk
  2. amount of replicated data
  3. time since first overflow
  • For Innodb log buffer:
  1. buffer size on disk
  2. amount of data written
  3. time since first overflow

Proposed implementation

  • For gcache buffer:
  1. size can be obtained as a field gcache.keep_pages_size from the wsrep_provider_options variable (that can be read as SHOW VARIABLES LIKE 'wsrep_provider_options'\G).
  2. amount of replicated data can be obtained from SHOW STATUS LIKE 'wsrep_replicated_bytes'; output directly.
  3. time since first overflow is 0 until the moment of (wsrep_replicated_bytes = gcache.keep_pages_size), than it should be the difference between that moment and current time.
  • For Innodb log buffer:
  1. size can be read from system variable SHOW STATUS LIKE 'innodb_log_file_size'; directly
  2. amount of written data can be read from system variable SHOW STATUS LIKE 'Innodb_os_log_written';
  3. time since first overflow is 0 until the moment of (innodb_log_file_size = Innodb_os_log_written), than it should be the difference between that moment and current time.