[SNMP4J] Safely executing TreeUtils.getSubtree in concurrent threads
Frank Fock
fock at agentpp.com
Thu Jun 19 20:43:33 CEST 2014
Hi Nigel,
On Ubuntu I suspect that the agent is a NET-SNMP agent. It is then NOT
multi-threaded.
Thus, you will get worse performance than expected if you concurrently
access the same
agent with multiple-threads.
Best regards,
Frank
Am 19.06.2014 20:41, schrieb Nigel Thomas:
> Frank
>
> The client is mine. There is no separate agent - I am directly
> addressing snmpd in ubuntu (on localhost at present, though eventually
> it will be monitoring a distributed application running on a handful
> of local servers). Traffic level should be reasonable - polling
> hrStorageTable and hrSWRunTable every 30 seconds.
>
> I will investigate timeout changes tomorrow. Thanks and any more
> suggestions always welcome
>
> Regards Nigel
>
>
>
>
> On 19 June 2014 19:30, Frank Fock <fock at agentpp.com
> <mailto:fock at agentpp.com>> wrote:
>
> Hi Nigel,
>
> Your setup is absolutely fine and the recommended one for that task.
> Have you checked that the agent isn't the problem?
> Agents (except AGENT++ and SNMP4J-Agent based) are often single
> threaded and many do not implement thread safe lexicographic ordering
> correctly.
>
> Also check the timeout values, because the agent will need more than
> twice the time if polled concurrently from two threads (if not
> multi-threaded).
>
> Best regards,
> Frank
>
> Am 19.06.2014 19:32, schrieb Nigel Thomas:
>
> Hi
>
> I have a system with multiple threads getting different SNMP
> subtrees from
> the same target server concurrently using
> TreeUtils.getSubtree. One thread
> alone seems to work exactly as expected, but when a second
> thread starts up
> the two get confused; the first table receives no data.
>
> Clearly I am having some sort of thread safety problem - but
> with which
> object/method? I am using
> - a singleton instance of Snmp
> - a single instance of CommunityTarget (for each monitored
> server -
> currently just localhost)
> - therefore a single instance of TransportMapping - a
> DefaultUdpTransportMapping; I have tried
> setAsyncMsgProcessingSupported(true)
> - a separate instance of TreeUtils per thread
> - SNMPv2
> - snmp4j-2.3.0
>
> Any thoughts would be very welcome
>
> TIA
>
> Nigel
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org <mailto:SNMP4J at agentpp.org>
> https://oosnmp.net/mailman/listinfo/snmp4j
>
>
> --
> ---
> AGENT++
> Maximilian-Kolbe-Str. 10
> 73257 Koengen, Germany
> https://agentpp.com
> Phone: +49 7024 8688230 <tel:%2B49%207024%208688230>
> Fax: +49 7024 8688231 <tel:%2B49%207024%208688231>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org <mailto:SNMP4J at agentpp.org>
> https://oosnmp.net/mailman/listinfo/snmp4j
>
>
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
More information about the SNMP4J
mailing list