memory limit/quota per user

memory limit/quota per user

am 08.06.2010 12:32:46 von Tharindu Rukshan Bamunuarachchi

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: memory limit/quota per user

am 08.06.2010 13:51:51 von Michal Nazarewicz

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

Tharindu Rukshan Bamunuarachchi 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-=20
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=3D./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +------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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: memory limit/quota per user

am 08.06.2010 14:41:17 von Tharindu Rukshan Bamunuarachchi

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 wro=
te:
> Tharindu:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Check out /etc/security/limits=
conf. =A0The variable to
> modify or add is memlock. =A0You can set hard and soft limits on this=

> On Tue, Jun 8, 2010 at 6:32 AM, Tharindu Rukshan Bamunuarachchi
> 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@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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: memory limit/quota per user

am 18.06.2010 16:34:20 von Alex Brandt

--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,
>=20
> Is it possible to limit memory quota per user (like disk quota) in=20
linux ?
>=20
> AFAIK, RLIMIT_* (i.e. RSS, DATA) are applicable per process not per=20
user.
>=20
> thankx a lot.
> tharindu.
>=20
>=20
> "those that can, do. Those that can=92t, complain." -- Linus
> --
> To unsubscribe from this list: send the line "unsubscribe linux-admin"=20
in
> the body of a message to majordomo@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=20

Then use the /etc/security/limits.conf file:
soft|hard memlock

Regards,

Alex Brandt

=2D-=20
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: memory limit/quota per user

am 18.06.2010 20:56:50 von Glynn Clements

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:
> soft|hard memlock

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
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html