Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Asterisk 13 High CPU usage


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
djchillerz at gmail.com
Guest





PostPosted: Thu Jul 21, 2016 6:03 pm    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

Hi all,
I was using 13.5 but upgraded today to 13.9 (13.10 came out a few hours after I upgraded).
On both 13.5 and 13.9 asterisk seems to use 100% of the CPU. This usually happens a few hours after starting asterisk. A restart of asterisk gets the CPU back down, but only for a little while.
There asterisk box has no call traffic flowing through it, just 15 or so registrations.
I'm sure this is not best practise but for now I am using chan_sip and pjsip at the same time. My pjsip endpoints are using TLS.
I am not sure where to start looking in order to debug the CPU usage by asterisk and would very much appreciate some guidance.
Kind regards,
Chirag
Back to top
rmudgett at digium.com
Guest





PostPosted: Thu Jul 21, 2016 6:13 pm    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

On Thu, Jul 21, 2016 at 6:02 PM, Chirag Desai <djchillerz@gmail.com (djchillerz@gmail.com)> wrote:
Quote:

Hi all,
I was using 13.5 but upgraded today to 13.9 (13.10 came out a few hours after I upgraded).
On both 13.5 and 13.9 asterisk seems to use 100% of the CPU. This usually happens a few hours after starting asterisk. A restart of asterisk gets the CPU back down, but only for a little while.
There asterisk box has no call traffic flowing through it, just 15 or so registrations.
I'm sure this is not best practise but for now I am using chan_sip and pjsip at the same time. My pjsip endpoints are using TLS.
I am not sure where to start looking in order to debug the CPU usage by asterisk and would very much appreciate some guidance.
Actually v13.10 has some changes to address high CPU usage in regards to pjsip.

Also you should look here for more information:
http://blogs.asterisk.org/2016/07/13/asterisk-task-processor-queue-size-warnings/


Richard
Back to top
tzafrir.cohen at xorco...
Guest





PostPosted: Sun Jul 24, 2016 7:39 am    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

On Fri, Jul 22, 2016 at 12:02:43AM +0100, Chirag Desai wrote:

Quote:
I am not sure where to start looking in order to debug the CPU usage by
asterisk and would very much appreciate some guidance.

If you run 'top', the basic information would be to show per-CPU
information (press '1'). Another thing to look at: press 'H' to get
per-thread entries. Do you have many many threads each taking a small
part of a core, or a few threads taking lots of CPU time?

I believe that the PID (process/thread ID) you see in top is also the
second item in each line in the output of 'core show threads'. So this
could give you some clues regarding the CPU hogs you see in top.

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen@xorcom.com
+972-50-7952406 mailto:tzafrir.cohen@xorcom.com
http://www.xorcom.com

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
ian.gilmour.x at gmail...
Guest





PostPosted: Sun Jul 24, 2016 12:39 pm    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

The following bash 1-liner may be useful...
while true; do top -Hbc -p `pgrep asterisk` -n 1 && asterisk -rx "core show threads"; sleep 1; done
Regards,
Ian
On 24/07/2016 13:39, Tzafrir Cohen wrote:

Quote:
On Fri, Jul 22, 2016 at 12:02:43AM +0100, Chirag Desai wrote:

Quote:
Quote:

I am not sure where to start looking in order to debug the CPU usage by asterisk and would very much appreciate some guidance.

If you run 'top', the basic information would be to show per-CPU information (press '1'). Another thing to look at: press 'H' to get per-thread entries. Do you have many many threads each taking a small part of a core, or a few threads taking lots of CPU time? I believe that the PID (process/thread ID) you see in top is also the second item in each line in the output of 'core show threads'. So this could give you some clues regarding the CPU hogs you see in top.
Back to top
tzafrir.cohen at xorco...
Guest





PostPosted: Mon Jul 25, 2016 6:21 am    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

On Sun, Jul 24, 2016 at 06:39:19PM +0100, ian gilmour wrote:
Quote:
The following bash 1-liner may be useful...

while true; do top -Hbc -p `pgrep asterisk` -n 1 && asterisk -rx "core show
threads"; sleep 1; done

Just for the kicks:

ps --no-headers -L -o lwp,cp --sort lwp `pidof asterisk` \
| join -1 1 -2 2 - <(asterisk -rx 'core show threads' | sort -k2) \
| sort -n -k 2

Notes:
1. Bashism. <(...) requires bash.
2. Join counts on a non-numeric sort. Maybe there's an extrs sort needed
for ps, as I guess it sorts numerically.
3. I tried puting this all in watch: watch -n1 -d '...' or
watch -n1 -d bash -c "...", but I got an error message:
"sh: 1: Syntax error: "(" unexpected"

(sh? shouldn't it be bash?)

But at this point I have already exceeded the allocated time slot.

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen@xorcom.com
+972-50-7952406 mailto:tzafrir.cohen@xorcom.com
http://www.xorcom.com

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
djchillerz at gmail.com
Guest





PostPosted: Sat Aug 06, 2016 11:13 am    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

Quote:
All,I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.Right now, there are no calls on the box at all.top shows me this:PR 20NI 0VIRT 1570540RES 84620SHR 26296S SI upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
0
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
1
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
2
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
3
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
4
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
5
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
6
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
7
Quote:
I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a day.
8
Back to top
mjordan at digium.com
Guest





PostPosted: Tue Aug 09, 2016 9:59 am    Post subject: [asterisk-users] Asterisk 13 High CPU usage Reply with quote

On Sat, Aug 6, 2016 at 11:13 AM, Chirag Desai <djchillerz@gmail.com> wrote:
Quote:
All,

I upgraded to asterisk 13.10. I have minimal load on the box. 20-30 calls a
day.

Right now, there are no calls on the box at all.

top shows me this:

PR 20

NI 0

VIRT 1570540

RES 84620

SHR 26296

S S

%CPU 99.7

%MEM 8.4

TIME+ 3468:39

COMMAND asterisk

When I run this command
while true; do top -Hbc -p `pgrep asterisk` -n 1 && asterisk -rx "core show
threads"; sleep 1; done

I get this

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29079 root 20 0 1570540 84620 26296 R 37.5 8.4 1178:31 asterisk
29010 root 20 0 1570540 84620 26296 R 31.2 8.4 1197:07 asterisk
29047 root 20 0 1570540 84620 26296 R 31.2 8.4 1186:48 asterisk

Any ideas??


--------------------

Previous message
--------------------


Hi all,

I was using 13.5 but upgraded today to 13.9 (13.10 came out a few hours
after I upgraded).

On both 13.5 and 13.9 asterisk seems to use 100% of the CPU. This usually
happens a few hours after starting asterisk. A restart of asterisk gets the
CPU back down, but only for a little while.

There asterisk box has no call traffic flowing through it, just 15 or so
registrations.

I'm sure this is not best practise but for now I am using chan_sip and
pjsip at the same time. My pjsip endpoints are using TLS.

I am not sure where to start looking in order to debug the CPU usage by
asterisk and would very much appreciate some guidance.

Kind regards,

Chirag

Hi Chirag -

That does seem a bit odd. If you have 'core show threads', then you do
have DEBUG_THREADS enabled, which can cause a pretty hefty performance
hit - but I still wouldn't expect your CPUs to just be sitting there
spinning.

Can you get a backtrace of the threads? [1] Make sure you have
DONT_OPTIMIZE and BETTER_BACKTRACES enabled. That should show us what
the threads are doing, which would give us a better idea of what is
spending all the time processing things.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

--
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services