Solved

Restrict the resource utilization on one process in Linux

Posted on 2010-11-27
3
589 Views
Last Modified: 2012-06-21
Today I noticed that in one production server running with Redhat OS, the Java process is utilizing more than 100% of CPU resource (please check the attached screen shot). I digged into that process by running 'lsof -p' command on it and listed out several number of files it access. Then I checked Memory/Swap usage and its not being used much. Log files didn't report any errors. Please let me know is there anything that I can do to bring out the CPU utilization of this process (without stopping it). Is there a way that I can implement restriction on a particular process from using more system resources such as CPU & Memory. Incase if we don't have such option, is it fine to allow the server to run with > 100% CPU utilized by a single process ?

[root@appllm04 deploy]# cat /proc/cpuinfo | grep -i Processor
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7
[root@appllm04 deploy]# free -m
             total       used       free     shared    buffers     cached
Mem:         16054      10299       5755          0        243       3243
-/+ buffers/cache:       6812       9242
Swap:        18047          0      18047
[root@appllm04 deploy]# uname -a
Linux appllm04 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
[root@appllm04 deploy]#
appllm04.JPG
0
Comment
Question by:ashsysad
3 Comments
 
LVL 5

Accepted Solution

by:
RizyDeWino earned 300 total points
ID: 34224943
As you have 8 cores thus the total power you have is 800% if talk in terms of percent. So the 114% this process is taking is out of that 800%  and the total usage is 16% ( in top headers ) which is not high and you should not be worried about it.  Restricting the CPU usage for the process is going to affect the any processes/application its serving.

In general you can reduce CPU usage for any running process using nice/renice command , by giving a nice value to the process, the higher the value the less CPU share the process will get.

Second way could be implementing something like CloudLinux which is allows you to restrict resource usage for processes and application pools , by running apps/process under certain group.

But in general I don't think you need any of these two to restrict the CPU usage as the CPU usage on your server is fine. 114% out of total 800% available resource is not high.
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 100 total points
ID: 34228911
You can renice any running process which interferes with others.
j:rockit JVM is a lot faster than default.
check cpufreq-info output - probably it does not even spin up CPUs fully....
you might check if load averages reach 100 - that would mean your system gets overloaded and loses interactivity, until then you can try torturing benchmarks just to confirm your system is well tuned by default...
0
 

Author Closing Comment

by:ashsysad
ID: 34337262
Thanks for helping me !!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ORA-00972: identifier is too long from Unix but not from Windows in SQLPLUS 17 97
SMB share across internet 15 64
RHEL 6.7 Gnome Desktop on VMware 6 VM 9 63
Apache module 5 42
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question