[Freeswitch-users] best freeswitch timer

Dmitry Lysenko dvl36.ripe.nick at gmail.com
Wed Feb 13 05:31:14 MSK 2013


В Вто, 12/02/2013 в 18:36 -0600, Ken Rice пишет:
> What you need to know is that if you are using a kernel with timerfd
> support you do not need to do anything to use it, the Core will figure
> it out automagically and use it. This means main line kernels 2.6.22
> and later and you are good to go. 

This automagic is really magic. But softtimer does not work well on my
system. :(
Kernel is latest (3.2.38-rt56 PREEMPT RT) and has all modern timing
features as timerfd, clock_nanosleep, HR timer(1ns reported, 470ns
measured by cyclictest -R),etc.
--- switch.conf.xml ---
<param name="enable-softtimer-timerfd" value="true"/>
---
running  freeswitch with -rp.

freeswitch at internal> timer_test 20 200
Avg: 19.999ms Total Time: 3999.985ms
2013-02-13 03:46:05.326648 [CONSOLE] mod_commands.c:827 Timer Test: 1
sleep 20 20204
2013-02-13 03:46:05.346428 [CONSOLE] mod_commands.c:827 Timer Test: 2
sleep 20 19779
2013-02-13 03:46:05.366429 [CONSOLE] mod_commands.c:827 Timer Test: 3
sleep 20 20001
2013-02-13 03:46:05.386427 [CONSOLE] mod_commands.c:827 Timer Test: 4
sleep 20 19999
2013-02-13 03:46:05.406427 [CONSOLE] mod_commands.c:827 Timer Test: 5
sleep 20 19998
2013-02-13 03:46:05.426644 [CONSOLE] mod_commands.c:827 Timer Test: 6
sleep 20 20218
2013-02-13 03:46:05.446428 [CONSOLE] mod_commands.c:827 Timer Test: 7
sleep 20 19783
2013-02-13 03:46:05.466428 [CONSOLE] mod_commands.c:827 Timer Test: 8
sleep 20 20000
2013-02-13 03:46:05.486428 [CONSOLE] mod_commands.c:827 Timer Test: 9
sleep 20 20000
2013-02-13 03:46:05.506428 [CONSOLE] mod_commands.c:827 Timer Test: 10
sleep 20 20001
2013-02-13 03:46:05.526644 [CONSOLE] mod_commands.c:827 Timer Test: 11
sleep 20 20216
...
------
freeswitch at internal> timer_test 20 200 timerfd
Avg: 19.999ms Total Time: 3999.983ms

2013-02-13 03:48:02.726442 [CONSOLE] mod_commands.c:827 Timer Test: 1
sleep 20 19985
2013-02-13 03:48:02.746437 [CONSOLE] mod_commands.c:827 Timer Test: 2
sleep 20 20000
2013-02-13 03:48:02.766442 [CONSOLE] mod_commands.c:827 Timer Test: 3
sleep 20 20003
2013-02-13 03:48:02.786433 [CONSOLE] mod_commands.c:827 Timer Test: 4
sleep 20 19998
2013-02-13 03:48:02.806433 [CONSOLE] mod_commands.c:827 Timer Test: 5
sleep 20 19997
2013-02-13 03:48:02.826433 [CONSOLE] mod_commands.c:827 Timer Test: 6
sleep 20 20000
2013-02-13 03:48:02.846432 [CONSOLE] mod_commands.c:827 Timer Test: 7
sleep 20 19999
2013-02-13 03:48:02.866432 [CONSOLE] mod_commands.c:827 Timer Test: 8
sleep 20 20000
2013-02-13 03:48:02.886432 [CONSOLE] mod_commands.c:827 Timer Test: 9
sleep 20 20002
2013-02-13 03:48:02.906432 [CONSOLE] mod_commands.c:827 Timer Test: 10
sleep 20 20000
2013-02-13 03:48:02.926434 [CONSOLE] mod_commands.c:827 Timer Test: 11
sleep 20 20000
...
-----
Tried many timing switch.conf options, but always spikes ~=200mks on
soft timer.  What I can do to make soft timer more precise?
Thanks.




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list