packet drop with intel gigabit / marwell gigabit

Jin Guojun [VFFS] j_guojun at
Sun Apr 9 04:16:33 UTC 2006

For this situation, you can run "netstat -m" to see if there is mbuf outage.
Attached is a shell script to watch mbuf usage in 1 second interval.
If you see the maximum-used (peak) count reach (or close) to the "max",
and the cur count changes dramatically during your test,  you then may have
memory issue.
If you do not see such memory problem, then you need to prepare to use
following tools together to do the diagnose:

    tcpdump (tcpdpriv if you do not want to give out your IP info.)
    iperf or netest
    show-mbuf script

Let me know what show-mbuf says.


OxY wrote:

> hi!
> unfortunately i couldn't accept the situation, so i did further tests..
> i noticed a weird thing:
> after reboot i have about 0,2-0,5% loss (with apache), but after
> 20-30mins i got 3-4-6%, depending on the traffic of fxp0 and apache..
> when i stop apache it falls back to 0,1-0,2%, starting apache again 
> and got
> 3-4-6% immediately..
> seems like a buffer or cache is full (maybe vm cache, or something 
> about memory?)
> i think 700MB/s memory bandwith ought to be enough and it seems it is...
> answering you questions in order:
> when apache runs (or any other process which needs resource) i got 
> loss on em0 even
> with 100mbit test on udp test without any I/O...

-------------- next part --------------
RVer=`uname -r | awk -F. '{printf("%d%2d", $1, $2)}'`
if [ $RVer -eq 501 ];	then	# Probably for 5.1-R at 2004/03 ?
	DoNetstat="'/Total/ {print \$2; exit}' | awk -F/ '{print \$1}'"
	case "$1" in
	-c)	who="clusters in use"	;;
	*)	who="mbufs in use"	;;
	DoStat="/$who/ {print \$1}"

netstat -m
echo	"last  cur  maximum-used (peak)"
while [ 0 ];	do
	cur=`netstat -m | awk $DeLiminator "$DoStat"`
	[ $maxm -lt $cur ] &&	maxm=$cur
	echo $last $cur $maxm | awk '$1 != $2 {printf("\r%3d %5d %7d   ", $1, $2, $3)}'
	sleep 1

More information about the freebsd-performance mailing list