[K12OSN] Memory limit per user?

Dennis Daniels ddaniels at magic.fr
Fri May 28 03:22:16 UTC 2004


I've wikified this conversation: 
http://www.k12ltsp.org/phpwiki/index.php/limiting%20processes

Of course if anyone objects feel free to edit the page.

I'm just trying to help make K12ltsp a little easier for the next person :)

best
Denny

Calvin Dodge wrote:
> Robert Arkiletian wrote:
> 
>> I know disk quotas for each user can be implemented by having /home on 
>> a seperate partition. But is it possible to set a limit for the 
>> maximum memory each user can have?
>>
>> This would prevent any one user from exhausting the server ram and 
>> causing the class to a crawl as the swap comes into play. Today, 
>> someone in my class somehow got gimp to eat 1gig of ram (I saw it with 
>> "top") and the whole class really felt the lag as the active swap 
>> partition started growing. Also, what if a student writes a program 
>> that gets into an infinite loop of allocating dynamic memory. (*it 
>> could happen*)
>>
>> Somebody must have thought of this problem before?
> 
> 
> I don't know about limiting memory per user, but you can limit it by 
> process.
> 
> Here's ulimit.sh, which I wrote after problems like the one you 
> encountered.
> 
> 
> #limit CPU time to stop runaway Netscape/Mozilla
> #limit data size due to runaway artsd (1 gigabyte!)
> if [ $UID -ge 500 ]
> then
>     ulimit -t 300
>     ulimit -d 200000
>     ulimit -m 300000
>     ulimit -v 300000
> fi
> 
> 
> 
> 
> 
> If you want to do the same, make your script executable, then put it in 
> the /etc/profile.d directory.
> 
> If someone knows a better way to do this, my ears are open.
> 
> Calvin
> 





More information about the K12OSN mailing list