One Snmp object for concurrent environment

Hello,

Topic One Snmp object to request group of devices - #2 by AGENTPP says it’s correct to use one Snmp object for requesting different devices with different snmp versions.

But does it work good in concurrent environment, when we have a giant group of such requests?

Thanks!

Yes, of course it depends on the quantification of “giant”.

The main place is interesting for me is ListenThread implements WorkerTask.
snmp.listen() starts ListenThread and inside run method of it socket receives packages: socketCopy.receive(packet).

If we speak about one Snmp object for concurrent environment/app:

  1. Do we have ability to plan when socketCopy.receive(packet) become (if become) a bottleneck?
  2. Other potential places to be bottleneck candidates in such architecture?

Regards.

Before the Socket becomes the bottleneck, usually the code that processes the data in the application gets performance issues.
Before that, however, the UDP buffer of the OS could get flooded and then you will loose packets there.
Then it is time to increase the buffer or use more different sockets. But in any case, you can use a single Snmp instance with several transport mappings.
Then you can use the MultiThreadedMessageDispatcher to distribute the dispatching load to several CPUs.
Before you actually need that, using multiple threads is always an overhead and reduces performance.