If you receive a support ticket with this message: "Our monitoring has detected files storage on your cluster (PROJECT ID) is nearing full.", it means that the disk space has been increased in order to prevent an imminent outage.
Usually it is either web files (exports) disk or database (mysql) disk. Please review the data and make sure you prevent further unexpected increase of file storage usage.
If needed, request further upsize.
You can get a disk usage report with the following:
Exports (web files) disk
Check logs size with this command:
du -h /app/<PROJECT ID>/var/log
If the log folder usage is large, you can request to reduce the logs retention in the ticket.
Otherwise, you can get a report of folders usage with this command:
du -h --max-depth=2 /mnt/shared/<PROJECT ID>/
You can increase the folder listing detail by increasing the --max-depth value.
Mysql disk
You can get a report of the biggest tables with this command:
SELECT table_schema, table_name AS 'Table', ROUND(((data_length) / 1024 / 1024), 2) AS 'DataSpace' , ROUND(((index_length) / 1024 / 1024), 2) AS 'IndexSpace' , ROUND(((data_length + index_length) / 1024 / 1024), 2) AS 'TableSize', ROUND(((data_free) / 1024 / 1024), 2) AS 'DeadSpace', ROUND(((data_length + index_length + data_free) / 1024 / 1024), 2) AS 'DiskSpace', ROUND(((data_free) / 1024 / 1024)/((data_length + index_length + data_free) / 1024 / 1024), 2) * 10 as 'WastedPercent' FROM information_schema.TABLES WHERE table_schema != 'jmc' union SELECT table_schema, 'all' , SUM(ROUND(((data_length) / 1024 / 1024), 2)) AS 'DataSpace' , SUM(ROUND(((index_length) / 1024 / 1024), 2)) as 'IndexSpace' , SUM(ROUND(((data_length + index_length) / 1024 / 1024), 2)) as 'TableSize', SUM(ROUND(((data_free) / 1024 / 1024), 2)) as 'DeadSpace' , SUM(ROUND(((data_length + index_length + data_free) / 1024 / 1024), 2)) as 'DiskSpace', (SUM(ROUND(((data_length + index_length) / 1024 / 1024), 2)))/( SUM(ROUND(((data_length + index_length + data_free) / 1024 / 1024), 2))) * 10 as 'WastedPercent' FROM information_schema.TABLES WHERE table_schema = 'jmc' GROUP BY table_schema ORDER BY 7 DESC LIMIT 20;
Tables with large Deadspace i.e. deleted data, can be optimized with optimize table command:
optimize table <TABLE NAME>