Speed of pysnmp

Ilya Etingof ilya at glas.net
Tue Jul 13 10:55:25 CEST 2004

Anthony Baxter <anthonybaxter at gmail.com> wrote:

[ skipped ]

>>From past, bitter experience, I can say that you can make a massive
> massive difference in any SNMP application by carefully constructing 
> your getnext packets - don't just get things one at a time. Do some 
> rough calculations on how many entries you can fit in a packet, and 
> getnext multiple things at once. If you're walking a table of more than
> one column, start at the top of each column and getnext in parallel. 

[ skipped ]

A variation of this method would be to use GETBULK PDU of SNMP v2c
wnenever available at your management target to save on 1) round-trip time
2) SNMP message build/parse expenses. Here's what I got doing IF-MIB table

# pysnmp
[ilya at cray ~]$ /usr/bin/time pysnmpbulkwalk wrt -c public . > /dev/null
1.13user 0.02system 0:01.35elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (667major+409minor)pagefaults 0swaps

[ilya at cray ~]$ /usr/bin/time pysnmpwalk wrt -c public . > /dev/null
2.39user 0.04system 0:05.93elapsed 40%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (667major+368minor)pagefaults 0swaps

# net-snmp
[ilya at cray ~]$ /usr/bin/time snmpbulkwalk -On -v2c -c public wrt . > /dev/null
0.07user 0.02system 0:00.50elapsed 17%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (404major+125minor)pagefaults 0swaps

[ilya at cray ~]$ /usr/bin/time snmpwalk -On -v1 -c public wrt . > /dev/null
0.06user 0.01system 0:02.68elapsed 2%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (404major+122minor)pagefaults 0swaps


More information about the Python-list mailing list