Skip to content

ClickHouse store folder grows uncontrollably and is not cleaned up #256

@thibautLedz

Description

@thibautLedz

Hello team,

I'm self-hosting Plausible CE using Docker Compose (with the official setup). Plausible 3.0.1. I’ve noticed that the plausible-ce_event-data volume (used by ClickHouse) keeps growing in size, even though:

  • The events_v2 table only holds about 700k rows.
  • system.parts reports only a few dozen active parts, totaling ~10 MiB on disk.
  • Yet, the underlying ClickHouse store folder is currently over 44 GiB:

/var/lib/docker/volumes/plausible-ce_event-data/_data/store/0bb/0bbbeb02-... → 44G causing NO LEFT SPACE ON DEVICE

After investigation:

  • Many large part folders (several hundred MB to >1 GiB each) exist on disk but do not correspond to any active part in system.parts.
  • OPTIMIZE TABLE ... FINAL does not seem to clear them.
  • These parts appear to be dangling / orphaned, possibly due to merges being aborted or unreclaimed data.
  • The files continue being updated (file timestamps) even though they're not referenced by any active table part.
  • This leads to disk exhaustion over time on relatively small VPS setups.

Steps I've taken:

  • Ran ClickHouse queries to list active parts and their sizes
  • Compared actual files in /store with system.parts
  • Verified no active merges in system.merges
  • Tried OPTIMIZE TABLE ... FINAL
  • Ensured no secondary container is writing to the volume

Questions

  • Is there anything in Plausible’s setup that might prevent ClickHouse from garbage collecting those parts?
  • Could you recommend a safe cleanup strategy or confirm if manual deletion of those folders is acceptable?

Thanks a lot for this awesome project. I'd be happy to provide logs or help debug further if needed.

Best,
Thibaut

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions