[Xorp-users] Multiple xorp instances performance improvements.

Ben Greear greearb at candelatech.com
Mon Sep 10 21:32:14 PDT 2007


Pavlin Radoslavov wrote:
> Ben Greear <greearb at candelatech.com> wrote:
>
>   
>> It appears that each Xorp instance effectively listens for all xorp
>> related packets on all interfaces.  It does filter out the packets that
>> are received on interfaces it is not configured for, but that is a lot
>> of work.
>>     
>
> I presume you are talking about the raw IP interface.
>   
I think so..I haven't followed the code far enough to see exactly how
it is created/bound yet.
>> If we are talking about 10 or 100 xorp instances, then each router packet
>> is going to wake 10 or 100 processes (9 or 99 of which don't care),
>> causing serious performance penalty.
>>     
>
> This might or might not be the case, but I wouldn't call that
> "serious performance penalty" without doing some profiling or
> measurements that quantify it.
>   
Fair enough, though if we reach 50 xorps, with each sending 1 pkt per 
second, that means
that all 50 will be receiving 50 per second..and this is about what VOIP 
costs.  I do know that
running 50 VOIP calls on a system will drag down a single CPU easily.

I'll first patch xorp to not print error messages in this case, which 
should help a lot, and then
we'll run some performance tests.

>> How hard would it be to make Xorp bind only to the interfaces it
>> cares about (for reading, at least)?  I think the write socket can
>> remain as it is...
>>     
>
> There is a trade-off.
> By doing something like this you need to create and bind a receiving
> socket for each configured IP address (even in the case when an
> interface has 2+ alias IP addresses). If there is a huge number of
> configured interfaces/addresses (e.g., think 1000 virtual tunnel
> interfaces), this will eat up lots of socket resources. For example,
> if each socket is configured with 256KB kernel buffer space, then
> you need total of 256MB buffer space which is a lot!
>   
Just for argument's sake..that memory is not actually used unless it is 
required..the
256 just means the kernel can use it if it wants (at least in Linux).  
Also, having a
packet copied 50 times is probably worse on memory than 50 sockets, 49 
of which
are empty.

> Though, in general I'd say to hold back premature optimizations
> until it is clear the optimization is necessary.
>   
Good advice, as always :)

Thanks,
Ben

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




More information about the Xorp-users mailing list