Solved

Restrict the resource utilization on one process in Linux

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.

867 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

17 Experts available now in Live!

Get 1:1 Help Now