[Home]

Summary:ASTERISK-20750: res_timing_kqueue makes Asterisk use 100% CPU
Reporter:Oleg Baranov (/dev/null)Labels:
Date Opened:2012-11-28 07:40:48.000-0600Date Closed:2017-04-07 16:43:33
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_timing_kqueue
Versions:11.0.1 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-17163 Asterisk consumes 100% of CPU on Mac OS X
Environment:FreeBSD 9.0 Release (clean install just to report this bug)Attachments:( 0) myDebugLog.head1000
Description:Asterisk works but one cpu core gets loaded 100%.
Seems easy to reproduce:
- Download and unpack Asterisk
- ./configure  (trivial, with no extra parameters)
- Enable kqueue in menuselect as mentioned in workaround ASTERISK-20749
- make ; make install; make samples
- run asterisk (no config file change required) and monitor cpu load


timing test produces strange results:
{quote}
bsd-cli*CLI> timing test
Attempting to test a timer with 50 ticks per second.
Using the 'kqueue' timing module for this test.
It has been 1000 milliseconds, and we got 413145 timer ticks
bsd-cli*CLI>
{quote}
Comments:By: Rusty Newton (rnewton) 2012-12-03 20:00:23.190-0600

Acknowledged. res_timing_kqueue and Asterisk on FreeBSD is considered extended support, which is covered by the community. Response times will reflect that. Thanks for reporting this. If you can supply a patch, that is always helpful.

By: Rusty Newton (rnewton) 2012-12-03 20:03:58.681-0600

https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information   You'll want to get a full log of Asterisk including the VERBOSE and DEBUG messages set to level 5. Make sure the full log captures the startup of Asterisk plus all the way through till the CPU utilization issue starts. Attach the log to the issue.



By: Rusty Newton (rnewton) 2012-12-03 20:34:13.601-0600

[Valgrind|https://wiki.asterisk.org/wiki/display/AST/Valgrind] with the callgrind option can dump out a profiling report, which could be useful to anyone looking into this issue. You may also want to consider posting any further information including dialplan (extensions.conf) in use, asterisk modules in use, any configuration changes made to Asterisk. Be sure to attach the config files and do not paste them in-line.

By: Oleg Baranov (/dev/null) 2012-12-04 04:38:52.666-0600

Debug output of first 1000 lines with 5 verbosity level from Asterisk start.
res_timing_kqueue ends up with
{noformat}
"res_timing_kqueue.c: Acking more events than have expired?!!"
{noformat}
endless loop.

By: Oleg Baranov (/dev/null) 2012-12-04 05:17:16.281-0600

Update: taking out chan_iax2 by putting
{noformat}
noload => chan_iax2.so
{noformat}
into modules.conf mitigate the issue. Default iax.conf is used. I tried but could not find any parameters in iax.conf that have any effect on the problem.

By: Sean Bright (seanbright) 2017-04-07 16:43:33.666-0500

I am not able to reproduce this problem with Asterisk 13.15.0 on FreeBSD 11.

If you are able to reproduce with Asterisk 13.15.0 or higher, please feel free to re-open this issue.