Symptoms:
du -sh /db/elasticsearch
du -sh /db/rabbitmq
du -sh /db/data
Note: This will detail and display the /db/data volume taking most of the space. If it is one of the other disk trees, please see other KBs (i.e. audit data).
Prerequisite:
Steps to clean up excessive disk space consumed by OAuth2RefreshToken
table.
# service horizon-workspace stop
# export PGPASSWORD=`cat /usr/local/horizon/conf/db.pwd`
# /opt/vmware/vpostgres/current/bin/psql -U postgres -d saas
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;
# truncate table "OAuth2RefreshToken" CASCADE;
# select count (*) from "OAuth2RefreshToken";
# select count (*) from "OAuth2AccessToken";
# select count (*) from "SuiteTokenCache";
# vacuum full verbose;
# reindex table "OAuth2RefreshToken";
# vacuum full verbose;
# \q
# service vpostgres restart
# service horizon-workspace start
# /opt/vmware/vpostgres/current/bin/psql -U postgres -d saas
# select count (*) from "OAuth2RefreshToken";
# SELECT pid,application_name FROM pg_stat_replication;
application_name
= walreceiver
results which remain whenever checked. Use this SQL query to forcibly stop a process:
# SELECT pg_terminate_backend(<stuck_pid>);
step 2
here to check if any of the same processes are still here.