elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
18 stars 144 forks source link

Compression of elastic-agent (and beats) executables #4599

Open nradonicich opened 6 months ago

nradonicich commented 6 months ago

Describe the enhancement:

In order to reduce the size on disk of the extracted/installed elastic-agent and packaged beats executables could they be packaged as compressed executables (for example with upx, gopacker, mpress)

Describe a specific use case for the enhancement or feature:

Endpoints where disk space is limited or requested to be smaller (containers, small disk workstations)

What is the definition of done?

Having the unarchived/installed executables be compressed on disk at a similar size in the downloaded archive installer package.

Other Potential Relevant Links/Queries/Discussions

https://discuss.elastic.co/t/are-there-any-issues-or-topics-on-shrinking-elastic-agents-install-size/350099/2 https://discuss.elastic.co/t/elastic-agent-8-8-0-disk-space-requirement/334723/5 https://github.com/elastic/elastic-agent/issues/2759

pierrehilbert commented 6 months ago

Hello,

Thanks for taking the time to fill an issue. We just closed a similar issue https://github.com/elastic/elastic-agent/issues/3364 as we worked on a solution to decrease the Agent size.

I'm closing this one as I'm expecting our solution to meet your expectations.

cmacknz commented 6 months ago

I think we can keep this open, compression is still something we could still do, but we did evaluate it and prefer other options in our initial work to reduce the disk footprint.

We found we could get similar results by compiling all of the Beats into a single binary, thus eliminating much of the code duplication. https://github.com/elastic/beats/pull/38183

I'm not going to confirm the exact savings we got from this and other changes until we're finished verifying that they didn't break anything unexpected, but the size reduction is significant.

Compression would lead to a further reduction for users who don't need to extract all of the compressed binaries, but we are going with the other changes first as they don't make the disk footprint dynamic or have any overhead at start up.