Skip to main content

Using disk space in a PostgreSQL for 1C cluster

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 part of the disk space is unavailable for hosting databases. Keep this in mind when choosing a configuration line.

You can monitor disk usage using disk full notifications and metrics. For more information about metrics, see the PostgreSQL for 1C cluster and node monitoring instructions.

When a cluster disk is 95% full or more, the cluster enters the DISK_FULL status and becomes read-only. This is necessary to prevent complete locking or corruption of the cluster due to lack of free space. To make the cluster read-write, clean up the disk or scale the cluster and select a configuration with a larger disk size than in the previous configuration.

Disk occupancy notifications

Disk usage notifications are sent to the email addresses of the Account Owner and control panel users who are subscribed to the notification category Products and services. Notifications are sent when the disk is 80% and 95% full.

Clear the disk

For your information

We do not recommend using the DELETE FROM table WHERE ... query to clean up the disk. This query can create large result sets on large tables and place them on the disk. The remaining free disk space may run out completely, which will lead to issues with PostgreSQL and the need to restore its operation manually.

Open a transaction_read_only = no transaction and delete unnecessary data using one of the queries:

  • DROP TABLE — completely deletes a 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 than DELETE.

    BEGIN;
    SET transaction_read_only = no;
    TRUNCATE TABLE table_name;
    COMMIT;
  • DELETE — deletes the rows specified in the condition WHERE.