LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-09-2012, 02:43 PM   #1
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Rep: Reputation: Disabled
processes of high cpu usage


Hi all,

There are few processes using high amount of cpu and restarting these processes did not help to reduce the cpu usage.

Code:
ps -eo pid,user,%cpu,args --sort %cpu

18747 tomcat    108 /opt/java/jre/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Xmx14G -XX:MaxPermSize=512M -Dgpars.poolsize=4 -Djava.security.kr

 7811 tomcat    404 /opt/java/bin/java -Dnop -Xmx5G -server -Dsolr.master.enable=true -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/ent
what else should be done in such situation.
thanks in advance!
 
Old 04-09-2012, 02:51 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Well the root cause of the issue here is java's utilization. Your application may just need more resources than the host it is residing on can provide. The one downside to Java and tomcat as it thinks it can use whatever resources it wants to and if it affects the system it doesn't care. You will need to look at either optimizing your java app or tomcat itself to try and limit the resources it is taking up. Best guess is the current server can't handle the java app that is running on it. Look at stack traces, java dumps, etc.. to help get you in the right direction.
 
Old 04-09-2012, 03:06 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Something is up with the %cpu function in ps. I just did a test, top running on one screen, and your command on the other. The ps is spitting out huge processor usage for processes that are using zero according to top (and are using zero in reality, since they're idle and doing nothing).

Code:
$ ps -eo pid,user,%cpu,args --sort %cpu | tail -1
16819 564      81.9 /usr/local/itt/idl/idl81/bin/bin.linux.x86_64/idl



$ top -p 16819 -b -n 1
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
16819 564       20   0  232m  18m 5600 S  0.0  0.1 153:56.16 idl
What do you get with top?

Last edited by suicidaleggroll; 04-09-2012 at 03:07 PM.
 
Old 04-09-2012, 03:07 PM   #4
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Hi Kustom42,

thanks for the reply.
There are 24 processor listings in /proc/cpuinfo file.
DOes this mean there are 24 processors and so there is only 500% (both 108% for one process and 404% for another process) being used ?and so this is OK ? am i reading the output of the ps -eo command right ?
 
Old 04-09-2012, 03:11 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Just looked at the man page for ps closer, the %cpu flag prints the CPU time divided by the time the process has been running. It's not a real time cpu utilization, it's the cpu utilization averaged over the life of the process. Useful for determining what processes are the heavy hitters on your system, but not useful for determining the current load on the system.

---------- Post added 04-09-12 at 01:12 PM ----------

Quote:
Originally Posted by linuxandtsm View Post
Hi Kustom42,

thanks for the reply.
There are 24 processor listings in /proc/cpuinfo file.
DOes this mean there are 24 processors and so there is only 500% (both 108% for one process and 404% for another process) being used ?and so this is OK ? am i reading the output of the ps -eo command right ?
24 processors (could be 12 with hyperthreading, or it could actually be 24), and you're using 5 of them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] High CPU load, but low CPU usage (high idle CPU) baffy Linux - Newbie 5 03-13-2013 10:24 AM
High CPU usage!! anishkumarv Linux - Server 1 10-19-2011 11:06 AM
High load and high cpu kernel usage enid Linux - Server 8 09-30-2010 04:33 AM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 02:14 PM
How can I capping the CPU usage of processes ideasman Linux - Software 0 04-01-2004 04:52 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration