Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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)?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.