Subject: Re: udp receive buffer overflow with many small packets
To: Jason Thorpe <thorpej@shagadelic.org>
From: Stuart Brooks <stuartb@cat.co.za>
List: tech-net
Date: 04/25/2005 08:54:58
> > On Thu, 21 Apr 2005, Stuart Brooks wrote:
> >
> >> I get exactly the same thing on Netbsd 2.0. If I send 170 packets,
> >> 164
> >> get through and netstat -s shows 6 more udp packets dropped due to
> >> full
> >> socket buffers. The packets are 88 bytes each, but increasing the
> >> size
> >> (within reason) makes no difference. eg 200B/packet also yields an
> >> overflow after 164 packets.
> >>
> >
> > UDP... I think there was some checksum problem reported/discussed
> > lately,
> > dunno if that's related. Can you try -current?
>
> He said "dropped due to full socket buffer".
>
> Stuart -- increase SO_RCVBUF.

This worked, doubling the size of the receive buffer doubled the number
of message which could be queued. Looking at the numbers, the default
receive buffer of around 42kB is roughly 162 messages*256B.

What had me confused initially was that the FIONREAD ioctl was saying
that the receive buffer had 16kB of data when it started throwing away
packets. Of course, this is 16kB of *user data* (because of small
packets) but the rest of the space is being used behind the scenes
(because of 256B mbufs?).

Thanks for all of the help,
 Stuart