envoyproxy / envoyproxy/envoy

envoy.gzip compression performance is poor

Open
#8,448 69 comments 8 reactions 0 assignees View on GitHub
area/perf bug help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

*Description*:

Hello! 👋

We recently realised our outbound traffic had increased a fair amount sinced we switched from serving some assets directly from Akamai to serving them from Ambassador, and traced it down to our gzipped assets being much larger.

I then ran some tests, and it appears that gzipping content in Envoy results in fairly poor compression results, even when tweaking the settings to produce the smallest possible output.

For example, when gzipping html & js from Youtube (picked as a random "big website" example), Envoy-compressed html is 12% larger than nginx and js is 13% larger.

This isn't nginx-specific either: I've tested gzip locally, Apache httpd, and nginx, and all of their results are within a few percents of each other while Envoy is consistently over 10% larger.

*Relevant Links*:

Here is my testing methodology: https://github.com/Pluies/gzip-comparison

And the relevant Envoy configuration files are:
- https://github.com/Pluies/gzip-comparison/blob/master/envoy.yaml (gzip defaults, not optimised)
- https://github.com/Pluies/gzip-comparison/blob/master/envoy-optimised.yaml (optimised with BEST setting, max memory setting, max memory window)

Is this a known issue? Is there a problem with my configuration? I'm by no means an Envoy expert, so please let me know if there's any obvious issues with the config above or anything else I've missed that might explain this discrepancy.

Thanks a lot!
- Florent

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.