HyperLogLogs take up 12KB of space. I don't see anything in the docs about when that storage is freed up.
My current plan is to call EXPIRE
every time I call PFADD
, but I can't find much discussion about expiring HLLs, so I'm wondering if I'm doing it wrong...
I'm planning on using HLLs to count the number of active visitors on my site in real-time. I only want to keep the counts for the past hour around, freeing up anything older than that.
NO, you cannot expire items added to the HLL. Instead,
EXPIRE
command will expire the whole HLL.In order to achieve your goal, you can create HLL for each hour, and expire the whole HLL after some time.