Skip to content

how to control sqlite log table size? #2102

Description

@audricd

Hello,

Im running a two node cluster, using sqlite for logging.

My master node size is.. big.

Image

whereas the second node is okay

Image

I have set this sql procedure:

CREATE DEFINER=`root`@`%` PROCEDURE `dns`.`purge`()
BEGIN
	DECLARE affected INT DEFAULT 1;
  	WHILE affected > 0 DO
		DELETE FROM dns_logs
		WHERE timestamp < DATE_SUB(NOW(), INTERVAL 90 DAY)
		LIMIT 2000;
		SET affected = ROW_COUNT();
    	DO SLEEP(0.05);
	END WHILE;
END

unfortunately it doesnt seem to do much, on the final size?

Image

dbeaver reports the table size to be 14gb, it was 20gb before any prunning (about of year of running?) so thats not possible. and on disk still 19gb. what am i missing?

thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions