My 2 cents.
1. pin your capture thread to one specified CPU core is important, try
numactl -N netdev:eth0 -m netdev:eth0 your_program
or manually figure out which CPU core you want to use
sched_setaffinity() do the same work programingly.
2. use `ethtool -G` command to change to a larger rx ring size
3. don't expect to reach 1GB/s at normal 1.5k packet size, 4k is a
minimal
4. try a better 10GbE card with better driver
5. use recvmmsg() instead of recv() to receive more than 1 packets in a
single system call
6. try both BLOCK and NONBLOCK recv() mode to choose better one
zhuyan
------ Original Message ------
From: "Marc Welz" <m...@ska.ac.za>
To: "Louis P. Dartez" <louisdar...@gmail.com>
Cc: "casper list" <casper@lists.berkeley.edu>
Sent: 2016-06-30 3:40:35 PM
Subject: Re: [casper] packet capture
There are a number of things to look at:
- the content of /proc/sys/net/*/*rmem*
- various sheduling priorities
- the network driver (and card) - some are better than others, and
many have options to tweak things
- how bursty your traffic from the roach is
- the locking strategy of your code (you might be waiting
unproductively for a lock)
- and maybe CPU affinities ?
And if you can, measure and profile your execution path
regards
marc
On Thu, Jun 30, 2016 at 4:58 AM, Louis P. Dartez
<louisdar...@gmail.com> wrote:
Hi all,
Can anyone guide me on what tools are being used for packet capture
purposes
right now? I’ve been working on a baseband recorder using a ROACH1
using the
10GbE lines but I can’t seem to avoid losing packets when writing
data to
memory or disk. I wrote a threaded packet sniffer in C with a pretty
tight
loop that write directly to memory in Ubuntu Linux. I’m wondering if
there
are any optimizations that I could be missing out.
Any advice would be greatly appreciated, Thanks in advance!
LD
Louis P. Dartez
Ph.D. Candidate
STARGATE
Center for Advanced Radio Astronomy
University of Texas Rio Grande Valley
(956) 372-5812