memory limit/quota per user

Hello All,

Is it possible to limit memory quota per user (like disk quota) in linu=
x ?

AFAIK, RLIMIT_* (i.e. RSS, DATA) are applicable per process not per use=
r.

thankx a lot.
tharindu.


"those that can, do. Those that can=92t, complain." -- Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tharindu Rukshan Bamu [ Di, 08 Juni 2010 12:32 ] [ ID #2042790 ]

Re: memory limit/quota per user

--=-=-=
Content-Transfer-Encoding: quoted-printable

Tharindu Rukshan Bamunuarachchi <btharindu [at] gmail.com> writes:
> 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.

Unless something has changed recently, not with standard utilities.
Maybe SELinux or similar allows for something like that but otherwise
it's impossible.

=2D-
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=3D./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86-tlen.pl>--<jid:mina86-jabber.org>--ooO--(_)--Ooo--

--=-=-=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAkwOLt0ACgkQUyzLALfG3x47xACcD6Di3jaepL4DXfQf/8F6 CHLY
VmUAn0+NvHEJ1ASX9xWwvK4onmGGEmUX
=6gUX
-----END PGP SIGNATURE-----
--=-=-=--
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Michal Nazarewicz [ Di, 08 Juni 2010 13:51 ] [ ID #2042794 ]

Re: memory limit/quota per user

but that is for lock memory per process, not per user ?


__
tharindu.info

"those that can, do. Those that can=92t, complain." -- Linus



On Tue, Jun 8, 2010 at 1:20 PM, Ezra Taylor <ezra.taylor [at] gmail.com> wro=
te:
> Tharindu:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Check out /etc/security/limits=
=2Econf. =A0The variable to
> modify or add is memlock. =A0You can set hard and soft limits on this=
=2E
> On Tue, Jun 8, 2010 at 6:32 AM, Tharindu Rukshan Bamunuarachchi
> <btharindu [at] gmail.com> wrote:
>>
>> Hello All,
>>
>> Is it possible to limit memory quota per user (like disk quota) in l=
inux ?
>>
>> AFAIK, RLIMIT_* (i.e. RSS, DATA) are applicable per process not per =
user.
>>
>> thankx a lot.
>> tharindu.
>>
>>
>> "those that can, do. Those that can=92t, complain." -- Linus
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-admi=
n" in
>> the body of a message to majordomo [at] vger.kernel.org
>> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Ezra Taylor
>
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" =
in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tharindu Rukshan Bamu [ Di, 08 Juni 2010 14:41 ] [ ID #2042795 ]

Re: memory limit/quota per user

--nextPart3960119.VEWyds3VD3
Content-Type: Text/Plain;
charset="windows-1252"
Content-Transfer-Encoding: quoted-printable

On Tuesday 08 June 2010 5:32:46 am Tharindu Rukshan Bamunuarachchi wrote:
> Hello All,
>
> 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.
>
> thankx a lot.
> tharindu.
>
>
> "those that can, do. Those that can=92t, complain." -- Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-admin"
in
> the body of a message to majordomo [at] vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

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>

Regards,

Alex Brandt

=2D-
Linux Administrator
http://www.alunduil.com

--nextPart3960119.VEWyds3VD3
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)

iEYEABECAAYFAkwbg/EACgkQvpZ9jByxpSc3iQCfR6aJ1Q9oxLwtzU/muXPn Nakk
byMAnjqbD8TGE3I+eeqepoRoWBKq3YD6
=/lIX
-----END PGP SIGNATURE-----

--nextPart3960119.VEWyds3VD3--
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Alex Brandt [ Fr, 18 Juni 2010 16:34 ] [ ID #2043299 ]

Re: memory limit/quota per user

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 <glynn [at] gclements.plus.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Glynn Clements [ Fr, 18 Juni 2010 20:56 ] [ ID #2043300 ]
Linux » gmane.linux.admin » memory limit/quota per user

Vorheriges Thema: 2.6.32.1 kernel configuration only seeing 1 core on Intel E5540 CPU
Nächstes Thema: Preventing SSH timeouts . Some clarification needed