On Sat, 26 Nov 2005, Daniel Ouellet wrote:

> Here a question I found interesting for my own education, and I am trying to
> come to peace with as far as applications usage with dual core, or
> multi-processor vs single one.
> 
> I was asking myself if I would actually benefit from a dual core processor, or
> multi-processor system in a routing setup and more I think about it, I would
> think not as the application is not multi-treads to start with and there isn't
> must else running as well.
> 
> Am I wrong in my understanding?

If you run a routing daemon, and are doing routing your are doing
multiple things simultaneously: an application (which in some cases
consists of multiple processes) and the kernel both do work.

> 
> Looking at the code of bgpd/ospfs, I don't see it design as using multiple
> treads ( doesn't mean I understand it fully either) so it wouldn't benefit
> from a dual core server then, and as the routing table basically is process by
> the kernel, I would think it would be useless to have multi core no?

The current thread library does not take advantage of mult-core or
multi-procesoer setups. There's work being done on an alternative
threading implementation which does take advantage of having more than
one processor, but that is not finished yet. 

Currently, the unit of scheduling is a process. The scheduling of
threads is done in userland by the pthreads library.

Currently a multi-threaded application will not benefit directly from
MP.

> 
> In a setup where multiple applications are running, or where the applications
> are design with treads in it, yes, but here am I wrong to think that for a
> setup where routing with multiple Ethernet ports and where bgpd/ospfd is
> running with pf that it wouldn't really be a benefit? They all are dependent
> on each other and as such would need to wait anyway if the routing table
> changed.
> 
> Can someone correct my understanding, or lack there of, I was curious about
> that now.

The kernel itself does not take advantage of multiple CPUs. But the
routing daemon _might_ benefit from having multiple CPUs. The answer is
also dependent on the impact GENERIC.MP has on performance, because it
does introduce overhead, havig to coordinate things between the CPUs.

So the only real way of answering this is to do measurements.

> Multi-processor is only useful when you can do multiple things, not related to
> each other at the same time, or the application is design with treads in mind,
> so here I guess the benefit would be minimal no?
> 
> Unless I miss something in the code, or something in how bsd.mp works (as it
> would be required to run dual core CPU), may as well put the money for the
> speed instead of dual core no?
> 
> It's not a big issue, but it got me thinking about it at the point that I
> really got curious as to the outcome now, and wonder if I actually understand
> it right, or if I am full of it!
> 
> Thanks for your time.
> 
> Daniel

If the kernel is busy, an MP setup might help since the other
processor(s) are available for user processes, but if these processes
often require services from the kernel, the benefits of MP will be low, and
in some cases even be negative. 

        -Otto

Reply via email to