cryostatio / cryostat-legacy

OUTDATED - See the new repository below! -- Secure JDK Flight Recorder management for containerized JVMs
https://github.com/cryostatio/cryostat
Other
222 stars 31 forks source link

[Task] Compression for Archived Recordings #732

Open andrewazores opened 2 years ago

andrewazores commented 2 years ago

We should support some kind of on-disk compression for archived recordings to save disk space. Here's a blog that looks at the topic of compressing JFR binaries using various compression algorithms:

http://hirt.se/blog/?p=1166

We likely just want to support one algorithm, and the implementation for it should be easily available for downstream builds as well. The compression should be enabled by default, but it should be possible to disable it by an environment variable, in case the end user would prefer to remove the compression CPU overhead and trade off for increased disk space usage, or in case the mounted archive filesystem is already doing transparent compressions, etc.

Should we also apply this compression to custom templates and to generated reports that are cached for archived recordings?

lkonno commented 1 year ago

I started looking this and I am planning to use the GZIP implementation from java.util.zip package in the archived recording files.

andrewazores commented 1 year ago

Yes, I think archived recording files is the most important thing to compress, since they're naturally just far larger and far more prevalent than the other things I named (custom template XML, automated rule JSON, report HTML).

The built-in GZIP sounds like a good choice, at least to start with. Perhaps in the future we can extend this to allow the user to select other algorithms like LZ4 or LZMA, too.