Testing FreeSWITCH performance on Scaleway C1

The dedicated ARM hosting servers at Scaleway appear to be a decent platform for a mid-sized PBX.

In short, the platform displays the following results in performance tests:

  • OPUS<->PCMA transcoding: 16 simultaneous calls with  at about 95% total CPU load and no noticeable distortions.
  • SILK<->PCMA transcoding: 72 simultaneous calls were going without distortions, with average total CPU load at 63%. Higher number of calls resulted in noticeable distortions.
  • G722<->PCMA transcoding: 96 simultaneous calls without distortions, at 76% CPU load, and noticeable distortions for higher numbers.

Test 1: sequential transcoding

The following tests are a slight modification of my previous test scenario: it appears that a channel in OPUS codec cannot execute `echo` or `delay_echo` FreeSWITCH applications, as they copy RTP frames, and the OPUS codec is stateful and does not accept such copying. So, an extra bridge is made to ensure that echo is always executed on a PCMA channel.

XML dialplan in public context (here IPADDR is the public address on the Scaleway host):

  <!-- Extension 100 accepts the initial call, plays echo, 
       and on pressing *1 it transfers to 101  -->
  <extension name="100">
    <condition field="destination_number" expression="^100$">
      <action application="answer"/>
      <action application="bind_meta_app" data="1 a si transfer::101 XML ${context}"/>
      <action application="delay_echo" data="1000"/>
    </condition>
  </extension>    

  <!-- Extension 101 plays a beep, then makes an outgoing SIP call to 
       our own external profile and extension 200  -->
  <extension name="101">
    <condition field="destination_number" expression="^101$">
      <action application="playback" data="tone_stream://%(100,100,1400,2060,2450,2600)"/>
      <action application="unbind_meta_app" data=""/>
      <action application="bridge"
              data="{absolute_codec_string=PCMA}sofia/external/200@IPADDR:5080"/>
    </condition>
  </extension>

  <!-- Extension 200 enforces transcoding and sends the call to 201 -->

  <extension name="200">
    <condition field="destination_number" expression="^200$">
      <action application="answer"/>
      <action application="bridge"
              data="{max_forwards=65}{absolute_codec_string=OPUS}sofia/external/201@IPADDR:5080"/>
    </condition>
  </extension>    

  <!-- Extension 201 returns the call to 100, guaranteeing it to be in PCMA -->

  <extension name="201">
    <condition field="destination_number" expression="^201$">
      <action application="answer"/>
      <action application="bridge"
              data="{max_forwards=65}{absolute_codec_string=PCMA}sofia/external/100@IPADDR:5080"/>
    </condition>
  </extension>

The initial call is sent to extension 100 in the public context, and then by pressing *1, 6 additional channels are created, of which two calls perform the transcoding from PCMA to OPUS and back. So, if “show channels” shows 43 total channels, it corresponds to 42 = 6*7 test channels plus the incoming one, or 14 transcoding calls.

#### Good quality ####
# fs_cli -x 'show channels' | grep total
43 total.
# mpstat -P ALL 10                      
Linux 3.19.3-192 (scw01)    04/10/2015      _armv7l_        (4 CPU)

10:08:41 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:08:51 PM  all   82.67    0.00    2.75    0.00    0.00    1.30    0.00    0.00   13.28
10:08:51 PM    0   92.80    0.00    1.30    0.00    0.00    5.20    0.00    0.00    0.70
10:08:51 PM    1   95.30    0.00    1.60    0.00    0.00    0.00    0.00    0.00    3.10
10:08:51 PM    2   89.90    0.00    2.50    0.00    0.00    0.00    0.00    0.00    7.60
10:08:51 PM    3   52.70    0.00    5.60    0.00    0.00    0.00    0.00    0.00   41.70

10:08:51 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:09:01 PM  all   84.88    0.00    2.43    0.00    0.00    1.23    0.00    0.00   11.47
10:09:01 PM    0   94.50    0.00    0.50    0.00    0.00    4.90    0.00    0.00    0.10
10:09:01 PM    1   97.60    0.00    1.50    0.00    0.00    0.00    0.00    0.00    0.90
10:09:01 PM    2   87.70    0.00    2.20    0.00    0.00    0.00    0.00    0.00   10.10
10:09:01 PM    3   59.70    0.00    5.50    0.00    0.00    0.00    0.00    0.00   34.80


#### quite OK quality, with some minor distortions ####
# fs_cli -x 'show channels' | grep total
49 total.
# mpstat -P ALL 10                      
Linux 3.19.3-192 (scw01)    04/10/2015      _armv7l_        (4 CPU)

