Re: memory limit/quota per user

Glynn Clements <[email protected]> Fri, 18 Jun 2010 19:56:50 +0100
Newsgroups org.kernel.vger.linux-admin
Message-ID <[email protected]>
Alex Brandt wrote:

> > Is it possible to limit memory quota per user (like disk quota) in 
> linux ?
> > 
> > AFAIK, RLIMIT_* (i.e. RSS, DATA) are applicable per process not per 
> user.

> You can use the pam security limits feature.
> 
> Simply check that the module is being loaded in pam.d:
> 
> /etc/pam.d/system-auth:session          required        pam_limits.so 
> 
> Then use the /etc/security/limits.conf file:
> <user> soft|hard memlock <value>

Memory limits are per-process, not per-user (and "memlock" controls
the amount of memory which can be mlock()d, which has little bearing
on memory usage overall).

The only per-user resource limit is the total number of processes.

-- 
Glynn Clements <[email protected]>