Snmp-agent performance measurement


  1. In what situation that snmp-agent will be calling the “MultiThreadedMessageDispatcher” instead of “MessageDispatcher”? Is it configurable? Is it relying on the command such as snmpwalk vs snmpbulkwalk?

  2. I want to collect data on snmpbulkwalk request on snmp-agent side, basically its from receiving to returning. How can I collect such measurements? I enabled debug on org.snmp4j log, but it seems like it’s walk on each oid. I have about 455670 lines in the output file, ~16 minutes could be too slow(?). I want to get the break down on the query to check/identify the slowness. From the snmp-agent log, can I check if the snmpbulkwalk is sending the oids in a table in chunk or one by one?

Here is an example of my snmpbulkwalk cmd

$ time snmpbulkwalk -v2c -Cr1 -c public localhost > /tmp/1
real 15m57.816s
user 0m15.824s
sys 0m16.656s


  1. The MultiThreadedMessageDispatcher has to be configured. It will provide benefits only in special cases. For standard usage, the standard MessageDispatcherImpl is faster/more efficient.

  2. To collect message processing statistics, you can use set the SNMP4JSettings.setSnmp4jStatistics method to activate performance measurement collection.

With logging activated, you will not get any valuable performance data!

When requesting a single OID, a GET BULK operation (WALK is not a SNMP operation!) will not collect data in tabular form! Thus, maybe you should rethink your performance measure task in order to be sure, that you measure relevant use cases?

Thanks Frank. When enabling Snmp4jStatistic.extended, does it write to a file? or where I can find the information? Do I need to enable anything on the logger? Is setting logger debug enough?

You need to collect the data from the associated Snmp.getCounterSupport() object yourself by adding your own CounterListener.
This isn’t very convenient but works very well in a generic way. You can find the counter OIDs for the performance counters in the SnmpConstants class.