Nlbwmon- Netlink receive failure: Out of memory

I'm getting the following errors every few hours:

daemon.err nlbwmon[21812]: Netlink receive failure: Out of memory
daemon.err nlbwmon[21812]: Unable to dump conntrack: No buffer space available

I've already increased buffer size to 10M but still getting these errors. Also changed the Commit interval to 1hr, hoping that this commit will flush the buffer after writing to the database.

/etc/config/nlbwmon: option netlink_buffer_size 10485760

Stats:

# cat /proc/sys/net/netfilter/nf_conntrack_count
632
# cat /proc/sys/net/netfilter/nf_conntrack_max
16384

Any suggestions on fixing this? Thanks.

decreasing the buffer size ?

Thanks for the response.... but not sure I understand your suggestion for decreasing the buffer size. Is this because you're thinking I'm running out of system RAM? I'm currently running on RPi4 with 2GB RAM and I'm only using 6% 115MB.

So no regular router ... :wink:

In that case, no, there's no point of shrinking the buffer.

1 Like

Make this something like 20 mins? Just a wild guess though. Also on RPi try making the buffer say 100MB you have the ram.

1 Like

Increasing more buffer will be my next try. Didnt think 1 hr of data will take up that much buffer. Saw another user with 3x my conntrack count fixed this same error with only 1M buffer, so thinking 10x will fix my issue but guess not.

Update: Unfortunately, still getting same error after increasing buffer to 100M and restarting nlbwmon. Strange thing is, even after increasing the buffer to 100M and running for a few hrs and getting this error, my total memory usage still shows the same at 115MB. I'd think it will increase by 100M? I've logged this as an issue with the developer as well. If anyone has other suggestions.... Thanks.

same issue still happening on the latest nightly build as of today. 2021-02-15.

I set my netlink buffer to 8MB, 16MB, 32MB, 48MB, and 64MB and still run into the error. I set the commit interval to 40s and refresh interval to 20s. Everything else is default.

I logged this as an issue with the developer 2 mths ago but didnt even get any response from him. Github issue is still in open status. So I just uninstalled the pkg and not use it!

I am seeing a similar issue and noticed that netlink_buffer_size is used by setsockopt to set SO_RCVBUF, but that value cannot exceed net.core.rmem_max. Quick search shows that there is no error returned if the size exceeds rmem_max. If anyone is still having this issues, try increasing net.core.rmem_max ro match netlink_buffer_size

The maximum sizes for socket buffers declared via the SO_SNDBUF 
and SO_RCVBUF mechanisms are limited by the values in the 
/proc/sys/net/core/rmem_max and /proc/sys/net/core/wmem_max files.  
Note that TCP actually allocates twice the size of the buffer  requested
in  the  setsockopt(2)  call,  and  so a succeeding getsockopt(2) call will 
not return the same size of buffer as requested in the setsockopt(2) call.  
TCP uses the extra space for administrative purposes and internal 
kernel structures, and the /proc file values
reflect the larger sizes compared to the actual TCP windows.  
On individual connections, the socket buffer size must be set prior to 
the listen(2) or connect(2) calls in order to have it take effect.  
See socket(7) for more information.
3 Likes