RE: [Asterisk-Users] question about CPU usage

2004-03-24 Thread Martin Pycko
try to do ps -auxm to list all the threads of the asterisk.
Then connect with gdb to the thread that takes 99% of CPU and find out
what it's doing.

Martin

On Mon, 22 Mar 2004, Bill Hamlin wrote:

 Nope same problem.  I just started it and did a couple of ps aux's and got
 this output:


 [EMAIL PROTECTED] root]# ps aux|grep ast
 root 20140 91.6  1.3 115880 6676 ?   R15:43   1:10
 asterisk -vgcd
 root 20221  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
 [EMAIL PROTECTED] root]# ps aux|grep ast
 root 20140 92.3  1.3 115880 6676 ?   R15:43   1:13
 asterisk -vgcd
 root 20223  0.0  0.1  3568  624 pts/2S15:44   0:00 grep ast
 [EMAIL PROTECTED] root]# ps aux|grep ast
 root 20140 91.7  1.3 115880 6676 ?   R15:43   1:16
 asterisk -vgcd
 root 20225  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
 [EMAIL PROTECTED] root]# ps aux|grep ast
 root 20140 92.4  1.3 115880 6676 ?   R15:43   1:18
 asterisk -vgcd
 root 20227  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
 [EMAIL PROTECTED] root]# ps aux|grep ast
 root 20140 92.6  1.3 115880 6676 ?   R15:43   1:20
 asterisk -vgcd
 root 20229  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
 [EMAIL PROTECTED] root]#





  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of Scott Stingel
  Sent: Monday, March 22, 2004 4:36 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [Asterisk-Users] question about CPU usage
 
 
  I think Steve is referring to the following line:
 
  export LD_ASSUME_KERNEL=2.4.1
 
  If you put this in your command line before starting asterisk,
  you will get
  around the RH9 problem of leaving zombies when AGI processes quit.  Other
  than that, I don't think it influences CPU load.
 
  Note that the line is not necessary for Fedora Core 1
 
  regards
  Scott
 
  Scott M. Stingel
  Emerging Voice Technology Inc.
  Palo Alto, California and London, England
 
  Email:  scott at evtmedia.com
  URL:www.evtmedia.com
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of Bill Hamlin
  Sent: Monday, March 22, 2004 9:22 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [Asterisk-Users] question about CPU usage
  
  What is it about asterisk that makes this happen?  My other
  apps that wait
  on a select take hardly any CPU time at all.
  
  I didn't find anything like ldassume using google.  Can you
  tell me more
  about that?
  
  Thanks,
  Bill.
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] Behalf Of Steven
   Critchfield
   Sent: Monday, March 22, 2004 4:07 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [Asterisk-Users] question about CPU usage
  
  
   On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
I've had my asterisk running for a couple of weeks and just
   noticed that it
takes about 98% of the CPU time (Linux RH9).  Is this what you
   would expect?
Is it just that the program is polling for things to do,
   calling sleep(0)
or something simlar so as to relinquish the machine but
   otherwise polling
like crazy?
  
   Do a google search. I believe there is a export line you
  need for RH to
   behave more sanely. Something like ldassume_2_4_1. Or you
  could switch
   to a more free distro and it will fix itself.
   --
   Steven Critchfield  [EMAIL PROTECTED]
  
   ___
   Asterisk-Users mailing list
   [EMAIL PROTECTED]
   http://lists.digium.com/mailman/listinfo/asterisk-users
   To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
  
  
  ___
  Asterisk-Users mailing list
  [EMAIL PROTECTED]
  http://lists.digium.com/mailman/listinfo/asterisk-users
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
  
  
 
  ___
  Asterisk-Users mailing list
  [EMAIL PROTECTED]
  http://lists.digium.com/mailman/listinfo/asterisk-users
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] question about CPU usage

2004-03-24 Thread Jason Becker
Back in February I found * pinning the CPU (Slackware 9.1, Feb CVS). I 
ran a strace and found that it was looping on this:


-begin-

write(1, \nUse STOP NOW to shutdown Asteri..., 35) = -1 EIO
(Input/output erro
r)
write(1, *CLI , 6)   = -1 EIO (Input/output error)
read(0, , 1)  = 0
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = -1 EIO
(Input/o
utput error)
-end-
Mark kindly responded to me:

-begin-

In the mean time try running asterisk with no console.  This is bug #864.
Preliminary analysis shows that after a restart now, one of the
ioctl()'s performed by editline fails with -1.  Ignoring the ioctl made
the CLI non-functional.  Happy to get any help I can in this regard.
-end-

Hope this helps.

Cheers

Martin Pycko wrote:

try to do ps -auxm to list all the threads of the asterisk.
Then connect with gdb to the thread that takes 99% of CPU and find out
what it's doing.
Martin

On Mon, 22 Mar 2004, Bill Hamlin wrote:

 

