Vacuum

When you delete records, SQLite keeps the space inside the database file instead of giving it back to the disk, so the file stays as big as it ever was. Vacuum compacts your app's databases on a schedule, and the freed space goes back to the disk.

It's off until you turn it on.

Turn it on

  1. Open your app's dashboard at https://<your app>/_/ and sign in as a superuser.
  2. Click Settings, then Backups in the sidebar.
  3. Scroll to the Vacuum section at the bottom of the page.
  4. Tick Compact the databases on a schedule, pick How often (every day, every week or every 30 days), and click Save.

The section then shows the schedule, the next run, and what the last run gave back.

A database is only compacted when at least 10% of it (or 64 MB) is free space, so a busy app that doesn't delete much is left alone. Writes wait while it runs, and it needs free disk space about the size of the database it compacts.

Set it in pocketone.yaml

To turn it on without the dashboard, in pocketone.yaml:

vacuum:
  enabled: true
  every: 168h   # weekly; at least 1h

The file only applies until someone saves the Vacuum section in the dashboard. After that, the saved settings are used.

Check it from your terminal

pocketone remote vacuum status

When your host compacts for you

Some hosts compact their apps' databases themselves. Then the Vacuum section says so, shows the host's schedule and last run, and has nothing to change.

Reference