Tag Archives: bandwidth

Calculating bandwidth for Asterisk calls

One of the things you need to do when looking for a server to run Asterisk on is figure out how much bandwidth you need for the number of concurrent calls you’re expecting to have.

A great tool for this can be found here – http://www.asteriskguru.com/tools/bandwidth_calculator.php

Just set the codec you’re going to be using (check with your VOIP provider – g.711/ulaw is usual and the highest quality), the connection type (usually SIP or IAX2 with Asterisk) and the number of concurrent calls. It will then display the bandwidth required for that many calls.

One thing to watch out for if you’re planning on mixing codecs (say g.711 on one leg of the call and g.729 on the other) is that your server will have to transcode/convert the audio which is processing intensive.  This may limit the number of concurrent calls your server can handle.

Also don’t forget that if you’re planning on running Asterisk at home your upload speed will normally be a lot slower than the download speed.

E-mail alerts from munin for network bandwidth usage

I’m a big fan of munin for monitoring your linux server. It’s quick and easy to install and produces some nice graphs.

I run some OpenVZ servers and wanted to get munin to alert me if there was a sudden spike in my bandwidth throughput.

There are some instructions here for setting up alerts from munin but I couldn’t get it to work for the “if_” plugin that is used to generate the bandwidth graphs.

Turns out that plugin doesn’t produce warnings as standard. Here’s a quick and easy solution that works for me (although there are some pitfalls – such as the fact that you’re setting a generic setting for all interfaces)

On the machine running ‘munin-node’ edit the file /usr/share/munin/plugins/if_   (the location may vary)

and add this line with all the other echo statements –

echo "up.warning 1000000"

It’s in bits per second so that should set it to 1MB/s

Now on the machine running ‘munin’ (could be the same machine) edit the file /etc/munin/munin.conf and somewhere near the top add the lines –

contacts me
contact.me.command mail -s "Munin notification ${var:host}" user@example.com
contact.me.always_send warning

And that should be it. Give it 5 minutes and see if you get an alert  (might be worth setting the warning level to less than 1MB/s to test!)