10:10:29 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:10:39 PM  all   95.65    0.00    2.40    0.00    0.00    0.83    0.00    0.00    1.12
10:10:39 PM    0   95.30    0.00    1.20    0.00    0.00    3.30    0.00    0.00    0.20
10:10:39 PM    1   96.90    0.00    2.20    0.00    0.00    0.00    0.00    0.00    0.90
10:10:39 PM    2   95.80    0.00    3.50    0.00    0.00    0.00    0.00    0.00    0.70
10:10:39 PM    3   94.60    0.00    2.70    0.00    0.00    0.00    0.00    0.00    2.70

10:10:39 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:10:49 PM  all   91.55    0.00    1.55    0.00    0.00    0.78    0.00    0.00    6.12
10:10:49 PM    0   89.90    0.00    1.20    0.00    0.00    3.10    0.00    0.00    5.80
10:10:49 PM    1   96.60    0.00    0.70    0.00    0.00    0.00    0.00    0.00    2.70
10:10:49 PM    2   90.60    0.00    1.70    0.00    0.00    0.00    0.00    0.00    7.70
10:10:49 PM    3   89.10    0.00    2.60    0.00    0.00    0.00    0.00    0.00    8.30

#### bad quality, barely audible ####
# fs_cli -x 'show channels' | grep total
55 total.

If OPUS codec is replaced with SILK in the above configuration, the test is not usable, as SILK appears not to tolerate multiple transcodings, and after 4 transcodings the sound is almost not propagated at all. Also further transcoding sessions treat the input as silence, and do not load CPU.

If G722 is used, 36 transcoded calls still leave plenty of CPU resources for other tasks:

# fs_cli -x 'show channels' | grep total 
109 total.
# mpstat -P ALL 10                      
Linux 3.19.3-192 (scw01)    04/10/2015      _armv7l_        (4 CPU)

10:37:31 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:37:41 PM  all   19.75    0.00    5.40    0.00    0.00    0.00    0.00    0.00   74.85
10:37:41 PM    0   27.00    0.00   12.10    0.00    0.00    0.00    0.00    0.00   60.90
10:37:41 PM    1    4.30    0.00    9.50    0.00    0.00    0.00    0.00    0.00   86.20
10:37:41 PM    2   47.60    0.00    0.00    0.00    0.00    0.00    0.00    0.00   52.40
10:37:41 PM    3    0.10    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.90

10:37:41 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
10:37:51 PM  all   17.57    0.00    7.42    0.00    0.00    0.00    0.00    0.00   75.00
10:37:51 PM    0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
10:37:51 PM    1   20.30    0.00   29.70    0.00    0.00    0.00    0.00    0.00   50.00
10:37:51 PM    2   50.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   50.00
10:37:51 PM    3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00

 Test 2: parallel transcoding

The following piece of public dialplan takes the call at extension 300, makes a call in OPUS to extension 301, and then the call is bridged to 302 in PCMA where a speech test file is played endlessly. Thus, a call to 300 produces 5 channels, which are equivalent of two transcoded calls.

  <extension name="300">
    <condition field="destination_number" expression="^300$">
      <action application="answer"/>
      <action application="bridge"
              data="{absolute_codec_string=OPUS}sofia/external/301@IPADDR:5080"/>
    </condition>
  </extension>    

  <extension name="301">
    <condition field="destination_number" expression="^301$">
      <action application="answer"/>
      <action application="bridge"
              data="{absolute_codec_string=PCMA}sofia/external/302@IPADDR:5080"/>
    </condition>
  </extension>    

  <extension name="302">
    <condition field="destination_number" expression="^302$">
      <action application="answer"/>
      <action application="endless_playback" data="/var/tmp/t02.wav"/>
    </condition>
  </extension>

In parallel to a call to 300 from outside, additional endless calls were produced from fs_cli:

originate sofia/external/300@IPADDR:5080 &endless_playback(/var/tmp/t02.wav)

This originate command produced 6 new channels, equivalent to two transcoded calls. The command was repeated until the human caller hears any distortions.

OPUS transcoding was functioning fine with 16 transcoded calls and 95% average CPU load, while SILK and G722 started showing distortions at around 65-75% of CPU load.

 

 

Advertisements

, , , ,

  1. #1 by Alexander on June 21, 2015 - 2:34 pm

    can you be more specific about linux-image-lowlatency install at scaleway please? I did search for kernels you’ve mentioned but can not find it. How to use low latency kernel ?

    • #2 by txlab on June 21, 2015 - 2:46 pm

      it was somewhere in the control panel, I can’t remember

  2. #3 by Alexander on June 21, 2015 - 3:01 pm

    I’ve found the section in control panel but how to know which kernel to chose? there is no 3.19.3 option. which one to chose? please see screenshot.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: