Comments (2)
The primary purpose of the GC tasks is to handle metrics that are no longer being produced.
there is no need to clear the old data, because it wouldn't gain us any memory back.
This doesn't make any sense. How can deleting unused data not free memory? The memory might not get released back to the kernel, but it does get released back to the GO vm. When a metric stops receiving new data, the GC task will first persist the unfinished chunk (by the default the GC runs every hour, so if no metric has been received for an hour the chunk is persisted). If the last saved chunk is more then GC time + (chunkspan * numchunks), then the entire aggmetric is purged from memory. So if the app is tuned to keep 3 hours of data in memory and the default GC of 1 hour is used, then the aggmetric won't be purged until it hasn't been written to for 5hours.
it's IMHO better to just avoid GC and let data expire naturally.
Stale metrics need to be purged from memory to make way for new metrics. Once the aggmetric is created (with the circular buffer) it will live forever unless we delete it. Keeping stale metrics in memory indefinitely just doesnt make any sense.
re #42
- it might be more lines of code but it is significantly simpler code. Additionally the old code used the app start_time to calculate things which could be used any more after the save/load at stop/start time was added.
- It may impact this, but the worst case scenario is that a few metrics will be rejected due to the last chunk being forcefully finished and persisted to disk. And even then this can be addressed pretty easily.
- Yes there is definitely room for optimizations. But if we try to make everything perfect before pushing this to production we will be waiting forever.
from metrictank.
after discussion with AJ, i actually like the new cbuf format. it basically doesn't map chunks to given positions by modulo'ing the t0's. rather it just appends at the end and starts over when needed. this gracefully handles gaps. and indeed, the new code is more elegant and simple.
and keeping older data as long as we don't need to clear/reuse their slots also simply follows out of this design, with a configurable setting for when "too old really is too old" 👍
from metrictank.
Related Issues (20)
- High priority / backlog on metric flush HOT 5
- MT-Whisper-Importer-Writer can get stuck on invalid requests HOT 1
- request: tag-native divide and asPercent functions HOT 9
- Panic and crash in chunk cache
- Graphite API responds with 413 when response is too large not request HOT 5
- Add more logging with traceID HOT 2
- Ability to "revive" archived series HOT 15
- Support "archive" in tags/delByQuery HOT 2
- Stored 'lastupdate' being approximate can cause inconsistent missing data HOT 6
- deletes don't affect stale metrics. They may resurface if max-stale gets increased HOT 2
- Move to go modules for dependency management HOT 5
- Authentication in mt-gateway or document other way to proceed without tsdb-gw HOT 4
- Panic in mt-whisper-importer-reader HOT 1
- Conf parsing changes fail to parse regex HOT 2
- Multiple shards on same hardware node HOT 2
- metrictank memory issues HOT 6
- UnpartitionedMemoryIdx.Get does not check writeQueue
- MetricData messages in mdm topic poorly defined. make versioning explicit?
- Is the project stalled? HOT 2
- Control partition size using Cassandra as backend HOT 1
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 metrictank.