---
title: Dealing with the disk_full mode in a Database Instance
description: Troubleshoot disk full issues for PostgreSQL and MySQL databases.
tags: disk-full databases
dates:
  validation: 2025-07-15
  posted: 2023-02-16
---

Whenever your Database Instance volume is close to reaching full capacity, your Database Instance switches to `disk_full` mode.

The Database Instance switches to `disk_full` mode when the free space falls under 2% of the total volume size.

For Database Instances where 2% of the volume size is more than 2 GB, this threshold is 2 GB.

This state allows you to increase your volume, if you use Block Storage, or [upgrade your node type](/en/docs/managed-databases-for-postgresql-and-mysql/how-to/postgresql-upgrade-version/). You can also clear some space in your volume to increase your capacity.

When the Database Instance switches to `disk_full` state, the default transaction mode automatically switches to `read only`. This allows your applications to still access its data, while preventing new data from being added.

> **Important**
>
> The Database Instance disk space includes database engine logs.

You can check your current engine logs consumption by using the Scaleway CLI:

```
scw rdb log list-details instance-id=11111111-1111-1111-1111-111111111111
Details.0.LogName   postgresql-01.log
Details.0.Size      64257
Details.1.LogName   postgresql-02.log
Details.1.Size      81560
...
```

You have the possibility to purge a single file or all the log files:

```
# Purge a single file
scw rdb log purge instance-id=11111111-1111-1111-1111-111111111111 log-name=postgresql-01.log

# Purge all your logs
scw rdb log purge instance-id=11111111-1111-1111-1111-111111111111
```

## How to clear out space used by your Database engine

1. [Connect to your Database Instance](/en/docs/managed-databases-for-postgresql-and-mysql/how-to/connect-database-instance/).

2. Run the following commands to shift to a `read write` transaction:

   ```sql
   -- On PostgreSQL
   BEGIN;
   SET TRANSACTION READ WRITE;
   ```

   ```sql
   -- On MySQL
   SET transaction_read_only=0;
   BEGIN;
   ```

3. Clear out data from your database.

4. Commit your changes.

   ```
   COMMIT;
   ```

When your Database Instance has enough space again, the default transaction mode changes back to `read write`, allowing operations to return to normal.

> **Important**
>
> Failing to clear out some of your data or forcing insertions while the database is in `disk_full` mode leads to downtime.
