Red Hat Bugzilla – Bug 66263
RFE: check_default_route() much too slow
Last modified: 2014-03-16 22:27:54 EDT
Description of Problem:
The check_default_route() in /etc/sysconfig/network-scripts/network-functions is too slow.
It takes the output of 'ip route' and greps it for default route:
LC_ALL=C ip route | grep -q default
Instead it should be:
LC_ALL=C ip route list match 0/0 | grep -q default
By using 'list match' to find a default route, the function runs about 20-50 times faster.
This is important on boxes with many hundreds of thousands of bgp routes.
find_gateway_dev () can probably be optimized in similar fashion.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. install <a href="http://www.zebra.org">zebra</a>
2. get a bgp feed of several 100,000's routes
3. ctrl-alt-del to shutdown
very slow shutdown
should shutdown much faster
I have made this change in the newest initscripts package.
Florian La Roche
*** Bug 53530 has been marked as a duplicate of this bug. ***