3 ms·
RRDtool is pretty nice, but it has a fair number of scalability issues too: * Once you create an RRA (archive file) you can't modify it to add or remove metric
by otterley 15y ago
RRDtool is pretty nice, but it has a fair number of scalability issues too:
* Once you create an RRA (archive file) you can't modify it to add or remove metrics, or change their properties. This makes them relatively inflexible.
* Updating RRAs is I/O heavy. Every time an update comes in, the OS must read, modify and write a page.
* RRDcache mitigates this somewhat by deferring flushes, but there are diminishing returns to this (eventually the number of writes coming in will cause the cache flush and filesystem metadata update rate to exceed the maximum IOPS available), and you risk data loss in the event of a power outage or the OOM killer kills the process.
Time-series data access patterns tend to be write-heavy. Storing first in an append-only log is a big win here; Cassandra and MySQL are both good choices, though you do have to think about the schemata first. And disk is so cheap now that expiration can be an afterthought.
- shykes 15y agoTo handle very high throughput, storing RRD files on a ramdisk works surprisingly well, if you can afford the cost and the loss of a few seconds of data - which most of the time you can. A simple tar + gzip is all you need to flush to disk, at the frequency of your choice. It turns out rrd write operations are safe enough to do this without corruption. And the IO cost is minimal compared to rrdcache: rrd data compresses extremely well.
- otterley 15y agoInteresting idea, but not a very efficient use of memory. Not only would you have to reserve memory for the ramdisk (assuming you even have enough to store all the files), but more precious memory would be wasted by buffer-caching the freshly-written tarred archives. You'd be sacrificing memory that would be otherwise used to service reads on frequently-accessed RRD files.
- shykes 15y agoYour point is technically valid but irrelevant in practice. The compressed tar is surprisingly small and you can stream it to S3 if you really want to shave off megabytes. But more importantly, you don't care. This will give you 3 orders of magnitude better write throughput with 2 hours of work. The savings in engineering time alone will buy you 1000x the ram you wasted! With that kind of achievement, my advice would be leave over-optimization for later and buy yourself a drink :)
- otterley 15y agoIt's not irrelevant in practice, at least not for me. I deal in enormous amounts of data that couldn't possibly fit into RAM.