-
Notifications
You must be signed in to change notification settings - Fork 883
coder
binary is too big
#3593
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
Comments
This came up in #2534 (comment) as well, i.e. we currently don't upload "slim" binaries in our releases -- should we? The slim binaries are still pretty big though, weighing in at 40-50MB. We already strip debug information from them (via One last thing I can think of is to pack binaries with UPX. Unfortunately, Windows AARCH64 doesn't seem to be supported yet (upx/upx#502, upx/upx#551):
We could apply this principle to the whole build pipeline. Original build:
UPX only the "fat" binary:
Everything built with UPX (skipping Windows AARCH64):
The result is pretty interesting because Zstd does a better job on uncompressed binaries, UPX adds 10MB bloat to the Zstd archive, even with the missing Windows AARCH64 binary. But then again, in the UPX-ified slim case, we would save ~30MB/binary in the coder cache directory, where slim binaries are extracted to. |
Forgot to mention in my previous response, but regarding:
Interestingly, the agent binary is already plenty small due to the bootstrap script doing Surprisingly, on my local network the result is not at all what I would expect:
I.e. the overhead from compression makes it slower, even though the size is much smaller (16.5M @ 0.43s vs 43.4M @ 0.02s). But this would be negligible on a slower network and UPX packing will only save us ~4M in transfer size. |
Out of interest, did one more test to break out the This brought the binary size down from I do like the simplicity of our all-in-one binary, but for size reduction, it's an avenue we could consider pursuing (if we want to prioritize workspace bootstrap speed). |
It makes sense to me to ship a stripped agent binary and, in general, watch the size of that binary due to its effect on workspace start times. |
I've done some more testing around the use of UPX, and there's an unfortunate side-effect: it adds around 0.5 - 1.5s extra start-up time (e.g. Even in it's lowest setting (
With regards to the original issue: There are problems with separating the
Or, if we don't want to break the above use-cases, we'll need to ship both As I see it, the best thing we can do without creating a worse experience for most users, is to provide an easy way to install and setup coder with only "slim" binaries. This would mean:
The 2i and 3 are kind of mutually exclusive, if our releases contain One more thing we can do is to not have the "fat" binary decompress "slim" binaries to the filesystem. This would decrease filesystem storage by ~300MB whilst the "fat" There's quite a lot of musings here now, so I'll try to distill this all down into a proposal for how to take this forward, but in the meantime, input is welcome. |
I think we shouldn't strip binaries of debug information or we will regret it when customers run into problems. Related to #3188 |
@deansheather I agree, and that hasn't been suggested here. Currently we already use For reference:
Good point to reference #3188 👍🏻. It would be interesting to explore how much, if any, savings/binary can be had by separating the server. |
I think we should close this for now. It seems like a non-trivial level of effort, and awaiting more feedback would be nice. |
@kylecarbs One simple step we could take is to extend the build pipe-line to publish the following additional assets:
I.e. split out the big binary. This would ~half the size of the binary (and hopefully help with the original issue). We don't necessarily have to do it for every platform/binary either. We could just always do it for apk/dep/rpm. There's really no need to bundle them in those cases when it's already "one file". The downsides are that we would either duplicate all our release binaries or we'd introduce inconsistency where some releases use the split, whereas others don't. |
A user reported that the 80MB binary size is a turn-off because they use tools like Carbon Black and Sentinel that constantly scan it, which "adds a lot of milliseconds to [their] execution time".
Also, the smaller we make the binary, the more quickly workspaces start.
The text was updated successfully, but these errors were encountered: