Clickhouse does not prune session replays after the set amount of days
Author: Wessam-AbozeidCreated Dec 10, 2025Updated Sep 26, 2026
I connect Rybbit to a site with around 8mn events/month, and have session replays enabled. The VPS I host on has 160 GB disk space, which I figured out handles 2 days of sessions replays, so I set:
docker exec -it clickhouse clickhouse-client --database analytics ALTER TABLE session_replay_events MODIFY TTL toDateTime(timestamp) + INTERVAL 2 DAY; ALTER TABLE session_replay_metadata MODIFY TTL start_time + INTERVAL 2 DAY;
The issue: Despite the new TTL, the session replays don't actually get pruned and I run out of disk space until I have to truncate the tables manually.
Source: rybbit-io/rybbit