golang / snappy

The Snappy compression format in the Go programming language.
BSD 3-Clause "New" or "Revised" License
1.52k stars 163 forks source link

High Memory Usage: Snappy Encoding #76

Open Kaushal28 opened 7 months ago

Kaushal28 commented 7 months ago

I have an application which writes large volume of data to Victoria Metrics using prometheus remote write API. The API specs requires compressing the data being written using snappy encoding. When I do memory profile of my application, the snappy encoding alone is using ~900MB of memory.

This is problematic because I process data in real time using multiple replicas of my application and then write the processed data to Victoria Metrics. So the total memory usage by all replicas becomes too high.

A similar issue, where snappy decode is consuming high memory in prometheus: https://github.com/prometheus/prometheus/issues/13174

image