Wednesday, August 25, 2010

Asterisk clock source

You may need to change your Linux server's clock source in order for
Asterisk's conference bridge to perform properly.

Requirements: Asterisk 1.4 and Dahdi

1) First verify what clock sources are available in Linux.
#cat /sys/devices/system/clocksource/clocksource0/available_clocksource

acpi_pm jiffies tsc pit

2) Some distributions may have hpet (newer kernels). Set the clock source
to next best thing, "acpi_pm". Edit grub.conf and insert the following:

clocksource=acpi_pm

Here's an example.

# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5 ro root=/dev/VolGroup00/LogVol00 clocksource=acpi_pm
initrd /initrd-2.6.18-92.el5.img

3) Reboot your server. In my case, starting asterisk before dahdi produced
more accurate measurements. I'm using old Intel P4 servers, 3.0Ghz CPU / 1G Ram.

4) Verify your new setting.

# cat /sys/devices/system/clocksource/clocksource0/current_clocksource

5) Use the dahdi_test command to measure the accuracy.

# dahdi_test
Opened pseudo dahdi interface, measuring accuracy...
99.950882% 99.961235% 99.948433% 99.956535% 99.948242% 99.956253% 99.956741%

Before, I had 99.8s and 99.9s. Now it's all 99.9s

No comments:

Post a Comment