-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activate automatic compression using the helm chart #26
Comments
I also have trouble finding the size of each metrics data in the database which would really help to filter out the unused metrics taking the most disk. I am new to timescaledb but I tried to look around the DB with pgadmin4 without success. I also tried this but I got an empty result:
|
Hello @jpigree thank you for trying out timescale-prometheus. Compression is enabled by default for each metric when timescale-prometheus creates the schema. Why you might not be seeing your data get compressed is because the default chunk-size for each metric is 8h. Compression only works on chunks whose end-time is in the past, so when a new chunk is created for each metric, the old chunks will be eligible for compression.
For example: A clean database with a default metric chunk-interval of 4 hours where you're seeing a 1GB/h ingest rates. Data starts coming in at t=0, first chunks are created for each metric. At t=4h the db would grow up to ~4GB. at t=4h+1s new chunks get created for each metric, old chunks are available for compression. |
Regarding the size of each metric table. SELECT *
FROM timescaledb_information.hypertable
WHERE table_name IN (SELECT table_name FROM _prom_catalog.metric);
Also forgot to mention that you can set the retention period for all or specific metrics check out the API doc I linked in the previous comment |
Thank you so much for the in-depth answers @blagojts. I understand better now how compression works and I am able to check the metrics size. However, there isn't a mecanism to easily set the metric chunk intervals from the Helm chart. Is there any plan to make this configurable from the Otherwise, I will have to do it with a separate script. Thank you again! |
There is no mechanism in place for setting this from the helm chart, or a flag of Timescale-Prometheus, since it's handled in the migration scripts. The idea is that you would use the SQL API for this. But we'll have it under consideration |
Okay. If I find something myself I will share. Thanks again for your help! |
Can you paste your PromQL for the disk usage graph here? I want to run some tests |
We discovered an issue that didn't activate the compress_chunk policies, thus leaving your data uncompressed even after it is eligible. Working on a fix |
hi @blagojts. I use the prometheus-operator so the PromQL is from the kubernetes-mixins repo. I managed to extract it:
|
@jpigree yes, this is related to several small changes we did throughout the codebase, but also a bugfix in the latest TimescaleDB release regarding the background worker framework. I'll mark the issue as closed |
Hi. I installed a setup with
timescaledb
+timescale-prometheus
+prometheus
using this helm chart. However, I store a lot of metrics (multiple cadvisors and ~20 node exporters) and my timescale db fills up at the rate of ~1Gb/hour.I saw that it exists a compression mechanism for timescaledb which should greatly help keeping the disk usage low but I can't see a way to set it up easily with this helm chart and its subcharts.
Is there a way to do so or any alternatives to help? I saw that the cronjob doing cleanups on data runs a
CALL prom.drop_chunks()
command based on the retention period. However, it just outright delete data so this isn't what I want.Ideally, I would want to automatically compress data older than 6 hours.
Thanks for your help!
The text was updated successfully, but these errors were encountered: