[Home]

Summary:ASTERISK-17412: Asterisk Hangs/ CPU Usages goes up to 500%
Reporter:Harpreet (vois)Labels:
Date Opened:2011-02-15 11:09:25.000-0600Date Closed:2011-06-04 10:13:30
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:General
Versions:1.8.2 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace-threads.txt
( 1) core-show-locks.txt
Description:Asterisk 1.8.2 goes down, i am unable to stop from CLI. i have to kill PID. I enabled don't optimize and dead locks for tarce and now what i see is asterisk is consuming 500% of CPU. Once CPU usage goes above 300%, asterisk start losing peers, peer lags ( Peer 'peername' is now Lagged) and after few mins peers come reachable (Peer 'peername' is now Reachable). I have attached the core show locks and back trace when CPU usage was very high(300% or more). Total 850 peers, 80% are TLS. I tired 1.8.2 and 1.8.2.3, getting same issues with both.
Linux Dist: Ubuntu 2.6.32-21-server.
Linux VOIS8P 2.6.32-21-server ASTERISK-28-Ubuntu SMP Fri Apr 16 09:17:34 UTC 2010 x86_64 GNU/Linux

I have attached the core dead locks and backtrace. I same exactly same server running asterisk 1.4.37 with 1500 peers.

Thanks in advance.

Comments:By: Russell Bryant (russell) 2011-02-15 14:14:59.000-0600

I see that you're using res_timing_pthread.  Please try using a different timing module.  If your system is new enough, use res_timing_timerfd.  If the dependencies for that are not met, install DAHDI and use res_timing_dahdi.

By: Harpreet (vois) 2011-02-15 14:53:45.000-0600

Hi Russell,
          I disabled res_timing_pthread from menuselect. I will also remove the module from your modules directory (/usr/lib/asterisk/modules). Will recomplie and restart asterisk late night and update you.

Thanks for help

By: Harpreet (vois) 2011-02-17 10:10:01.000-0600

Hi,
 Today asterisk hanged after following error:

[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor
[Feb 17 08:59:04] ERROR[9184]: res_timing_timerfd.c:171 timerfd_timer_ack: Read error: Bad file descriptor

Please suggest what should i do to over come this. I have already disabled res_timing_pthread and removed it from  /usr/lib/asterisk/modules directory.

Thanks in advance

By: Ronald Chan (loloski) 2011-02-17 14:02:46.000-0600

vois,

How about installing a real dahdi interface and load res_timing_dahdi ?, to be honest res_timing_pthread and res_timing_timerfd module for now can complicate things even further. i have a few sites force me to roll out a dahdi interface just to solve a timing issues on my end.

Since then i have zero issues with regards to timing/clock source issues, just my 0.002 cents

Regards,

By: Leif Madsen (lmadsen) 2011-02-18 14:21:07.000-0600

Agreed with loloski. When pthread and timerfd work, they are fine. But when you run into issues with them you should try using res_timing_dahdi and see if that resolves the issues. No hardware is required.

By: Kadir Terzi (kterzi) 2011-02-23 16:05:49.000-0600

No hardware is required for using res_timing_dahdi? I really want to know how to use this timer without dahdi card.

By: Harpreet (vois) 2011-02-23 17:46:28.000-0600

install dahdi(software). Go to asterisk source run make clean and then configure. And now you can choose res__timing_dahdi from menuselect.

By: Harpreet (vois) 2011-02-23 17:48:47.000-0600

My asterisk is running good from last few days using res_timing_dahdi. I saw some errors today but asterisk is running good. Not sure what following error is but it is also related to dahdi timer:

[Feb 23 10:34:39] ERROR[25607]: res_timing_dahdi.c:88 dahdi_timer_set_rate: Failed to configure DAHDI timing fd for 0 sample timer ticks
[Feb 23 10:34:39] ERROR[25607]: res_timing_dahdi.c:88 dahdi_timer_set_rate: Failed to configure DAHDI timing fd for 0 sample timer ticks



By: Kadir Terzi (kterzi) 2011-03-01 09:40:06.000-0600

I have installed dahdi en selected res_timing_dahdi only to be used as timer. But, it did not help my issue(https://issues.asterisk.org/view.php?id=18569). Still getting very huge CPU load. I just could not find how to reproduce it.

By: Leif Madsen (lmadsen) 2011-04-14 10:12:28

Closing as a duplicate.