Nope same problem.  I just started it and did a couple of ps aux's and got
this output:
[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 91.6  1.3 115880 6676 ?   R15:43   1:10
asterisk -vgcd
   

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Steven Critchfield
On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
 I've had my asterisk running for a couple of weeks and just noticed that it
 takes about 98% of the CPU time (Linux RH9).  Is this what you would expect?
 Is it just that the program is polling for things to do, calling sleep(0)
 or something simlar so as to relinquish the machine but otherwise polling
 like crazy?

Do a google search. I believe there is a export line you need for RH to
behave more sanely. Something like ldassume_2_4_1. Or you could switch
to a more free distro and it will fix itself. 
-- 
Steven Critchfield  [EMAIL PROTECTED]

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Bill Hamlin
What is it about asterisk that makes this happen?  My other apps that wait
on a select take hardly any CPU time at all.

I didn't find anything like ldassume using google.  Can you tell me more
about that?

Thanks,
Bill.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Steven
 Critchfield
 Sent: Monday, March 22, 2004 4:07 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [Asterisk-Users] question about CPU usage


 On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
  I've had my asterisk running for a couple of weeks and just
 noticed that it
  takes about 98% of the CPU time (Linux RH9).  Is this what you
 would expect?
  Is it just that the program is polling for things to do,
 calling sleep(0)
  or something simlar so as to relinquish the machine but
 otherwise polling
  like crazy?

 Do a google search. I believe there is a export line you need for RH to
 behave more sanely. Something like ldassume_2_4_1. Or you could switch
 to a more free distro and it will fix itself.
 --
 Steven Critchfield  [EMAIL PROTECTED]

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Scott Stingel
I think Steve is referring to the following line:

export LD_ASSUME_KERNEL=2.4.1

If you put this in your command line before starting asterisk, you will get
around the RH9 problem of leaving zombies when AGI processes quit.  Other
than that, I don't think it influences CPU load.

Note that the line is not necessary for Fedora Core 1

regards
Scott

Scott M. Stingel 
Emerging Voice Technology Inc.
Palo Alto, California and London, England

Email:  scott at evtmedia.com  
URL:www.evtmedia.com  

 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Hamlin
Sent: Monday, March 22, 2004 9:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [Asterisk-Users] question about CPU usage

What is it about asterisk that makes this happen?  My other 
apps that wait
on a select take hardly any CPU time at all.

I didn't find anything like ldassume using google.  Can you 
tell me more
about that?

Thanks,
Bill.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Steven
 Critchfield
 Sent: Monday, March 22, 2004 4:07 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [Asterisk-Users] question about CPU usage


 On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
  I've had my asterisk running for a couple of weeks and just
 noticed that it
  takes about 98% of the CPU time (Linux RH9).  Is this what you
 would expect?
  Is it just that the program is polling for things to do,
 calling sleep(0)
  or something simlar so as to relinquish the machine but
 otherwise polling
  like crazy?

 Do a google search. I believe there is a export line you 
need for RH to
 behave more sanely. Something like ldassume_2_4_1. Or you 
could switch
 to a more free distro and it will fix itself.
 --
 Steven Critchfield  [EMAIL PROTECTED]

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Ed Rubright
Bill,

I think your looking for setting the environment variable
LD_ASSUME_KERNEL=2.4.1.

If I remember correctly this effectively disables the new NTPL (new
threading model) in RH9.

Hope this helps.

Ed

 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Hamlin
Sent: Monday, March 22, 2004 1:22 PM
To: [EMAIL PROTECTED]
Subject: RE: [Asterisk-Users] question about CPU usage

What is it about asterisk that makes this happen?  My other apps that wait
on a select take hardly any CPU time at all.

I didn't find anything like ldassume using google.  Can you tell me more
about that?

Thanks,
Bill.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Steven 
 Critchfield
 Sent: Monday, March 22, 2004 4:07 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [Asterisk-Users] question about CPU usage


 On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
  I've had my asterisk running for a couple of weeks and just
 noticed that it
  takes about 98% of the CPU time (Linux RH9).  Is this what you
 would expect?
  Is it just that the program is polling for things to do,
 calling sleep(0)
  or something simlar so as to relinquish the machine but
 otherwise polling
  like crazy?

 Do a google search. I believe there is a export line you need for RH 
 to behave more sanely. Something like ldassume_2_4_1. Or you could 
 switch to a more free distro and it will fix itself.
 --
 Steven Critchfield  [EMAIL PROTECTED]

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] question about CPU usage

2004-03-22 Thread James Coberly
export LD_ASSUME_KERNEL=2.4.1


