Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I was trying to only allow 6 mb of memory to be used by a certain user's programs.
The program I am most interested in limitting is one that runs in the background.
I set the info in the /etc/security/limits.conf to look like this:
<username> hard rss 6144
I also tried <username> hard memlock 6144
But nothing worked.
He was running about 11.4 percent of my 360 mb, which is much more than 6144 kb, but it didn't kill his task.
Any help on how to stop this and how to limit the programs in the future is appreciated.
As noted, the ulimit command is useful for imposing limits upon a program that you think might "run away." (Or for testing its operation when you plan to deploy to a shared-host which does impose process limits.)
Also useful is the quota facility.
But bear in mind: when a process "runs away" or is inefficiently designed, "it's never pretty what happens next, on any operating system..."
I see what you mean.
However, is there any way to do this with pam?
Also, with ulimit, how do I set it on a per user basis.
And then, I have two users: user1 and user2 let's call them.
User1 has a program called moo.
User2 also has a program called moo.
If I set a memory limit of 6 mb on the user1's moo, will it also impose this limit on user2's moo? for this is not what I want.
cgroups is an in-kernel solution that is not well documented, and hardly worth the effort on small systems. It is based on the container model, but uses pid for selection. This can make it an administrative burden. I have used it to quarantine certain workloads to a subset of available CPUs, but there is also a memory controller. Recent Ubuntus seem to have the requisite kernel options enabled.
Documented in the kernel source tree at ../Documentation/cgroups - look here for an online copy.