I'm developing some application that shall monitor some data in real time. The application shall collect data from the network, parse the relevant packets from my protocol and store it to the database.

When I start the application - everything seems to be OK, but then lags are starting to appear few seconds after that.

Checking my database, it seems that some data is not saved while others does stored (I'm using packet player to inject packets on my PC. Verifying with Wireshark, all the data which has is there ). The data is stored into several tables, and all of the tables have same issue and therefore I'm suspicious on scapy.

Checking the Wireshark statistics, I have about 200 packets per second.

Is there someway to improve the performance of it?

I'm using sniff(iface="Working", filter = "port 52000", prn=my_parsing_func, store = false) command

PS - I'm using win 10 OS, python 3.7.4

  • You need to profile your application to see where the bottleneck is. Most likely it is your writing to database. After finding out the bottleneck, you need to concentrate on improving that part. Oct 16 '21 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.