LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 01-07-2013, 11:03 AM   #1
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Rep: Reputation: Disabled
limiting users ram usage by limits.conf


Hi
i want to limit ram usage of one user with /etc/limits.conf
the problem is that i don't know which parameter is for ram.
is it
Code:
memlock
               maximum locked-in-memory address space (KB)
or it's other parameters.
 
Old 01-07-2013, 11:25 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I don't think you can (with limits.conf).

The correct parameter would be rss, but I think that is not implemented.
 
Old 01-07-2013, 12:40 PM   #3
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
thanks for reply.
well rss is unusable in kernel above 2.4.30.

from limits.conf man page :
Code:
rss
               maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)
 
Old 01-07-2013, 07:41 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
How about
Quote:
as
address space limit (KB)
 
Old 01-08-2013, 11:32 AM   #5
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
How about
thanks.
i will test it and put results here.
 
Old 01-09-2013, 01:48 PM   #6
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
i put this limit as hard limit but user cant even open vi or nano and get this error:
Code:
$ nano
nano: error while loading shared libraries: libtinfo.so.5: failed to map segment from shared object: Cannot allocate memory

Code:
lili    hard    as      500000
 
Old 01-09-2013, 04:09 PM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I think you are limiting virtual memory per process for a user, when you want to limit physical ram total (across processes) for that user.

If you use virtual memory as a limit on physical ram, you can't set the limit with any accuracy. Some processes might use as much physical ram as they use virtual memory, so a higher limit on virtual would let them use more physical than you want. Other processes (as you seem to have discovered already) use a small fraction physical ram for a large amount of virtual. Stopping them from doing so stops them from running at all, even if running them unlimited would have used very little physical ram.

Pre user across multiple processes is also hard to do. The relevant limits are per process for the specified user.

If I knew the solution, I would tell you. I'm posting to explain that the place you are looking for the solution is further from a real solution than it might appear.
 
Old 01-09-2013, 04:13 PM   #8
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
From what I understand you have to isolate every user in a virtual environment using virtual technology. Something that cloudlinux make capable. I could be wrong though. There may be other ways.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
Limiting number of processes: /etc/security/limits.conf vs. /etc/ld.so.preload brianmcgee Linux - Server 2 01-10-2012 09:41 AM
Limits on memory usage unifiedquarks Linux - Newbie 2 08-18-2011 09:05 AM
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 10:14 AM
Limiting RAM usage in a perl script DanTaylor Programming 2 05-05-2006 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:49 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