Cpu @ 100%

Derrick32

Member
Joined
Jul 22, 2009
Messages
144
Reaction score
3
Hello all,

Quick question, is it normal for me to see Asterisk running my CPU at 100% pretty much all the time?? I have an Intel Pentium 4 CPU 3.00GHz.

Thanks,

Derrick
 
Depends how many calls you're pushing though :-) - but in general no.

Can you log on to the server and run 'top' to see what process/s are using the CPU
 
Sorry, I should read more closely.

Normally I would expect the asterisk process to max out the CPU only if it was transcoding a lot of concurrent calls?
 
You want your resources used but not overused

You want your CPU to be used, so 100% is fine, so long as it's not always at 100%. If it never gets higher than, say, 50%, then you have a CPU that's twice as powerful as it needs to be, and so you spent twice as much more money than you needed to. :-)

But to truly answer your question, bucasia is right - we need more information. Run top (type "top" at the command line) when it's happening, and then hit "q" to quit the display. Copy and paste that output here and we can take a better look.

Questions that need to be answered:
Does this happen all of the time or only when making/taking calls? (If it's all the time, something's probably wrong with the box.)
What else is the box doing? DNS? Mail? Web? Is it physical or virtual?
If it's only while doing calls, we'll need to know how many calls, what trunking technology (SIP, IAX, Zap, etc) is used for them, and what codecs (ulaw, g.729, GSM, etc) are being used?
 
i disagree. cpu power is enough nowadays that there is nothing wrong with a lightly-used box. if you are hitting 100% for more than a few seconds, other applications will be delayed, potentially impacting sound quality.
 
I was being somewhat cynical. The point being that you want your processor and memory to be used, or else you paid for resources that you're not using. That's over allocating and, outside of the "personal" computer world, can get very expensive.

To the point of answering the question though, I'm sure that a 3GHz P4 should be able to handle a few calls easily enough, so there must be something else going on.
 
well, sure, but unless you are dealing with a box with a gross number of conversations and/or lots of transcoding going on, even a low-end cpu nowadays should not break a sweat :)
 
Just because FreePBX reports CPU usage at 100% doesn't mean it really is. Run top at the command prompt and see what you get.
 
I think you're missing my point. I'm saying exactly what you are: There is no reason that a 3GHz Pentium 4 should be running at 100% most of the time on a personal Asterisk server.

Hence my comment that "something must be wrong."


well, sure, but unless you are dealing with a box with a gross number of conversations and/or lots of transcoding going on, even a low-end cpu nowadays should not break a sweat :)
 
I've seen that on my own system too. "amportal stop" followed by "amportal start" cleared it out. I don't know what the circumstances were at the time, but I seem to remember that it was after applying some changes or updates through the freepbx control panel.
 
What does FreePBX report?

Just because FreePBX reports CPU usage at 100% doesn't mean it really is. Run top at the command prompt and see what you get.

Hi Ward

This comment interests me, we have an issue where FreePBX GUI shows the processor at 100% every 5 to 10 seconds - however top shows a max of 2 maybe 3% processor utlitsation....

WHat is FreePBX reporting?

Cheers
David
 
Reinstalled

It was pegging the processors at 100% basically all the time.. Could not have been normal activity.. There were NO calls going on and it was always pegged. On the new install i rarely hit a 100%, with a Intel(R) Pentium(R) 4 CPU 3.00GHz theres no way at idle it should get to 100%..

Sorry for the lag in response i thought i set this post to send me updates if i got replies.. guess not.

Derrick
 
Just because FreePBX reports CPU usage at 100% doesn't mean it really is. Run top at the command prompt and see what you get.

I'm seeing this issue. Top tells me that the system is 95 - 99% idle, but FreePBX show 100% spikes every minute or so.

Why are the two different? Which should I believe?
 
I would believe top (or munin, if it's installed) over whatever the FreePBX status page reports.

I remember seeing something about javascript being an issue with the FreePBX status page.

On one of our old trixbox servers, it did this very thing. CPU 100%, no network traffic - alway 0.00k/s - load average value was normal, however.
 
Run uptime

This will give you the current load, and average loads for 5 and 15 minutes.

If you have one processor it should be under 1.0, if you have 2 processors (or dual core or hyper-threading) it should be under 2.0

This will give you the most accurate reading
 
I've found that if you go to the FreePBX System Status module, you'll see the proper CPU utilization that corresponds to top's. When you go back to the main menu, it clears the 100% CPU and it works properly. Don't know why but it works.
 
There was a bug with FreePBX a while back that caused the status screen to show high CPU - freepbx.org/v2/ticket/3614

It was purely cosmetic, rather than indicating a high cpu usage problem. It could be that you are seeing?
 
I see 100% CPU on the boxes I have. And these boxes are doing basically nothing. I have Webmin running and always shows Asterisk pegging the needle. An AMPORTAL RESTART solves it but it's very inconvenient.

Leon
 
Amportal restart did nothing to resolve my CPU issue, I believe its just a bug in FreePBX.

I ran the sar command "sar -u 2 50" and Im seeing 98%+ idle all the time.
 
I've seen this behavior at some boxes that I manage, and asterisk CLI shows a VM loop of some type. Restarting asterisk solve the issue, but eventually it comes back.....
 

Members online

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top