[asterisk-users] Network architecture

Jared Smith jsmith at digium.com
Wed Feb 18 10:05:18 CST 2009


On Tue, 2009-02-17 at 12:24 -0700, Wilton Helm wrote:
>  I'm not sure I see the merit in this.  VMs seem to be regarded as a
> magic bullet (i.e. free lunch).  I don't know of any case where 5 VMs
> can accomplish more work on one processor than simply letting the
> processor manage it all (except if the OS and or application can't
> efficiently split the task into the necessary multiple threads, which
> I don't think is an issue here).  By definition, the total
> accomplished must be less with VMs, because the hypervisor will take
> some CPU cycles.

While this would appear to be the case at first glance, there's
something more subtle going on here.  In this particular case, there are
data structures inside of Asterisk that get less efficient as you put
more and more calls through the system.  Let's take a linked list of
channels for example... when you have ten calls on the system, it's
fairly simple to walk down the list of channels and find the channel
you're looking for.  When you have a thousand calls on the system,
that's certainly less efficient.  

This should make it apparent why the resource requirements for Asterisk
don't scale linearly with the call volume.  Or, to put it another way,
you you can think of splitting the calls across two VMs as a crude way
of bringing some efficiency back into those structures.

Now, in the interest of full disclosure, I used the idea of a
linked-list above only as an example.  Many of the changes in Asterisk
between 1.4 and 1.6.0 have been to re-plumb a lot of the internal
structures to behave better under higher call volumes (things like
replacing linked lists with hash tables, etc.).  The Asterisk developers
are continuing to work on the efficiency of the code data structures
within Asterisk, but in the meantime, I hope I've given you some insight
into why splitting calls across virtual machines on the same box can
offer improvements, despite the overhead of running a hypervisor.


-- 
Jared Smith
Digium, Inc. | Training Manager 






More information about the asterisk-users mailing list