Comments (10)
The memory usage in rdb and in memory are not the same.
The rdb format at the moment is as a pair of timestamp+value (per sample).
While the in memory usage is a little different: each TS key will have a minimum of 1 chunk and each chunk has a (default) of 360 samples.
Each sample is 12 bytes, but since we are using chunks for data partitioning there will be overhead of 360 % Nsamples per key.
If the keys are quite small as you say, I will recommend using smaller chunks.
from redis-timeseries.
Also if you can upload the RDB file and make it available I might be able to get some more information about the usage.
from redis-timeseries.
Thank you very much for the advice, I appreciate you being so responsive.
The difference between rdb and in memory makes sense, and definitely matches what I was seeing.
I'm working on a test dataset that could be possibly be sanitised, but unfortunately I'm developing this at my dayjob and can't just dump it as is.
If I understand correctly, when a TS key is created using the default sample size (360), the space is eagerly allocated (e.g. it immediately uses 360*12 bytes of space, before any samples are added). From this the overhead as you have said is the difference between the # of samples actually inserted, and the pre configured bucket size?
If the above is correct, creation of smaller buckets will reduce my memory usage, but possibly slicing buckets too small would create a slower query speed? (which I am OK with, but i'd like to understand the tradeoffs).
A separate point I would like to clarify, just to ensure that the behaviour I am seeing is as intended and stable, I have the following keys:
- Master TS key ("base"), with a 60 second retention period
- Hourly downsample TS key ("1h"), with 7 day retention period
and the following compaction rules:
- ts.createrule base sum 604800 1h
I then stream my data into the base TS key, and it is immediately downsampled into the appropriate bucket (1h).
Is the above a correct setup if I only require data at 1h granularity for 7 days?
Secondly, am i correct in saying it is safe to have only a 60 second retention period on the base ts key, as the downsampling is performed immediately after inserting into the base key (e.g. it does not need to buffer in the base key before being downsampled)
Thanks again! Things are looking great with this module so far.
from redis-timeseries.
You are correct with your analysis.
Its important to mention that downsampling has some limitations if the redis is being restarted.
There's a ticket for it: #22
from redis-timeseries.
@trist4n also, I've added support for global settings.
You can configure automatic downsampling rules for any created key including: default chunk size and retention time.
from redis-timeseries.
@trist4n do you have anything else on this matter or can we close this?
from redis-timeseries.
@danni-m right now i'm all set, i've had to put this project down temporarily but appreciate your help.
from redis-timeseries.
@trist4n Sorry for the late response, was is due to shortcomings in the module?
from redis-timeseries.
@danni-m i wouldn't say it is a shortcoming. for my particular use case, the main issue I could not easily fix was what happens when i got two samples with the same key on the same second, which wasn't avoidable the way I have modelled the system.
from redis-timeseries.
@trist4n what do you expect to get in this situation?
The current logic is to use the last sample that was received.
from redis-timeseries.
Related Issues (20)
- Add TS.RANGE command complexity description HOT 2
- Question on chunks HOT 11
- Redis rdb save crashes if no samples yet HOT 1
- has it tested on arm? HOT 1
- Contributing a feature - is it relevant? HOT 3
- Retain compaction context in rdb
- Calculate correlation between two keys
- Timestamp Too Old HOT 10
- Timestamp with milliseond precision HOT 1
- Add NX argument to TS.CREATE HOT 4
- Support automatic timestamps for arbitrary values
- Support adding multiple or weighted values HOT 1
- Multiple compaction rules on a key cause crash on redis startup HOT 1
- Replacing the current value in a series corrupts aggregate values
- Timeseries starting from 0 are unsupported HOT 1
- How to use int64 timestamp HOT 1
- how does retentionSecs works? HOT 2
- Compilation Issue on MacOS Sierra v10.12.6 HOT 2
- Compressing timestamps HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-timeseries.