Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

envoy binary file size - currently 127MB #240

Closed
ramtej opened this issue Nov 22, 2016 · 7 comments
Closed

envoy binary file size - currently 127MB #240

ramtej opened this issue Nov 22, 2016 · 7 comments
Labels
question Questions that are neither investigations, bugs, nor enhancements
Milestone

Comments

@ramtej
Copy link

ramtej commented Nov 22, 2016

Hi guys,

I;m thinking about to use envoy in a kubernetes setup.

One of the challenges in such a setup is to keep the docker / rtk container image size small and therefore I was a bit surprised that the envoy binary is about 127 MB.

However, I was able to "shrink" the binary down to about 8 MB using the ELF "strip" approach :

/tmp$ strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag envoy

-rwxr-xr-x 1 jj jj 127M Nov 22 20:17 envoy.orig
-rwxr-xr-x 1 jj jj 7,7M Nov 22 20:18 envoy

The question is, what makes the binary such large ?

Thank you.

Cheers,
jj

@mattklein123
Copy link
Member

The default build includes debug symbols and is statically linked. If you strip symbols that's what takes you down to 8MB or so. If you want to go down further than that you should dynamically link against system libraries.

FWIW, we haven't really focused very much on the build/package/install side of things. I'm hoping the community can help out there. Different deployments are going to need different kinds of compiles.

@mattklein123 mattklein123 added the question Questions that are neither investigations, bugs, nor enhancements label Nov 22, 2016
@mattklein123
Copy link
Member

cc @enricoschiattarella @louiscryan I think you are already probably thinking about ^^^ not sure if you have any thoughts.

@ramtej
Copy link
Author

ramtej commented Nov 22, 2016

Hi Matt,

thank you for your feedback !

Agree, different deployment scenarios has different requirements. I also like the static linking approach, to keep things consistent and independent.

At least for my usecase the "strip" approach fine, but evtl. a kind of "included" solution will be better.

Cheers,
jj

@moderation
Copy link
Contributor

I think statically linked is important as if you wanted to run in a Docker container you could in theory create a minimal image using from scratch. I haven't tested this yet.

@ramtej
Copy link
Author

ramtej commented Nov 22, 2016

yes, this is exactly what I;m doing and therefore the dynamic approach will not work. Also such a critical component should be self-contained.

@mattklein123
Copy link
Member

At the very least we can put in a cmake option to strip debug symbols. That is easy to do.

@mattklein123
Copy link
Member

fixed

rshriram pushed a commit to rshriram/envoy that referenced this issue Oct 30, 2018
* HTTP override fix

* Code clean up and fix a test.

* Address code review comments.

* Code comment.

* Style formatting
jpsim pushed a commit that referenced this issue Nov 28, 2022
envoyproxy/envoy-mobile#119

Adding a primitive `Request` and `RequestBuilder` with basic features:
* URL
* method
* headers
* trailers
* retry policy

Tests are basic setting a builder and ensuring the result is expected. Additionally, the request build transform creates an equivalent object when built back.

Signed-off-by: Alan Chiu <achiu@lyft.com>

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: kotlin: add library request interfaces
Risk Level: low
Testing: unit
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
envoyproxy/envoy-mobile#119

Adding a primitive `Request` and `RequestBuilder` with basic features:
* URL
* method
* headers
* trailers
* retry policy

Tests are basic setting a builder and ensuring the result is expected. Additionally, the request build transform creates an equivalent object when built back.

Signed-off-by: Alan Chiu <achiu@lyft.com>

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: kotlin: add library request interfaces
Risk Level: low
Testing: unit
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that are neither investigations, bugs, nor enhancements
Projects
None yet
Development

No branches or pull requests

3 participants