Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Restrict the resource utilization on one process in Linux

Posted on 2010-11-27
Medium Priority
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]#
Question by:ashsysad
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

RizyDeWino earned 1200 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.
LVL 62

Assisted Solution

gheist earned 400 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...

Author Closing Comment

ID: 34337262
Thanks for helping me !!

Featured Post

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:
Suggested Courses

719 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