Unix: Top command (processes)

Thread Tools
 
Search this Thread
 
Old Oct 14, 2007 | 06:20 PM
  #1  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Unix: Top command (processes)

Can someone explain to me the difference between CPU(s) 32.2% us and down below where %CPUs says 135? Am I using 32% of my processing power, or am I using 135% which means my system is overloaded? Thanks!

Cpu(s): 32.2% us, 12.9% sy, 0.0% ni, 54.9% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 786432k total, 410308k used, 376124k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30571 mysql 15 0 115m 22m 3632 S 135 2.9 51:47.95 mysqld
32110 nobody 15 0 12736 6604 2440 S 2 0.8 0:04.59 httpd
32150 nobody 15 0 12904 7024 2692 S 2 0.9 0:05.90 httpd
32162 nobody 16 0 12060 5624 2120 R 2 0.7 0:05.27 httpd
32104 nobody 15 0 11872 5440 2124 S 1 0.7 0:05.78 httpd
 
Reply
Old Oct 14, 2007 | 10:38 PM
  #2  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
What distro are we talking about?
 
Reply
Old Oct 15, 2007 | 01:18 AM
  #3  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
You're just trying to sound cool aren't you Dzervit? It's just TOP for crying out loud. lol

CentOS 4.x operating system
 
Reply
Old Oct 15, 2007 | 09:31 AM
  #4  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
TOP is slightly different depending on the distro. I couldn't dig up anything specific on CentOS....

Anywho, my guess was/is a bug. The value cannot go over 100%, period. The thread simply cannot be using 135% of the CPUs time.

Many distros have had bugs with multi-core CPU's and newer processors.
 
Reply
Old Oct 15, 2007 | 11:31 AM
  #5  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Here's what it says at this second. 50.3% and 247. *sigh* There are 4 processors on the box.

We're slowly getting lag issues and plan for extensive growth in the near term. I am trying to figure out if throwing more memory into the hybrid-VPS is going to meet my needs or if I need to go dedicated on my server.

Cpu(s): 50.3% us, 30.3% sy, 0.0% ni, 19.4% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 786432k total, 459960k used, 326472k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30571 mysql 15 0 131m 35m 3764 S 247 4.7 1281:03 mysqld
10212 nobody 15 0 12092 5452 1916 S 1 0.7 0:02.03 httpd
31960 nobody 16 0 13236 7076 2480 R 1 0.9 2:33.76 httpd
32068 nobody 15 0 13584 7880 2872 S 1 1.0 2:33.85 httpd
32076 nobody 16 0 13432 7756 2900 R 1 1.0 2:37.18 httpd
5387 nobody 15 0 12924 6420 2140 S 1 0.8 0:09.91 httpd
30478 nobody 16 0 12892 6472 2136 S 1 0.8 0:08.09 httpd
 
Reply
Old Oct 15, 2007 | 12:42 PM
  #6  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
Paste the results from "cat /proc/cpuinfo "

Is it possible your not using an SMP kernel?
 
Reply
Old Oct 15, 2007 | 12:46 PM
  #7  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Basically says this 4 times, one for each CPU

processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 65
model name : Dual-Core AMD Opteron(tm) Processor 2212 HE
stepping : 2
cpu MHz : 1999.872
cache size : 1024 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni
bogomips : 4003.83
 
Reply

Trending Topics

Old Oct 15, 2007 | 12:55 PM
  #8  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
Well that's good. Nothing wrong there. I'd say your box is just fine. However, without a proper baseline before and now you cannot be sure. But you already knew that, right?

Great article: http://www.linuxjournal.com/article/9001

Mentions the difference between CPU% and CPU load numbers, which I kinda think is what the 135 number represents, but since the header row says % I'm still a bit confused. I think a programmer screwed up or its a bug.

Anywho, get some trend info and don't worry about that silly column in TOP.
 
Reply
Old Oct 15, 2007 | 01:02 PM
  #9  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Lord Vader sent me this link

http://www.cyberciti.biz/tips/how-do...ilization.html

Most of the commands there are showing me that on average we're just utilizing about 30% of the processor power. So I'll give the memory a shot and go from there. Thanks

UC
 
Reply
Old Oct 15, 2007 | 01:13 PM
  #10  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
So what makes you think memory will help? Ahhh, whatever, its cheap...
 
Reply
Old Oct 15, 2007 | 01:31 PM
  #11  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Originally Posted by dzervit
So what makes you think memory will help? Ahhh, whatever, its cheap...
Well it's like $20 per month but still tame compared to dedicated hosting. I'll be paying $135 per month for my plan. The game is getting 2000 uniques a day, 400+ players per hour and about 140 actives every 5 minutes. It seems that lag starts getting complaints when the memory reaches about 75%. From what I am looking at, we shouldnt need either CPU or memory, but when you start getting a bunch of complaints, you have to take that into consideration. Any other ways to speed up mySQL queries and table locking are always welcome.

In the past, memory upgrades have done the trick. The other thing that really helped was query optimization and database re-structuring. But I've done about all I can do on that front.

But even this will be a short term band-aid.
 
Reply
Old Oct 15, 2007 | 01:44 PM
  #12  
BROTHERDAVE's Avatar
Senior Member
25 Year Member
Joined: Aug 2000
Posts: 1,759
Likes: 4
From: Friendswood Texas
urban, did you ever figure out why your truck was overheating?
 
Reply
Old Oct 15, 2007 | 03:21 PM
  #13  
UrbanCowboy's Avatar
Thread Starter
|
Senior Member
Joined: Mar 2000
Posts: 481
Likes: 0
From: Westminster, CO
Turns out the fan clutch was shot. I was in the middle of testing the fan clutch when the water pump seal gave out. I didnt have time for that job so had to take it into the shop at that point for a new water pump and new clutch. I think I was out about $700 if you include the new thermostat I had put in. The shop's labour rate was reasonable but they screwed me on the parts cost. Wish I would have brought in my own parts.
 
Reply




All times are GMT -4. The time now is 04:27 AM.