Comments (8)
Which Snimpy version are you using? Are you using SNMPv2 or SNMPv3? Is the threadpool reusing threads or just spawning new ones?
from snimpy.
I updated the version of snimpy from 0.8.2 to 0.8.8 serveral hours ago.
SNMPv2c.
The threadpool reusing threads.
from snimpy.
I have to update the information I provided:
The number of open udp ports does not increase again. I'm not sure whether the upgrade of snimpy causes it.
What's more: I have 100 worker thread and now I have 100 open port. Maybe there is some relation between the two number?
from snimpy.
Before 0.8.6, Snimpy was reinitializing the whole SNMP stack for each manager. I am not surprised that it could have been the source of your problem. Now, Snimpy does this initialization only once per thread. So, it is expected that you have one open port for each thread (is that a problem for you?).
from snimpy.
It's a problem but not so serious.
Is it possible to release unused port? After all, fd is limited.
from snimpy.
As I can see, manually releasing resource is also acceptable.
from snimpy.
It's possible but it's conflicting with another bug. Snimpy relies on PySNMP. It uses some high level interface ("command generator"). This high level interface is not thread safe, so we need one instance of it in each thread. However, initializing this interface is memory and CPU-hungry. Moreover, it seems that it's not possible to reclaim all the resources that were allocated (hence the leak you observed, plus the memory leak in #33). So, I don't see a way around that.
The default FD limit is 1024, so with 100, you seem to be safe.
Otherwise, maybe you can use a dedicated (smaller) threadpool for SNMP?
In the future, I may switch back to NetSNMP because of bugs like this (notably, for SNMPv3 where I need a command generator for each manager) but also for performance.
from snimpy.
Well, thanks for your graceful contribution. I will continue to keep sight
over snimpy.
On Sun, Jan 17, 2016, 8:20 PM Vincent Bernat [email protected]
wrote:
It's possible but it's conflicting with another bug. Snimpy relies on
PySNMP. It uses some high level interface ("command generator"). This high
level interface is not thread safe, so we need one instance of it in each
thread. However, initializing this interface is memory and CPU-hungry.
Moreover, it seems that it's not possible to reclaim all the resources that
were allocated (hence the leak you observed, plus the memory leak in #33
#33). So, I don't see a
way to do that.The default FD limit is 1024, so with 100, you seem to be safe.
Otherwise, maybe you can use a dedicated (smaller) threadpool for SNMP?
In the future, I may switch back to NetSNMP because of bugs like this
(notably, for SNMPv3 where I need a command generator for each manager) but
also for performance.—
Reply to this email directly or view it on GitHub
#48 (comment)
.
from snimpy.
Related Issues (20)
- PMPP support? HOT 4
- snimpy/manager.py broken in Python 3.7
- how do I get an OID from a MIB node ? HOT 5
- How to get KEEPALIVED-MIB::vrrpSyncGroupState HOT 8
- print(mgr.fgVpnTunEntPhase1Name.items()) produces "snimpy.snmp.SNMPNoSuchInstance: No such instance exists" HOT 3
- BGP4-V2-MIB-JUNIPER, take 2
- Use the native Python ipaddress types HOT 4
- SNMP Community Strings greater than 32 characters crash HOT 2
- Confusing example in documentation HOT 1
- Return the pretty name from a referenced OID HOT 5
- Deprecation warning: snimpy not compatible with upcoming Python 3.10 HOT 2
- use unittest.mock instead of mock HOT 1
- Installation snimpy error on AlmaLinux 8.6 HOT 11
- Add how to add an new MIB path into the documentation HOT 1
- Migrate from unsupported pysnmp to pysnmp-lexstudio
- Publish a new release HOT 1
- testMultipleThreads failed HOT 2
- TestMain::test_loadfile gets stuck in 2038 HOT 4
- [HOW TO] walk over multiple node with manager?
- Occasional stucks with snimpy 1.0.2, working with 1.0.0 HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snimpy.