Disk space usage in PostgreSQL cluster for 1C
In Managed Databases, part of the disk space is reserved for service needs:
- for the file system - approximately 4% of the disk volume;
- for the operating system, service components and logs - approximately 8 GB.
The reserved portion of the disk space is not available to host databases.Keep this in mind when selecting a line of configurations.
You can monitor disk occupancy with disk occupancy notifications and metrics.Read more about metrics in the Monitoring PostgreSQL Cluster and Nodes for 1C tutorial.
When the cluster disk is 95% or more full, the cluster will go to DISK_FULL status and will be read-only.This is to prevent the cluster from completely locking up or being damaged due to lack of free space.To make the cluster work read and write, clear the disk or scale the cluster and select a configuration with a disk size larger than the previous configuration.
Disk fullness notifications
Disk fullness notifications are sent to the Account Owner's email and to users who are subscribed to the "Services and Services" notification category.Notifications are sent when the disk is 80% and 95% full.
Clear the disk
We do not recommend using the query DELETE FROM table WHERE ... This query can create large size selections on large tables and place them on disk.The remaining free disk space may run out completely, leading to problems with PostgreSQL and the need to restore it manually.
Open transaction transaction_read_only = no and remove unnecessary data using one of the queries:
-
DROP TABLE- completely deletes the table: data, structure, indexes, constraints, triggers.BEGIN;
SET transaction_read_only = no;
DROP TABLE table_name;
COMMIT; -
TRUNCATE TABLE- deletes all rows from the table.Works faster thanDELETE.BEGIN;
SET transaction_read_only = no;
TRUNCATE TABLE table_name;
COMMIT; -
DELETE- deletes the rows specified in the conditionWHERE.