On some test infrastructure, netsniff-ng is used to write captured frames on a FIFO instead of using a file system.
In capture mode, the function pcap_write() is called for each packet. In it there are 2 write() syscalls.
Whereas on a file system write() quickly accesses a mmap'ed buffer, the operation on a FIFO takes much longer which lead to a bottleneck.
To solve this bottleneck, using scatter/gather I/O seems to be best candidate.
The packet processing function would prepare a set of I/O vectors. When all vectors are ready or before polling, a writev() would be triggered to write all data on the file descriptor in one syscall.
This should also improve I/O performance on classic file system.
All development related to this issue will be done in the feature branch called _scatter_gatherio
On some test infrastructure, netsniff-ng is used to write captured frames on a FIFO instead of using a file system.
In capture mode, the function
pcap_write()
is called for each packet. In it there are 2write()
syscalls. Whereas on a file systemwrite()
quickly accesses a mmap'ed buffer, the operation on a FIFO takes much longer which lead to a bottleneck.To solve this bottleneck, using scatter/gather I/O seems to be best candidate. The packet processing function would prepare a set of I/O vectors. When all vectors are ready or before polling, a
writev()
would be triggered to write all data on the file descriptor in one syscall.This should also improve I/O performance on classic file system.
All development related to this issue will be done in the feature branch called _scatter_gatherio