Dr D's Abode

Virtual Machines, trixbox and joy

by on Mar.02, 2008, under Code, Computers, General

So I decided to get a VM server for at home, reduce the number of machines I have in house, reduce power, and learn while Im at it.

So I got my system, its a Intel Duo 2 Quad Q6600 cpu, 4g ram, 750g hdd and I install gentoo on it.

Everything is going fine, until I get to converting my trixbox. Of course, I shouldnt be doing this because trixbox is realtime audio for a phone, on a virtual server. Ive read the bads about it, but I dont care. In my case, its a glorified answering machine.

So I google, and stumble accross some sites, we have http://pbxinaflash.com/forum/showthread.php?t=66 who had two unique solutions which helped, but didnt fix my issue. I tried both solutions, then in the process of doing so, I realized something. If there is a CPU load of say 5-10% going across, the audio sounds perfect!

So of course, I get to finding a way to geneate a low cpu load, that can be “moved over” when something more important comes along.

Now my script, dubbed “generate-cpu-load.sh” was born.

Here is my script, and where its placed to run

——– >8 start code 8<——–

#!/bin/sh
#
# (c) Dan Delaney 2008 http://dan-delaney.com
# generate-cpu-load.sh - To generate a small CPU load on the system so
# that trixbox will play back audio without skipping.
# NOTE: This is NOT to be used for a perminant solution, just to work
# around a problem with vmware and asterisk timing.
while true; do
nice -n19 find /etc/asterisk > /dev/null 2>&1
done

——– >8 end code 8<——–

Of course, we need this to run constantly in the background, so I put it in my rc.local file

echo "nice -n19 /root/generate-cpu-load.sh &" >> /etc/rc.d/rc.local

and to start it without rebooting: sh -c "nice -n19 /root/generate-cpu-load.sh &"

Now, dont go knocking me down because this creates a constant CPU load. This does not make the system ready for production, nor may it work on anyone else’s system.

If you find this helpful or just whatever, just drop me a line and say so!


Comments are closed.

Twitter

Powered by Twitter Tools

Geek Code

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT d-(+) s:+ a C++ BL++++ P++>+++ L++(+++) E--- W++ N o K- w O M V-- PS
PE Y+ PGP+ t+ 5 X+ R tv b DI D+ G e+ h+ r-- y+
------END GEEK CODE BLOCK------

Linux Counter

Certifications


 

PSN Portable ID

Powered by

Hacker
 
Powered by Gentoo Linux