PySNMP Thread unsafe?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rob.audenaerde@gmail.com

    #1

    PySNMP Thread unsafe?

    I'm trying to monitor about 250 devices with SNMP, using PySNMP version
    4. I use the threading.Threa d to create a threadpool of 10 threads, so
    devices not responding won't slow down the monitoring process too much.


    Here comes my problem. When using PySNMP single threaded, every this
    goes well; but if I create 10 threads, it all goes awry... It seems
    PySNMP is not thread safe? Can anyone elaborate on this?

  • Chris Lambacher

    #2
    Re: PySNMP Thread unsafe?

    On Mon, Jul 24, 2006 at 02:21:10AM -0700, rob.audenaerde@ gmail.com wrote:
    I'm trying to monitor about 250 devices with SNMP, using PySNMP version
    4. I use the threading.Threa d to create a threadpool of 10 threads, so
    devices not responding won't slow down the monitoring process too much.
    >
    >
    Here comes my problem. When using PySNMP single threaded, every this
    goes well; but if I create 10 threads, it all goes awry... It seems
    PySNMP is not thread safe? Can anyone elaborate on this?
    What does 'goes awry' mean? Your statement is too vague to be able to help
    you figure out your problem.

    Comment

    • etingof@gmail.com

      #3
      Re: PySNMP Thread unsafe?

      pysnmp has been designed to be MT-safe. Although, I've never used it in
      a MT app, so there may be a bug showing up when you do threading...

      At its simplest, I'd advise snooping on the wire to make sure you are
      querying different devices at the same time and also to see where the
      [I assume] bottleneck really is -- is it in a sending or receiving
      phase of the query.

      If you could show me the code that causes the trouble?

      rob.audenaerde@ gmail.com писал(а):
      I'm trying to monitor about 250 devices with SNMP, using PySNMP version
      4. I use the threading.Threa d to create a threadpool of 10 threads, so
      devices not responding won't slow down the monitoring process too much.
      >
      >
      Here comes my problem. When using PySNMP single threaded, every this
      goes well; but if I create 10 threads, it all goes awry... It seems
      PySNMP is not thread safe? Can anyone elaborate on this?

      Comment

      • Nick Craig-Wood

        #4
        Re: PySNMP Thread unsafe?

        rob.audenaerde@ gmail.com <rob.audenaerde @gmail.comwrote :
        I'm trying to monitor about 250 devices with SNMP, using PySNMP version
        4. I use the threading.Threa d to create a threadpool of 10 threads, so
        devices not responding won't slow down the monitoring process too
        much.
        This is surely a job for twisted not threads? You'd be able to poll
        all 250 devices at once with twisted...

        This might be helpful (haven't tried it myself though)



        --
        Nick Craig-Wood <nick@craig-wood.com-- http://www.craig-wood.com/nick

        Comment

        Working...