Bug 66263

Summary: RFE: check_default_route() much too slow
Product: [Retired] Red Hat Linux Reporter: Dan Hollis <goemon>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: low    
Version: 7.3CC: rvokal, wtogami
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-06-12 07:13:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Hollis 2002-06-06 21:30:31 UTC
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:

check_default_route ()
{
   LC_ALL=C ip route | grep -q default
}

Instead it should be:

check_default_route ()
{
  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):


How Reproducible:
Every time

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

Actual Results:
very slow shutdown

Expected Results:
should shutdown much faster

Additional Information:

Comment 1 Florian La Roche 2002-07-16 13:30:32 UTC
I have made this change in the newest initscripts package.

Thanks,

Florian La Roche


Comment 2 Bill Nottingham 2003-10-06 05:34:46 UTC
*** Bug 53530 has been marked as a duplicate of this bug. ***