- Original Message - 
From: Bill Hamlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 22, 2004 4:22 PM
Subject: RE: [Asterisk-Users] question about CPU usage


 What is it about asterisk that makes this happen?  My other apps that wait
 on a select take hardly any CPU time at all.

 I didn't find anything like ldassume using google.  Can you tell me more
 about that?

 Thanks,
 Bill.

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of Steven
  Critchfield
  Sent: Monday, March 22, 2004 4:07 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [Asterisk-Users] question about CPU usage
 
 
  On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
   I've had my asterisk running for a couple of weeks and just
  noticed that it
   takes about 98% of the CPU time (Linux RH9).  Is this what you
  would expect?
   Is it just that the program is polling for things to do,
  calling sleep(0)
   or something simlar so as to relinquish the machine but
  otherwise polling
   like crazy?
 
  Do a google search. I believe there is a export line you need for RH to
  behave more sanely. Something like ldassume_2_4_1. Or you could switch
  to a more free distro and it will fix itself.
  --
  Steven Critchfield  [EMAIL PROTECTED]
 
  ___
  Asterisk-Users mailing list
  [EMAIL PROTECTED]
  http://lists.digium.com/mailman/listinfo/asterisk-users
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Eric Wieling
On Mon, 2004-03-22 at 15:22, Bill Hamlin wrote:

 I didn't find anything like ldassume using google.  Can you tell me more
 about that?

It's in the RedHat 9 RELEASE NOTES.

-- 
  Eric Wieling * BTEL Consulting * 504-899-1387 x2111
In a related story, the IRS has recently ruled that the cost of Windows
upgrades can NOT be deducted as a gambling loss.

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Bill Hamlin
Nope same problem.  I just started it and did a couple of ps aux's and got
this output:


[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 91.6  1.3 115880 6676 ?   R15:43   1:10
asterisk -vgcd
root 20221  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 92.3  1.3 115880 6676 ?   R15:43   1:13
asterisk -vgcd
root 20223  0.0  0.1  3568  624 pts/2S15:44   0:00 grep ast
[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 91.7  1.3 115880 6676 ?   R15:43   1:16
asterisk -vgcd
root 20225  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 92.4  1.3 115880 6676 ?   R15:43   1:18
asterisk -vgcd
root 20227  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
[EMAIL PROTECTED] root]# ps aux|grep ast
root 20140 92.6  1.3 115880 6676 ?   R15:43   1:20
asterisk -vgcd
root 20229  0.0  0.1  3572  628 pts/2S15:44   0:00 grep ast
[EMAIL PROTECTED] root]#





 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Scott Stingel
 Sent: Monday, March 22, 2004 4:36 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [Asterisk-Users] question about CPU usage


 I think Steve is referring to the following line:

 export LD_ASSUME_KERNEL=2.4.1

 If you put this in your command line before starting asterisk,
 you will get
 around the RH9 problem of leaving zombies when AGI processes quit.  Other
 than that, I don't think it influences CPU load.

 Note that the line is not necessary for Fedora Core 1

 regards
 Scott

 Scott M. Stingel
 Emerging Voice Technology Inc.
 Palo Alto, California and London, England

 Email:  scott at evtmedia.com
 URL:www.evtmedia.com



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Bill Hamlin
 Sent: Monday, March 22, 2004 9:22 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [Asterisk-Users] question about CPU usage
 
 What is it about asterisk that makes this happen?  My other
 apps that wait
 on a select take hardly any CPU time at all.
 
 I didn't find anything like ldassume using google.  Can you
 tell me more
 about that?
 
 Thanks,
 Bill.
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Behalf Of Steven
  Critchfield
  Sent: Monday, March 22, 2004 4:07 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [Asterisk-Users] question about CPU usage
 
 
  On Mon, 2004-03-22 at 14:49, Bill Hamlin wrote:
   I've had my asterisk running for a couple of weeks and just
  noticed that it
   takes about 98% of the CPU time (Linux RH9).  Is this what you
  would expect?
   Is it just that the program is polling for things to do,
  calling sleep(0)
   or something simlar so as to relinquish the machine but
  otherwise polling
   like crazy?
 
  Do a google search. I believe there is a export line you
 need for RH to
  behave more sanely. Something like ldassume_2_4_1. Or you
 could switch
  to a more free distro and it will fix itself.
  --
  Steven Critchfield  [EMAIL PROTECTED]
 
  ___
  Asterisk-Users mailing list
  [EMAIL PROTECTED]
  http://lists.digium.com/mailman/listinfo/asterisk-users
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 
 
 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
 
 

 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] question about CPU usage

2004-03-22 Thread Walker Haddock
On Mon, Mar 22, 2004 at 03:49:29PM -0500, Bill Hamlin wrote:
 I've had my asterisk running for a couple of weeks and just noticed that it
 takes about 98% of the CPU time (Linux RH9).  Is this what you would expect?
 Is it just that the program is polling for things to do, calling sleep(0)
 or something simlar so as to relinquish the machine but otherwise polling
 like crazy?

http://lists.digium.com/pipermail/asterisk-dev/2003-December/002391.html
-- 
   DataCrest, Inc. -- Technically Superior   **
Walker Haddock   http://www.datacrest.com
DataCrest, Inc.e-mail:  [EMAIL PROTECTED]
1634A Montgomery Hwy.phone:  1-888-941-3282, 1-205-335-8589
Birmingham, AL 35216  fax:  1-205-823-7838
***
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users