I am trying to parse huge .pcap files (~1-2GB each). I have tried to use scapy but so far it is much to slow. I have benchmarked timings using the following code with different values for count
from scapy.all import *
from scapy.layers.dns import DNSRR, DNS, DNSQR
import time
t0 = time.time()
pcap = 'output.pcap'
pkts = rdpcap(pcap, count=1000000)
t1 = time.time()
print(t1-t0)
It seems rdpcap() can only handle about 800 packets / second. Are there any optimizations for scapy, other tools, or good ways of scaling this process? Each packet is supposed to be DNS.