-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Build: Reduce Binary Size by excluding Plugins #9556
Comments
Hello! I recommend posting this question in our Community Slack or Community Page, we have a lot of talented community members there who could help answer your question more quickly. |
As you noticed, there isn't a way to build Telegraf with a subset of plugins with the makefile at the moment. I do think this would be a good feature to have so I've added the Commenting out the plugins as you did in the |
Thanks for your reply! I managed to further reduce the size to 34M and 16M without any plugins. It is still too much but I guess there is nothing else I can do now. |
do you mind sharing what device you are trying to load telegraf on? |
I'm developing currently on the raspberry pi 3 model B, where I do not have any memory restrictions, but I would love to run telegraf on our other routers, which are mostly TP-Link Archer C7 AC1750 v2 with about 16M flash memory. Btw. I found the tool upx and could achieve a 6M binary (with excluded debug symbols and plugins), but it might not be possible with the compressed squashfs. I will need to test that. I linked some sources in the openwrt forum if you are interessted. |
Reference below issues: - influxdata#9556 - https://github.com/openwrt/packages/pull/16238/files
In addition to code space they also contribute to more stuff in the sample configuration file. That's lines of text 99% of people don't need so IMO it's just noise. I think that's another reason to migrate these out by externalizing them over time. If you decide that it isn't worth doing this right now that's probably fine, but if there are any changes to these seldom-used plugins then encouraging them to go external is something I definitely support. |
Hi,
I'm trying to build small telegraf binary versions for using them on embeded systems like routers with only less memory.
Because I didn't found a way in the Makefile to exclude plugins, I uncomment them in
plugins/{input,output}/all/all.go
.I managed to reduce size to 75MB.
Than I started to look at
plugins/processors/all/all.go
but wasn't sure what is safe to exclude here.My questions are:
Thanks in advance!
The text was updated successfully, but these errors were encountered: