Asterisk - 99% cpu use

i have asterisk 1.4 and it’s not in use yet. but time to time i see that cpu use is 99.3-99.9% by asterisk and it’s not dropping for a long time.

Why is that happeninng and is there a way to check what exactly is asterisk doing when it is using 99% cpu?

thanks

Did you connect to asterisk -r, then have your connection dropped? I had this problem when a remote console session lost TTY. Try

and kill the one with ‘r’.

i killed it “rasterisk r” but it did not help… it stops only when i killed “asterisk -vvvvc” process.

may that is because i start asterisk with “asterisk -vvvvc”? here is my results

root 14322 67.6 1.4 17608 7392 ? Rl Mar22 744:04 asterisk -vvvvc
root 18936 0.0 0.2 4400 1508 pts/0 S+ 12:11 0:00 rasterisk r

why is it happening? and how can I prevent it?

thanks

Hi

My guess is theres a loop in the dial plan somewhere. You need to find out whats going on whe it goes to 99%.

Ian

is there anyway to find out?

thanks

well set verbose and debug to 99

then keep an eye on the console

aslo look through the full log to see if anything shows up.

clasic can be the h extension doing an odd thing.

this is very strange, while i’m working with asterisk (the whole day) and keeping eye on everything, asterisk works just fine,

but after every night, in morning when i check asterisk 99.9% cpu.

I checked log and last record was, the thing i did last, and everything was fine. Any ideas?

Thanks

Cron jobs ?
check the secure or auth log and the messages log.

Ian

no cron jobs…

checked the logs and there is nothing…

yessss… i found, when is it doing this,.

  1. login to my server with putty
  2. start asterisk with “asterisk -vvvvc”
  3. then send command “!” to go back to bash
  4. clossing putty. right there asterisk going to 99% cpu

how do i resolve it? thanks.

That’s exactly where I got the problem - escaping into a shell. Haven’t dug deep into it. Simply remember to go in and kill that runaway “asterisk” as soon as you notice the death of login. In fact, much of the time, my last ssh session was still open so I only needed to kill that sshd.

I fugured the way to start. /etc/rc.d/init.d/aterisk start - i did not see at anywhere on the web, so i’m not sure if this is the right way to start asterisk… does anybody know?

that’s probably the easiest way to start Asterisk … it’s what the “make config” option does.

as for using “!” to “go back to bash” … doesn’t it spawn a new shell instance ? isn’t “exit” more appropriate to get back to the shell ?

ok… problem again… /etc/rc.d/init.d/aterisk is not there any more… unbelivable… what’s the other way to start asterisk ON BOOT?

thanks

an entry in /etc/rc.d/rc.local ?

i do not have file “asterisk” in my /etc/rc.d/init.d anymore… i dont’ know why… i tried reinstalling asterisk but file is showing up… very strange… what’s the alternatives to start asterisk?

make configure will install the RC file. Many people think that safe_asterisk (and the RC file) is too unsafe. But they do not seem to cause the escape shell issue. Must be something in the escape code.