LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Are LVS / ldirectord Multithreaded?

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Are LVS / ldirectord Multithreaded?
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Fri, 5 Dec 2008 00:32:49 +1100
On Thu, Dec 04, 2008 at 03:44:49AM -0800, Robinson, Eric wrote:
> I asked this question a few weeks ago, but I now realize that I asked it
> incorrectly. I was curious to know if a load balancer computer would
> benefit from multiple cores. The answers I received were mostly "No"
> because LVS itself does not take advantage of multiple cores and neither
> does ldirectord. 
> 
> The real answer, I think, is "Yes," because while neither LVS nor
> ldirectord are written to take advantage of multithreading, they are
> nevertheless separate processes. LVS could run on one core while
> ldirectord runs on another.
> 
> My basic concern is that packet forwarding could suffer while ldirectord
> is peaking. On average, it jumps to 25% CPU every 3-5 seconds, which
> should not pose a problem. But there are times on my system when
> ldirectord gets up to 99% CPU. 

Hi Eric,

The basic answer is yes.

By default ldirectord does not take advantage of mulitple cores,
though as diecussed in the previous thread, its workload can be split up,
and that would cause allow it to use multiple cores.

LVS does take advantage of multiple cores by virtue of being in the kernel
- assuming you are using an SMP kernel. The issue of how well it can use
multiple cores is a complex topic, and the results would depend on the
workload.

Its important to note that generally speaking ldirectord should not be
using a lot of CPU resources - and if it is then some refactoring of the
code for the situation at hand would be time well spent.  LVS (and the rest
of the Linux network stack, which it uses) may on the other hand consume a
reasonable ammount of CPU resource if it is dealing with a lot of packets /
connections.

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>