[SNMP4J] MultiThread dispatcher

Rodrigues, Rui 1. (NSN - PT/Amadora) rui.1.rodrigues at nsn.com
Wed Nov 9 09:11:21 CET 2011


Hello,

I used 20 threads in a 64 CPU server. I implemented with
MessageDispacherImpl and it's working. The processPDU only check if it's
a notif it's put in a queue and later processing by a threadpool with
the right order...
Thanks anyway.

Regards,
RAR

-----Original Message-----
From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
Behalf Of ext Frank Fock
Sent: Tuesday, November 08, 2011 5:35 PM
To: snmp4j at agentpp.org
Subject: Re: [SNMP4J] MultiThread dispatcher

Hi Ron,

If you need reliable ordering of incoming messages then you have to use
the regular MessageDispatcher which is MessageDispatcherImpl.

You will have to make sure then, that the calls to
CommandResponder.processPdu will not block the message dispatcher.

Do you have 20 cores in your server? You should not use more threads
than you have cores. I would expect that a single thread or only a 2-6
will provide the best performance. This depends mostly on the code
within the processPdu method implementation.

Best regards,
Frank


Am 08.11.2011 16:58, schrieb Rodrigues, Rui 1. (NSN - PT/Amadora):
> Hello,
>
> I'm using SNMP4J 1.11.2. I use one SNMP instance with multithread 
> dispatcher (thread pool 20). My manager can be connected to 1500 
> agents using snmpv3 over TCP.
>
> I checked that on some occasions, the notifications of a specific 
> agent can be processed in a different order that the one sent by the
agent.
> Below one can see an example of such a case. The threadpool name is 
> "SNMP Dispatcher".
>
> So from this example I can see that notification with sysupTime = 4 
> days, 0:09:55.97 has reached my manager before the other one with a 
> earlier time (4 days, 0:09:55.93). I can see also that each 
> notification reached my manager by a different thread (SNMP 
> Dispatcher.0, SNMP Dispatcher.1).
>
> The problem is that using an SNMP instance for each agent
> (singlethreaded) I can end up with thousands of threads that don't 
> work most of the time. It's a waste of resources.
>
> My questions:
>   -is there a way to avoid this issue? (beside using one snmp instance

> for each target)
>   - will the order be guaranteed in future releases (2.0) with some 
> mechanism that prevents the use of another thread of the pool when 
> already one thread is processing a notifications for a specific
target?
> Thanks
>
> REgards,
> RAR
>
> Example:
> 15:43:47,206 DEBUG SNMP Dispatcher.0 [SNMP] Processing PDU 
> TRAP[reqestID=955896469, errorStatus=0, errorIndex=0, 
> VBS[1.3.6.1.2.1.1.3.0 = 4 days, 0:09:55.97; 1.3.6.1.6.3.1.1.4.1.0 = 
> 1.3.6.1.4.1.28458.1.11.1.8.1; 1.3.6.1.4.1.28458.1.11.1.2.1.1.2.0 = 
> 9344; 1.3.6.1.4.1.28458.1.11.1.2.3.0 = 
> 07:db:0a:04:05:2f:2e:04:2b:00:00; 1.3.6.1.4.1.28458.1.11.1.2.2.0 = 2; 
> 1.3.6.1.4.1.28458.1.11.1.2.4.0 = 
> 1.3.6.1.4.1.28458.1.11.3.2.1.1.33.1.1; 1.3.6.1.4.1.28458.1.11.1.2.6.0 
> = 6; 1.3.6.1.4.1.28458.1.11.1.2.7.0 = ; 1.3.6.1.4.1.28458.1.11.1.2.8.0

> = Administrator; 1.3.6.1.4.1.28458.1.11.1.9.6.1.1 = 
> 6.10.254.21.109.5.56; 1.3.6.1.4.1.28458.1.11.1.2.9.0 = 1436; 
> 1.3.6.1.4.1.28458.1.11.1.2.10.0 = 2]]
> 15:43:47,222 DEBUG SNMP Dispatcher.1 [SNMP] Processing PDU 
> TRAP[reqestID=955896467, errorStatus=0, errorIndex=0, 
> VBS[1.3.6.1.2.1.1.3.0 = 4 days, 0:09:55.93; 1.3.6.1.6.3.1.1.4.1.0 = 
> 1.3.6.1.4.1.28458.1.11.1.8.1; 1.3.6.1.4.1.28458.1.11.1.2.1.1.2.0 = 
> 9342; 1.3.6.1.4.1.28458.1.11.1.2.3.0 = 
> 07:db:0a:04:05:2f:2e:04:2b:00:00; 1.3.6.1.4.1.28458.1.11.1.2.2.0 = 0; 
> 1.3.6.1.4.1.28458.1.11.1.2.4.0 = 
> 1.3.6.1.4.1.28458.1.11.3.2.1.1.19.1.1; 1.3.6.1.4.1.28458.1.11.1.2.6.0 
> = 0; 1.3.6.1.4.1.28458.1.11.1.2.7.0 = ; 1.3.6.1.4.1.28458.1.11.1.2.8.0

> = Administrator; 1.3.6.1.4.1.28458.1.11.1.9.6.1.1 = 
> 6.10.254.21.109.5.56; 1.3.6.1.4.1.28458.1.11.1.2.9.0 = 1436; 
> 1.3.6.1.4.1.28458.1.11.1.2.10.0 = 2]] 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

_______________________________________________
SNMP4J mailing list
SNMP4J at agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j



More information about the SNMP4J mailing list