Solved

Restrict the resource utilization on one process in Linux

Posted on 2010-11-27
3
576 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 61

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machineā€¦
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now