-
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
Improve speed of snmp plugin loading #5720
Comments
This is also an issue for the snmp_trap input: #4377 (comment) |
The gosmi project has native parsing of MIBs now: https://github.com/sleepinggenius2/gosmi, this could potentially be a way to address. |
Indeed, I also mentioned this library for #6330 |
I did a real quick and dirty implementation of gosmi for the snmp_trap plugin (I needed it for my case, snmptranslate was too slow and Telegraf was pinned at 100% CPU). https://github.com/loganmc10/telegraf/commit/b019c8891ca8afdc98b1251f4a4cddd2ee01b6ce I'm not really a Go programmer so I don't feel too comfortable bringing this all the way to a PR, but hopefully that commit can be helpful to someone that wants to submit a PR. The performance difference is quite dramatic, I was pinned at 100% CPU before, now Telegraf is at about 1% CPU usage... |
Hi @loganmc10, thanks for sharing your work with gosmi and Telegraf. If you're not really a Go programmer you're doing a good job of faking it. I understand that you don't feel comfortable working through the PR process to get your work merged into telegraf. If you are ok with someone starting from your branch and improving it and getting it reviewed and merged into Telegraf, would you be able to submit it as a PR? Even though it looks like you've already signed the Telegraf CLA, I don't think we're allowed to take code from your branch unless you submit it as a PR. You could mention in the PR description that you're not able to make more changes and that someone else should take it over. Thanks! |
Sure: #9307 anyone has my permission to edit/modify/improve as needed |
Feature Request
Proposal:
Current behavior:
For each plugin, snmptranslate is called on each field, information is not shared between plugin instances.
Desired behavior:
Add a shared cache for loading SNMP MIB data to improve the startup speed when using large tables, many fields, or many plugins. Use more efficient lookup strategy, perhaps
snmptranslate -Tso -m <mib-file>
to avoid loading the cache file multiple times.When Telegraf is reloaded, the cache should be cleared and rebuilt.
Use case:
Currently Telegraf can be very slow loading SNMP inputs, in some cases taking up to 10 minutes. This is made worse when you have large MIB files.
The text was updated successfully, but these errors were encountered: