Wednesday, December 29, 2010

No Bufferspace Available Error

While using my system (Ubuntu at the time) on a large, fast network (for perfectly legal means), it occasionally became inundated with connections and new connections could not be established, returning a "No Bufferspace Available" error message, ex:
$ ping anywhere
ping: sendmsg: No buffer space available

To fix this, I had to increase the ARP table space. To do this permanently:
Edit /etc/sysctl.conf and add the following lines:
net.ipv4.neigh.default.gc_thresh3 = 4096
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh1 = 1024

# sysctl -p

For a temporary fix:
echo 1024 > /proc/sys/net/ipv4/neigh/default/gc_thresh1
echo 2048 > /proc/sys/net/ipv4/neigh/default/gc_thresh2
echo 4096 > /proc/sys/net/ipv4/neigh/default/gc_thresh3

6 comments:

  1. Thank you very much for your tip! it's helpful for my case!

    ReplyDelete
  2. Helpful :)

    Thanks !

    ReplyDelete
  3. Thank you.. Its working for me..
    But I don't know what changes I made .. Can you explain

    ReplyDelete
  4. Thank you.. Its working for me..
    But I don't know what changes I made .. Can you explain

    ReplyDelete
  5. Thanks, this solved my problem.

    @Bijesh, the problem was the ARP table was full. This can happen on large subnets or hosts in multiple VLANs. It's an insidious problem as it happened on our router and resulted in hosts being intermittently available, depending on whether there was room in the table at the time.

    You can confirm this is the problem by checking these two commands:

    $ cat /proc/sys/net/ipv4/neigh/default/gc_thresh3
    1024
    $ cat /proc/net/arp | wc -l
    1023

    The first command shows the maximum size of the ARP table. The second command shows the ARP table's current size. As you can see, my table was at the maximum. After you make the changes in the post, you'll see the table size immediately increase.

    You can also run this command to check your logs for the message that indicates this problem:
    $ cat /var/log/messages | grep "Neighbour table overflow."

    Another article that goes into a bit more depth is here:
    http://www.serveradminblog.com/2011/02/neighbour-table-overflow-sysctl-conf-tunning/

    ReplyDelete