LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   top command shows 249% usage (https://www.linuxquestions.org/questions/linux-server-73/top-command-shows-249-usage-623697/)

pudhiyavan 02-25-2008 09:08 AM

top command shows 249% usage
 
hi when i run top command it shows me



PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12690 root 19 0 526m 125m 19m S 227 6.2 8677:24 java
10224 root 18 0 957m 209m 19m S 167 10.5 6825:37 java
13240 root 24 0 391m 92m 16m S 0 4.6 22:25.25 java


why is it showing 227 / 167, how to fine tune it?

timnp 02-25-2008 10:36 AM

I think if you have more than one processor or core and the process is multithreaded then it can go over 100%.

Ie, if you have a quad-core machine and your process is consuming the entirity of two cores then it will show as using 200% of your CPU. If the process is using all of all the cores then it will show as 400%.

As to how to make it use less, it really depends on your app, what is it?

mtimbro 02-25-2008 12:32 PM

top
 
Hiya,

When you run top, press '1'...Check on top, you'll see more info on # of cpu's and their utilization.

Hope this helps,

pudhiyavan 02-26-2008 01:51 AM

Great, thanx for the information you both have provided.

its a dual core machine, when i press 1 it shows me as follows,

Cpu0 : 57.5% us, 40.9% sy, 0.0% ni, 0.7% id, 0.0% wa, 0.0% hi, 1.0% si
Cpu1 : 57.0% us, 41.7% sy, 0.0% ni, 0.7% id, 0.0% wa, 0.0% hi, 0.7% si
Cpu2 : 59.5% us, 39.1% sy, 0.0% ni, 0.7% id, 0.0% wa, 0.0% hi, 0.7% si
Cpu3 : 55.9% us, 42.8% sy, 0.0% ni, 0.7% id, 0.0% wa, 0.0% hi, 0.7% si


how to tweak around with the java application utilises more than 57%, i was expecting around 30 to 40 % of usage.

timnp 02-26-2008 03:35 AM

What is the java application in question? Is it something you have written or is it something someone else has written?

If it isn't time sensitive and it is interfering with your other applications then you could always set its nice level so that it runs at a lower priority.

That said, unless you actually need your CPUs for something else you might as well leave it. Its probably not the best outlook but I dont like to see my fast CPUs being unused, the nearer they are to full utilisation then I know i'm getting my monies worth :)

pudhiyavan 02-26-2008 04:53 AM

java application has been written by someone else, and i am using it with 1.5.03 version,how do i use this nice in linux as well as solaris?

mtimbro 02-26-2008 07:04 AM

nice
 
From the man page:

"If no arguments are given, `nice' prints the current scheduling
priority, which it inherited. Otherwise, `nice' runs the given COMMAND
with its scheduling priority adjusted. If no ADJUSTMENT is given, the
priority of the command is incremented by 10. You must have
appropriate privileges to specify a negative adjustment. The priority
can be adjusted by `nice' over the range of -20 (the highest priority)
to 19 (the lowest)."

An example would be:

$ nice -n 10 nice
10

This would lower the priority of the 'nice' command ;-).

Hope this helps.

pudhiyavan 02-27-2008 12:29 AM

thank you, its really valuable post.. :)


All times are GMT -5. The time now is 03:21 AM.