LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2009, 04:19 AM   #1
humbletech99
Member
 
Registered: Jun 2005
Posts: 374

Rep: Reputation: 30
Throttling Process Resource Consumption


Is there a way of throttling a process resources, something akin to limits but for processes not users?

ie I want processX to be restricted in the amount of memory it can consume. For process cpu I guess I can simply nice the process, but total memory consumption is my primary concern.
 
Old 03-05-2009, 06:08 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Reasoning the other way around: Linux (kernel) does VMM pretty OK. And forcing an application to run in a suboptimal way is like creating artifical bottlenecks. Why would you want to disrupt it and sacrifice speed, efficiency and such? Can you be more specific about the application in question, how much memory it hogs and how much you've got? Forcing an application that relies on using a large chunk of memory for caching is unrealistic. Or is it by any chance Java based (which should accept -X and such)?
 
Old 03-05-2009, 07:49 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Just the job for containers and cgroups (nee cpusets).
Go have a look in your kernel source tree for ../Documentation/cpusets.txt, ../Documentation/cgroups/*.txt and ../Documentation/controllers/*.txt
You get the idea. It took a while for this container paradigm to get accepted beyond the cluster folks, but it's now progressing in the general user population as well.
 
Old 03-06-2009, 10:35 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,647
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
You might find it to be even simpler. The bash shell contains a ulimit command which can impose limits upon the programs that are subsequently run. You can set two kinds of limits: soft and hard. This lets you give the program "a shot across the bow" to let it know that it's about to hit the fence.

The softlimit command is also commonly used, e.g. by web hosting companies, to impose more stringent limits upon, say, CGI programs... or upon user shells.

Most Linuxes implement the quota system for billing and resource-metering purposes.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
process run out of resource ust Linux - Software 1 06-13-2008 02:15 AM
how to see the resource consumption of shared libraries in /proc, linuxdoniv Programming 1 03-23-2008 08:14 PM
Limitation of process memeory consumption on Linux james_chao_2000 Programming 16 03-20-2006 02:45 AM
process memory consumption ilnli Linux - General 4 09-08-2005 07:13 PM
Determine process memory consumption ? shayer009 Linux - General 1 10-28-2004 02:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration