Repository navigation
Experiences with ClickHouse hot/cold storage for Plausible CE? #6676
Replies: 1 comment
|
I haven't run tiered storage on Plausible CE in production, so I can't answer 1, 2 and 7 from experience. But I read how Plausible creates and migrates these tables, which answers part of 3–5, and a few ClickHouse details are worth knowing before you set this up. About ALTER TABLE events_v2 MODIFY TTL timestamp + INTERVAL 12 MONTH TO VOLUME 'cold';
ALTER TABLE sessions_v2 MODIFY TTL start + INTERVAL 12 MONTH TO VOLUME 'cold';I'd set the variable before the first start, so both tables are created on your policy. Switching an existing table later with On upgrades (3, 4): Plausible has rebuilt these tables in data migrations before. SELECT name, engine_full FROM system.tables
WHERE database = currentDatabase() AND name IN ('events_v2', 'sessions_v2');For sizing (7): after a few weeks of real traffic, this shows how many bytes a row really takes, so you can see whether 12 months even outgrow the NVMe: SELECT table, sum(rows) AS rows,
formatReadableSize(sum(bytes_on_disk)) AS size,
round(sum(bytes_on_disk) / sum(rows)) AS bytes_per_row
FROM system.parts
WHERE active AND database = currentDatabase() AND table IN ('events_v2', 'sessions_v2')
GROUP BY table;One more thing grows on the fast disk no matter how you tier. CE's |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm planning a self-hosted Plausible CE deployment and I'm looking into long-term CLickHouse storage options.
Traffic will be somewhat seasonal, potentially around 10M+ pageviews/moth durin busier periods, while much lower during quieter months. I'd like to keep historical analytics indefinitely, but I don'n necessarily want severl years of rarely accessed data occupying the fast local storage.
I'm considerin setup along these lines:
TTL .. TO VOLUMESo conceptually:
Local NVMe - recent data, 0-12 months
↓ TTL MOVE
Slower storage - historical data +12 months
I'm mainly interested in whether anyone is already doing something similar with Plausible CE in production.
A few specific questions:
I'm not mainly looking to delete old analytics. The goal is to keep them queryable while allowing older, rarely accessed data to live on cheaper/slower storage.
Any production experiences, configuration approaches, or upgrade-related caveats would be very useful. : )
All reactions