May 2010
We've got Zabbix monitoring our machines, but some even more important databases on the same DBMS, and Zabbix is using 16GB and hogging the disk under /var
.
Cleanup time.
zabbix=# SELECT pg_size_pretty(pg_database_size('zabbix')) As fulldbsize;
fulldbsize
------------
16765 MB
(1 row)
(According to this thread on the Zabbix forum, history
is a good acandidate to save some space:
zabbix=# SELECT pg_size_pretty(pg_total_relation_size('history')) As fulltblsize, pg_size_pretty(pg_relation_size('history')) As justthetblsize;
fulltblsize | justthetblsize
-------------+----------------
6123 GB | 12298 GB
(1 row)
(The numbers seem to be the wrong way around, but they're large anyway, so I can save space removing them.)
zabbix=# truncate table history;
zabbix=# vacuum analyze;
VACUUM