---
title: "Using disk space in a PostgreSQL for 1C cluster"
sidebar_label: "Using disk space"
sidebar_position: 11
description: "How disk space is used in a PostgreSQL for 1C cluster and how to clear the disk"
---

import Formbricks from '@theme/MDXComponents/Formbricks';

# 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 portion of the disk space is not available to host databases. Take this into account when selecting a [configuration lineup](/managed-databases/postgresql-for-1c/configurations.mdx).

You can track disk occupancy using [disk occupancy notifications](#disk-full-notifications) and metrics. For more information about metrics, see the [Monitoring PostgreSQL clusters and nodes for 1C](/managed-databases/postgresql-for-1c/monitoring.mdx) guide.

If the cluster disk is 95% full or more, the cluster will enter the `DISK_FULL` status and will be switched to read-only mode. This is necessary to prevent the cluster from being completely blocked or corrupted due to a lack of free space. To restore read and write operations, [clean up the disk](#disk-cleanup) or [scale the cluster](/managed-databases/postgresql-for-1c/resize-cluster.mdx) and select a configuration with a larger disk size than the previous one.

## Disk occupancy notifications \{#disk-full-notifications}

Disk occupancy notifications are sent to the email address of the [Account Owner](/access-control/user-types.mdx#account-owner) and [panel users](/access-control/user-types.mdx#panel-users) who are subscribed to the [notification category](/account/notifications.mdx#notification-categories) "Services". Notifications are sent when disk usage reaches 80% and 95%.

## Clear the disk \{#disk-cleanup}

:::info

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 store 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 the transaction `transaction_read_only = no` and delete unnecessary data using one of the following queries:

* `DROP TABLE` — completely deletes the table: data, structure, indexes, constraints (constraints), and triggers.

  ```sql
  BEGIN;
  SET transaction_read_only = no;
  DROP TABLE table_name;
  COMMIT;
  ```

* `TRUNCATE TABLE` — removes all rows from a table. It works faster than `DELETE`.

  ```sql
  BEGIN;
  SET transaction_read_only = no;
  TRUNCATE TABLE table_name;
  COMMIT;
  ```

* `DELETE` — deletes rows specified in the `WHERE` condition.

<Formbricks />
