[asterisk-users] Fun with virtual asterisks ...
Gordon Henderson
gordon+asterisk at drogon.net
Sat Feb 27 06:02:11 CST 2010
On Fri, 26 Feb 2010, Gordon Henderson wrote:
> More for fun than anything else, I've tried daisy-chaining instances
> together - so 20 asterisks running on the same host, 0 calls 1, 1 calls 2,
> 2 -> 3... 19 calls 0 - which plays music on hold.
>
> Put a call into 0 - setup through the chain seems to take less than half a
> second and I hear MoH... RTP is passing through each instance as
> canreinvite is set to no. CPU usage was about 6%.
More "plumbing" fun:
Phone -> pbx0 -> pbx1 -> ... pxb19 ->
pbx0 -> pbx1 -> ... pbx19 ->
pbx0 -> pbx1 -> ... pbx19 ->
pbx0 -> MoH
That's it's limit. when I loop it once more I get audio breakup. So 20
Asterisks handling 3 calls + 1; 61 calls, each handling full media.
dialplan on node 19:
exten => 666,1,Noop(Thrash Test - Turn ${thrashCounter})
exten => 666,n,GotoIf($["${thrashCounter}" = "2"]?gameOver)
exten => 666,n,SetGlobalVar(thrashCounter=$[${thrashCounter}+1])
exten => 666,n,Dial(SIP/666 at dsx0-out)
exten => 666,n,Hangup()
exten => 666,n(gameOver),Dial(SIP/*60 at dsx0-out)
channels on 0:
dsx0*CLI> show channels
Channel Location State Application(Data)
SIP/200-0000004d *60 at internal:4 Up MusicOnHold(default)
SIP/dsx1-out-0000004 (None) Up AppDial((Outgoing Line))
SIP/200-0000004b 666 at internal:2 Up Dial(SIP/666 at dsx1-out)
SIP/dsx1-out-0000004 (None) Up AppDial((Outgoing Line))
SIP/200-00000049 666 at internal:2 Up Dial(SIP/666 at dsx1-out)
SIP/dsx1-out-0000004 (None) Up AppDial((Outgoing Line))
SIP/299-00000047 666 at internal:2 Up Dial(SIP/666 at dsx1-out)
7 active channels
4 active calls
CPU usage (From top) on the host node:
Cpu(s): 26.7%us, 40.8%sy, 0.0%ni, 0.6%id, 0.3%wa, 0.0%hi, 31.6%si, 0.0%st
So not much actual user CPU, but a lot in the system and handling
interrupts. This is likely the networking layer and just the overhead of
running 20 live programs I suspect. I'm using Ethernet Bridging to do the
underlying network plumbing - each node sees an "eth0" as it would do if
it were on a standalone server (and having used the bridge code in the
past for a transparent traffic shaper, I think it's very efficient, but
obviously there will be overhead)
I am a little dissapointed that it wouldn't do more, but I suspect that's
the overhead of simply running 20 "virtual" asterisks rather than one - I
know I can exceede that number of calls handling full media on a single
500MHz CPU... However, this is an old 1.8GHz Celeron... I'm going to order
up a pair of nice fast dual core server boxes for production use so will
see how it behaves there.
More information about the asterisk-users
mailing list