Solved

Restrict the resource utilization on one process in Linux

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

776 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