Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 168247 - net-misc/quagga: cleanup() in zebra init script is slow when routing table has many entries
Summary: net-misc/quagga: cleanup() in zebra init script is slow when routing table ha...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High trivial
Assignee: Alin Năstac (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-24 16:20 UTC by Jan Oravec
Modified: 2007-02-25 09:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Oravec 2007-02-24 16:20:25 UTC
The following code in /etc/init.d/zebra from net-misc/quagga is slow when routing table is large (e.g. 200K entries):

cleanup() {
        stale=`ip route | grep 'proto zebra' | awk '{ print $1 }'`
        if [ ! -z "$stale" ] ; then
                einfo "Cleaning up stale zebra routes..."
        fi
        for r in $stale; do
                ebegin "Removing stale route to $r..."
                ip route del $r;
                eend $?
        done
}

I propose replacing it by two 'ip -X route flush proto zebra' commands where X is 4 and 6 to handle both IPv4 and IPv6. It is probably important to check for IPv4/IPv6 protocol kernel support.


Reproducible: Always

Steps to Reproduce:
1.Run quagga with many entries in routing table
2.Make it crash (e.g. out of memory)
3.Start quagga again

Actual Results:  
Slow cleanup (e.g. 100 deleted routes per second)

Expected Results:  
Fast cleanup
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2007-02-25 09:59:02 UTC
Seems that "ip route flush proto zebra" is enough to cleanup the staled routes.
Fixed in cvs without revision bump (not important enough to worth a new revision). Thanks!