Tue Oct 26 14:34:48 2004 36880: write UDPv4 []: No buffer space available (code=105)

Increase the required free memory. I recommend at least 2 MB, which you can set with:

echo 2048 >/proc/sys/vm/min_free_kbytes

If you don't bump it up, the min_free_kbytes value for 2.6 kernels gets set to something pitifully small, giving the kernel essentially no incentive to reclaim memory that's no longer used. You can watch your free memory gradually decline by running free or vmstatperiodically - once per hour or so.

You can kick the kernel into freeing memory by running something that allocates a lot of memory, something like hdparm -tT /dev/hda. Apparently when servicing userspace requests for memory, the kernel can free unused memory if it doesn't have enough, but when servicing interrupts caused by events like packet arrivals it needs to have enough memory free before the interrupt. (I'm unsure of this explanation, but it seems to make sense and agrees with what I've observed happening.)

I set min_free_kbytes to 8 MB on my servers, which have lots of RAM. The (2.6.6) system I use for my OpenVPN tunnel at home has only 64 MB of RAM, so I use 2 MB for its min_free_kbytes. Its current uptime is 110 days.

Most of the time, the kernel will actually keep quite a bit more memory free than the minimum specified, so don't specifiy too large a value.

Dick St.Peters

Return to FAQ

Last modified 3 years ago Last modified on 01/30/14 16:10:02