Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pysnmp traps listener throughput #431

Open
atolikin94 opened this issue Dec 2, 2022 · 3 comments
Open

Pysnmp traps listener throughput #431

atolikin94 opened this issue Dec 2, 2022 · 3 comments

Comments

@atolikin94
Copy link

Hello!
I'd like to understand what is the throughput of pysnmp traps receiver. I made a couple of experiments and figured out that empty callback without any logic is able to receive ~75 t/s on my machine (btw don't know is it machine dependent or not, since from what I saw it's not CPU or anything else bound), which is quite small number. Is it possible to increase this number somehow? And what if there are, e.g., 1000 traps, or 10000 traps sent by devices at the same time - is there a buffer to keep those traps? If yes, what if the size of this buffer has been exceeded?

@lextm
Copy link

lextm commented Dec 2, 2022

PySNMP does not have a trap receiver, so you need to disclose more about your experiments, or that's just something wrong in your own code.

For your information, a simple trap receiver like this can easily handle 1,500-2,000 v1 trap message per second on my Mac mini M1 2020, and this sample is not even optimized (writing log entries to console and a file can slow it down significantly).

@atolikin94
Copy link
Author

Hi @lextm , thank you very much for such a quick response!
Actually I took similar example, but removed all inefficient logic from the callback, and got ~75 v2 t/s. Do you have any ideas why there is such a big difference?
Regarding a situation when a receiver gets more traps than it can process - will them be saved in some kind of a buffer, or will them be just dropped?

@lextm
Copy link

lextm commented Jan 19, 2023

I cannot comment further on the performance differences, as I don't have access to that specific test machine of yours.

About the situation you raised, the UDP packet buffer and how to drop packets when the buffer is full is controlled by the operating system (Windows or Linux for example).

If you really want a high performance agent to be built, then a pure Python approach like PySNMP might deprive you from the best as Python itself is slow. An SNMP implementation in C/C++ or another programming language should be considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants