Snmptable vs snmpwalk performance

Hey everyone, new to influx and telegraf!

I have a question regarding the performance of collecting an snmptable where we only care about a subset of fields. For the most extreme example, there are a few deprecated fields in the ifTable (ifOutNUcastPkts, ifOutQLen, ifSpecific) which we would like to not persist to Prometheus or store in memory. I am wondering if it is more efficient to simply namedrop the metrics as a part of the input or pull the MIBs for the specific fields as a part of the ifTable.

I believe this is directly related to SNMP plugin GET for multiple values at once · Issue #3784 · influxdata/telegraf · GitHub, but it is still unclear to me whether it is more performant to individually snmpwalk fields of a table or to pull the entire table and namedrop the unneeded metrics downstream.

Option 1:

  [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = ["hostname"]
    oid = "IF-MIB::ifTable"

namedrop = ["interface_ifOutQLen", ...]

Option 2:

  [[inputs.snmp.table]]
    name = "interface"
    inherit_tags = ["hostname"]

    [[inputs.snmp.table.fields]]
      oid = "IF-MIB::ifAdminStatus" 
      name = "ifAdminStatus" 

    [[inputs.snmp.table.field]]
      oid = "IF-MIB::ifOperStatus" 
      name = "ifOperStatus"   

   ......other fields not including ifOutQLen, etc.....

Is either one of these approaches the ‘standard’? I assume we may want to pull the entire table in this case, and maybe implement Option 2 when we want to omit over half the metrics of a specific table?

Hello @akattuparambil,
I’m not entirely sure but I believe you want to go with option 2.
@jpowers will be able to confirm.
Thanks :slight_smile:

I have a limited understanding of all the specifics of SNMP, but while either approach would work, when it comes to performance the biggest issue will be how fast your device can respond to requests.

In your case you should ask yourself how large the table is versus how many of the columns do you actually want? If you find yourself dropping most of the columns then it probably makes sense to only go after a few select fields, while if you are only dropping one or two columns, then maybe go after the full table.

This is briefly touched on in this blog post: Telegraf Best Practices: SNMP Plugin | InfluxData

1 Like