Posts Tagged voyage linux

FreeSWITCH performance test on AMD Geode LX800

This is a proof-of-concept test to see if the PC Engines’ ALIX2 board is suitable for a basic VoIP application.

First I compiled the latest FreeSWITCH version from Git. It was a mistake to run the compilation on the ALIX board: the CPU is quite slow, and the whole compilation took several hours.  I should’ve done the compilation on a more powerful machine and then copy the binaries to the ALIX.

In these tests, I used the default dialplan that came with FreeSWITCH (highly insecure, with the password 1234 for all users). I added an external SIP profile to connect it to my other IP PBX, so that I can easily place incoming calls.

An Ubuntu notebook with Twinkle was used as the SIP client for the ALIX server.

FreeSWITCH was running with -rp option, assigning the process a high priority.

1. IVR prompts and voicemail worked immediately, and the flash memory speed delays were insignificant.

2. A call without transcoding. Both call legs were using PCMA codec:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
1  0   3792   4036  23204 187060    0    0     0    36 1205 1576  0  2 98  0
1  0   3792   4036  23204 187068    0    0     0     0 1205 1548  0  3 97  0

# "top" output
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
3187 freeswit  -2 -10 30504  12m 4148 S  6.9  5.0   0:16.60 freeswitch

3. A call with transcoding. One leg used G722@16000 codec, and the other leg was GSM@8000:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 1  0   3796   4320  22844 186712    0    0     0     0 1207 1333 14  3 83  0
 1  0   3796   4320  22844 186712    0    0     0     0 1205 1348 14  4 82  0

# "top" output:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 2909 freeswit  -2 -10 31240  12m 4188 S 21.3  5.1   1:18.38 freeswitch

4. A conference with 5 PCMA channels:

# "vmstat 1" output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 122888  36440  58244    0    0     0     0 1458  844  7  6 87  0
 0  0      0 122896  36440  58244    0    0     0     0 1440  814  6  4 90  0

# "top" output:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 8124 freeswit  -2 -10 34208  13m 4224 S 12.1  5.5   1:29.85 freeswitch

Outcome: it’s possible to build a pretty decent small PBX for SOHO usage with this hardware. In all cases the voice quality was absolutely fine.

UPD1: a conference call with automatic recording into MP3: the CPU load jumps to 60% every few seconds, and the conference experiences significant delays and clippings. With WAV recording, everything runs smoothly, and not much different from the above results.

, , ,

2 Comments

Cloning a Voyage Linux host

After you made all your customizations to a Voyage Linux installation, you may want to replicate it to other boards. The procedure is tested with PC Engines’ ALIX2 boards.

The dump can also be easily piped through SSH to/from your backup server. This way it’s easy to organize snapshots for your lab testing and backups. Do not use any compression inside ALIX — the CPU is quite slow, and it’s faster to transfer uncompressed data over SSH and compress it on the target host if needed (assuming the target host is a usual modern machine).

# get dump and restore
remountrw
apt-get install dump

# make sure your source filesystem is read-only
remountro

# The target CF card is attached as /dev/sdb in a USB card reader
CF=/dev/sdb
CF1=/dev/sdb1

/usr/local/sbin/format-cf.sh -t $CF -b 1 -y
mkdir /tmp/cf
mount $CF1 /tmp/cf
cd /tmp/cf
dump -0 -f - /dev/hda1 | restore -r -f -

# let the new system re-generate SSH keys
rm /tmp/cf/etc/ssh/ssh_host_*
touch /tmp/cf/voyage.1st

# Populate a new hostname
vi /tmp/cf/etc/hostname
vi /tmp/cf/etc/hosts

# Install the boot loader (assuming Partition 1 is used for boot filesystem)
echo "(hd0) $CF" > /tmp/cf/boot/grub/device.map
mount -o bind /dev /tmp/cf/dev
chroot /tmp/cf /usr/sbin/grub --device-map=/boot/grub/device.map <<EOM
setup (hd0) (hd0,0)
quit
EOM
umount /tmp/cf/dev

# finished preparing the filesystem
cd /
umount $CF1

, ,

2 Comments

Tweaking Voyage Linux on PC engines’ ALIX

ALIX is a small-factor, low-power x86 platform designed and sold by PC Engines. I’ve set up one such system with my call-home scripts, and I plan to use it instead of (or alongside) those netbooks: it’s more compact, and it’s cheaper (around $150 for a box).

Voyage Linux is a Debian OS distribution adapted for such small-factor platforms. It mounts the flash drive in read-only mode by default, and also the kernel loads all necessary modules to support the ALIX board.

After setting up Voyage as described in their README, I do the following steps to optimize the setup (after issuing remountrw command):

0. Edit /etc/apt/sources.list and select a nearer mirror, e.g.

deb http://mirror.switch.ch/ftp/mirror/debian/ squeeze main contrib non-free

1. Adapt the DHCP client configuration so that it re-tries faster if DHCP service is unavailable:

# /etc/dhcp/dhclient.conf
# <other options skipped>
timeout 10;
retry 20;

2. Install NTP service. This is important because the board does not have a battery-powered RTC clock.

apt-get update
apt-get install ntp

3. Add a user for myself, add it to sudoers with NOPASSWD: option, and then remove the root password completely.

4. If I want to use X11 forwarding through SSH, there’s one problem: my home directory is by default on a read-only filesystem, and xauth tries to create .Xauthority in my home directory. To avoid that, I do the following:

sudo apt-get install xauth
sudo cat >> /etc/ssh/sshd_config <<EOT
PermitUserEnvironment yes
EOT
sudo service ssh restart
cat >.ssh/environment <<EOT
XAUTHORITY=/tmp/johndoe.Xauthority
EOT

5. Install additional stuff as needed:

sudo apt-get install dump git wireshark

6. Reboot, test, and backup the filesystem by using dump command (don’t use dump compression, as the CPU is rather slow).

, , ,

Leave a comment