Score:0

speedup scapy execution - packet sniffing

sy flag

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

us flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.