-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netlink: Received message overrun (No buffer space available) #392
Comments
Could you please post both your with-VMAC and without-VMAC configs (or scripts that generate them), so that we can try to reproduce the problem. If you want to anonimise IP addresses etc, please just replace the first octet with 10; otherwise addresses are replaced with XXXs, we can't see the relationship between them. It is interesting that you only seem to need a relatively small number of VMACs to generate the problem, compared to the number of non-VMAC interfaces. I have a number of thoughts about what might be worth trying, but it would be really helpful to see your configs first to make sure that what I suggest makes sense. |
Sure, test_keepalived.sh
/root/keepalived.template.test:
testing:
comment out "vmac" option in the template, then:
tail -f /var/log/syslog | grep 'No buffer space' PS. Testing on dummy to simplify and isolate, but same results on physical bond or ethX. Regards |
From looking at your config, the global vrrp_garp_master_delay and vrrp_garp_master_repeat are both set to the default, which is 5. This means that every time an interface comes up, 5 gratuitous ARP messages are sent immediately on that interface, and 5 seconds later another 5 messages are sent. With 200 interfaces, all coming up together, this means that 1000 GARP messages are sent near simultaneously, and a further 1000 GARP messages are sent near simultaneously 5 seconds later. I would recommend setting vrrp_garp_master_repeat to 1 (so only 1 GARP message at a time is sent when an interface comes up), and set vrrp_garp_master_delay to 0 (so a second message isn't sent 5 seconds later for each interface). If you are still getting problems, then the GARP messages can be rate limited. Add a You can adjust the garp_interval setting to see what (if any) value helps resolve your problem. It would be most helpful to have feedback for what you find. |
From what I can see now, "No buffer space available" error message is just after entering BACKUP STATE and creation of vrrp interfaces (for 250 instances), and then, after a while GARPs are send. Seems this is not really related to GARPs, but the number of interfaces and changes done at once. Regards |
The "Keepalived_vrrp[]: Netlink: Received message overrun (No buffer space available)" message isn't a kernel buffers problem, it relates to the netlink broadcast messages being sent from the kernel to keepalived for LINK and ADDR events (see kernel_netlink_init() in vrrp_netlink.c), which is the kernel notifying keepalived of links and addresses being added and deleted. keepalived isn't reading the messages on the socket quickly/soon enough, and so the receive buffers on the socket become exhausted, which causes recvmsg() in netlink_parse_info to return ENOBUFS. If I add the following after the called of netlink_socket(&nl_kernel, ...) in kernel_netlink_init() Clearly the above simplistic approach isn't a solution to the problem, but at least we've found the right area. I suspect the solution is to call netlink_parse_info() while the vmacs and addresses are being added, but this needs further investigation. Many thanks for reporting this and providing the detailed info. I'll continue to work on this to find a solution. |
The commit in the above pull request resolves the issue by polling for netlink messages after adding each interface, and thereby stop the large queue of messages building up, which was what was causing the message overrun. I have tested this with 250 vmac interfaces, and also with 250 non-vmac interfaces, and no longer receive the Received message overrun message. |
I couldn't compile the latest git version, but ported all things you merged connected with kernel_netlink_poll() to the latest stable 1.2.23. The result is BETTER :)
But the weirdest part is when I add "notify_master" (almost empty), then:
the notify line: the script itself (/tmp/null.sh, executable):
Dunno if this helps you, but strace near to the "No buffer space available" error:
Don't know how I can test that more. Simplified all cases (at the beginning I had the error with notify scripts calling sysctl, but that's not the case as you can see above). Regards! |
Do you have automake installed? If so, running automake --add-missing may resolve your build problem with the latest git version. If that doesn't resolve, could you post details of the error here and I'll have a look. I'll have a further look at the "No buffer space available" problem later. |
Pull request #403 solves the particular cause of the netlink buffer overrun you were experiencing when transitioning to master. The reason for the problem was that adding a notify_master script means that as each vrrp instance transitions to master keepalived executes an open(), a close() and a fork() system call, the first and last of which are slow system calls, so the complexity of the script isn't the issue since the script itself is run asynchronously. This meant that netlink RTM_NEWADDR messages were being buffered, and eventually the buffer overran. I think there is the possibility of further such problems, although I haven't tested them yet. Perhaps you can. One possibility is with a notify_fault script if all vrrp instances simultaneously go to fault state, e.g. by executing Could you please reopen this issue report, since there are some scenarios that at the very least still need further testing. |
I think I can't reopen the case, @acassen would U? |
Commit 6255538 adds configuration options
to allow the netlink receive buffers to be increased in size in order to stop the ENOBUFS error. |
Opening new ticket for clearance, mentioned about this issue here #390
How to tune the buffer size? Tried to increase buffers system-wide via sysctl - didn't help.
Message appears when playing with dozen or hundred of instances on different interfaces with or w-out VMAC option enabled. Starts at level of about 15 instances (with vmac setup) or ~200 instances (no-vmac setup) or at. I start seeing that error at the time of becoming MASTER and sending GARPs.
How can I tune it up properly?
PS.
Tested on 1.2.22 and 1.2.23. Used dozen kB of rmem_max/default buffer size up to few or even hundred of Megs.. same result.
Best regards!
The text was updated successfully, but these errors were encountered: