[Xorp-hackers] heavy CPU use for xorp_fea on startup

Ben Greear greearb at candelatech.com
Tue Mar 4 17:01:24 PST 2008


Pavlin Radoslavov wrote:
> Ben Greear <greearb at candelatech.com> wrote:
> 
>> I am trying to start 30 xorp instances on a system with
>> around 600 interfaces (vlans and such).  My hardware has lots
>> of RAM and a quad-core CPU, but it still takes more than the 10
>> second keep-alive timeout to get xorp_fea initialized (it seems
>> to be reading large numbers of netlink messages).  This causes
>> continual xorp restarts since the timeout fails.
> 
> What kind of netlink messages the FEA sees from the kernel?
> Are those asynchronous notifications/upcalls about some events
> or something that the FEA explicitly requested (e.g., to read the
> set of interfaces and IP addresses).
> Also, if you run "ip monitor all" in parallel do you see
> all those netlink messages?

Looks like at least one problem is that we do a linear
lookup when searching for an interface by if-index.

IfTreeVif*
IfTree::find_vif(uint32_t pif_index)
{
     IfTree::IfMap::iterator iter;

     //
     // XXX: Find the first vif that matches the physical index
     //
     for (iter = _interfaces.begin(); iter != _interfaces.end(); ++iter) {
	IfTreeVif* vifp = iter->second.find_vif(pif_index);
	if (vifp != NULL)
	    return (vifp);
     }

     return (NULL);
}


So, when reading in 600 interfaces, and then 600 addresses,
it adds up quickly.

I think the first thing I'll attempt is to add a second map
mapping the if-index to a pointer to the IFTreeVif object
found in the IfTree _interfaces map.  Hopefully the hash will be significantly
faster than the linear search through the name -> IFTreeVif hash...

The complete oprofile report for the xorp_fea binary is here:

http://candelatech.com/oss/fea_oprofile.txt.gz

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list