• Limit RAM usage of a user or all users

    From joecook@gmail.com@110:300/11 to All on Tue Mar 6 16:01:50 2018
    Running on a system that has no swap, and it seems users can use so much me= mory that it causes the machine to have kernel processes or drivers crash.

    I'm looking for a way to limit the total amount of user memory available to=
    all user processes. Or lacking that, for a particular user across all th=
    at user's processes.

    Unfortunately, setting a "max processes" and "max memory per process" limit=
    in ulimit doesn't quite do the trick, because I want to allow a user to ha=
    ve a ton of small processes, or one very large one (up to some limit where =
    it can use almost all the RAM, but leave enough for kernel).

    Any suggestions?

    Thanks in advance!
    Joe C

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From Steven Petruzzellis@110:300/11 to All on Tue Mar 6 16:28:32 2018
    On Tuesday, March 6, 2018 at 8:01:54 AM UTC-7, joe...@gmail.com wrote:
    Running on a system that has no swap, and it seems users can use so much =
    memory that it causes the machine to have kernel processes or drivers crash=
    ..
    =20
    I'm looking for a way to limit the total amount of user memory available =
    to all user processes. Or lacking that, for a particular user across all = that user's processes.
    =20
    Unfortunately, setting a "max processes" and "max memory per process" lim=
    it in ulimit doesn't quite do the trick, because I want to allow a user to = have a ton of small processes, or one very large one (up to some limit wher=
    e it can use almost all the RAM, but leave enough for kernel).
    =20
    Any suggestions?
    =20
    Thanks in advance!
    Joe C



    He insists that he uses Linux, while you know he never installed it on bare=
    metal and fully experienced it. On topic discussions will be destroyed onc=
    e the waters are overfished. That and there will perpetually be a mentally = unstable element or two in an open group (i.e. Adam LeMond). The current ta= ntrum aside, we have all seen who regularly pitches a fit when he doesn't g=
    et anyone on his side.=20

    You won't go into a social event, piss in all the moonshine, pound all the = pets, nab the bananas, and technicolor yawn in the porch without being ridi= culed. By following 'authority figures' like that you get phrases like 'rev= erse racism'. Carried to its ultimate solution, the push that it's 'unfair'=
    for a straight normal guy to not wish to have sex with a transvestite is b= orn. Autumn Nissen has been here to figure out the depths of the guy's trol= ling. Proof Sandman accuses everyone of being Snit http://sandman.net/files= /snit_circus.png.=20

    --
    Eight things to never feed your cat
    https://youtu.be/5OfWsoPAg7o
    https://youtu.be/iztSc_msHuo
    Jonas Eklundh Communication AB

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From William Unruh@110:300/11 to All on Tue Mar 6 18:40:12 2018
    On 2018-03-06, joecook@gmail.com <joecook@gmail.com> wrote:
    Running on a system that has no swap, and it seems users can use so much
    memory that it causes the machine to have kernel processes or drivers crash.


    Why would you do that, run with no swap? And why is having the user's machine crash not a suitable punishment for them for using so much ram, especially as this does not seem to be a multiuser system?

    I'm looking for a way to limit the total amount of user memory available to
    all user processes. Or lacking that, for a particular user across all that user's processes.

    Unfortunately, setting a "max processes" and "max memory per process" limit
    in ulimit doesn't quite do the trick, because I want to allow a user to have a ton of small processes, or one very large one (up to some limit where it can use almost all the RAM, but leave enough for kernel).

    Any suggestions?

    Thanks in advance!
    Joe C

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (110:300/11@linuxnet)
  • From Richard Kettlewell@110:300/11 to All on Tue Mar 6 19:28:27 2018
    joecook@gmail.com writes:
    Running on a system that has no swap, and it seems users can use so
    much memory that it causes the machine to have kernel processes or
    drivers crash.

    I'm looking for a way to limit the total amount of user memory
    available to all user processes. Or lacking that, for a particular
    user across all that user's processes.

    Unfortunately, setting a "max processes" and "max memory per process"
    limit in ulimit doesn't quite do the trick, because I want to allow a
    user to have a ton of small processes, or one very large one (up to
    some limit where it can use almost all the RAM, but leave enough for
    kernel).

    Any suggestions?

    https://unix.stackexchange.com/questions/34334/how-to-create-a-user-with-limited-ram-usage

    --
    https://www.greenend.org.uk/rjk/

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: terraraq NNTP server (110:300/11@linuxnet)
  • From J.O. Aho@110:300/11 to All on Tue Mar 6 19:38:05 2018
    On 03/06/18 16:01, joecook@gmail.com wrote:
    Running on a system that has no swap, and it seems users can use so much
    memory that it causes the machine to have kernel processes or drivers crash.

    Seems like you have too little memory on that machine for it's task, the
    only time I would say it's OK to skip swap is if the amount of RAM do be
    well dimensioned for your task.
    I would recommend you to get some swap, best if you have a swap
    partition, but a swap file works too, but set a low swapiness (1 or 2%),
    so that you will not use the swap until it really is needed, as
    everything that has ended up in the swap will be really slow.


    I'm looking for a way to limit the total amount of user memory available to
    all user processes.
    Or lacking that, for a particular user across all that user's processes.

    What you can do, depends much on how you have setup your server to php.
    You could try to use firejail, if you use the standard apache/php setup,
    then you need to firejail the apache, if you use fpm, then it's just the fpm-php that needs to be firejail:ed.

    Look at the rlimit options.

    If you want to be even more advanced, you can run a container with
    memory limitation and run the web server/php inside the container, sure
    there will be some nasty side effects when trying to use more memory,
    but shouldn't affect the host too badly.


    Unfortunately, setting a "max processes" and "max memory per process" limit
    in ulimit doesn't quite do the trick,
    because I want to allow a user to have a ton of small processes, or one very
    large one (up to some limit where it
    can use almost all the RAM, but leave enough for kernel).

    There ain't good default limits for what you want to do and even if you
    modify users ulimit values, depending on your setup, the configuration
    may not affect php as it tends to be run as nobody.


    Any suggestions?

    firejail or lxc (or docker, but it can mess up things)

    --

    //Aho

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From joecook@gmail.com@110:300/11 to All on Wed Mar 7 03:41:29 2018
    On Tuesday, March 6, 2018 at 1:38:08 PM UTC-5, J.O. Aho wrote:
    On 03/06/18 16:01,=20
    Running on a system that has no swap, and it seems users can use so muc=
    h memory that it causes the machine to have kernel processes or drivers cra= sh.
    =20
    Seems like you have too little memory on that machine for it's task, the
    only time I would say it's OK to skip swap is if the amount of RAM do be
    well dimensioned for your task.

    It's more that the system has no hard-drive and is in development. In the = end it will have plenty of memory to do its task, but during development it=
    's too easy to have developers mess it up and cause the need to reboot. I'=
    d rather the user processes just be killed with a bad_alloc or the like.



    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From Steven Petruzzellis@110:300/11 to All on Wed Mar 7 04:16:31 2018
    On Tuesday, March 6, 2018 at 11:38:08 AM UTC-7, J.O. Aho wrote:
    On 03/06/18 16:01, joecook@gmail.com wrote:
    Running on a system that has no swap, and it seems users can use so much
    memory that it causes the machine to have kernel processes or drivers crash.

    Seems like you have too little memory on that machine for it's task, the
    only time I would say it's OK to skip swap is if the amount of RAM do be
    well dimensioned for your task.
    I would recommend you to get some swap, best if you have a swap
    partition, but a swap file works too, but set a low swapiness (1 or 2%),
    so that you will not use the swap until it really is needed, as
    everything that has ended up in the swap will be really slow.


    I'm looking for a way to limit the total amount of user memory available to
    all user processes.
    Or lacking that, for a particular user across all that user's processes.

    What you can do, depends much on how you have setup your server to php.
    You could try to use firejail, if you use the standard apache/php setup,
    then you need to firejail the apache, if you use fpm, then it's just the fpm-php that needs to be firejail:ed.

    Look at the rlimit options.

    If you want to be even more advanced, you can run a container with
    memory limitation and run the web server/php inside the container, sure
    there will be some nasty side effects when trying to use more memory,
    but shouldn't affect the host too badly.


    Unfortunately, setting a "max processes" and "max memory per process" limit
    in ulimit doesn't quite do the trick,
    because I want to allow a user to have a ton of small processes, or one
    very large one (up to some limit where it
    can use almost all the RAM, but leave enough for kernel).

    There ain't good default limits for what you want to do and even if you modify users ulimit values, depending on your setup, the configuration
    may not affect php as it tends to be run as nobody.


    Any suggestions?

    firejail or lxc (or docker, but it can mess up things)

    --

    //Aho



    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    In article <328ae2c8-12e1-4830-b455-53187a4bc309@googlegroups.com>, Steve Carroll wrote:

    Sandman:
    <http://usenet.sandman.net/misc/snit_flood> It doesn't show what
    interval the script is run at, but how he has used it, at least in
    the beginning. I stopped logging it this way back in may :)

    From what I've personally looked at, it looks like it's all over the
    map.

    Yes, with obvious scripted sessions. Not saying some of it isn't manual.

    Sandman:
    Maybe I'll update it :)

    What would it take to do that?

    For "later" to occur!

    <http://usenet.sandman.net/misc/postingtimes/Snit/Flooding>

    That's a running tally of Snit's non-sock posts and his flooding during the last month. It'll update automatically and always show the last two months.


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.12 (GNU/Linux)

    iQEcBAEBAgAGBQJZyKjaAAoJECFEwfBaA+jR4QEIAIWE3GfOGnnxynLfUhRnWv+l OkvAvQ8GofGI1JjIOn7NnlyfGRV/JPiIzJmzoCrdV6uY9E9qaYOXScF4M5Vas4bv 2WqBlNIh7se9g6Zkj330L12RkuZckS5l0nJ++OTbmztOzLtAlrWKHADTiJ9u8JnR BCjcAhMrjQ0Jwut34hJr57pzj7p88oYCPP46IcrEMbWnd03n43BGUVLGr9i9pYU+ 7F6867hOzaFJ4DdRE52zv15yIYVUIHx7HFNNtV7ZfPRBRQQuyA403S8PM1RC/nQ/ RKau+ma21bzltpxlqTO+XAXMMLLZiGXy8hbv4Ib/tPlc5cKI3P6UDZ4exbbCmnE=
    =1Dqa
    -----END PGP SIGNATURE-----

    -
    What Every Entrepreneur Must Know!! https://www.reddit.com/r/linux/comments/6sfhq6/what_desktop_tasks_does_linux_handle_better_than/
    Jonas Eklundh Communication AB

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From J.O. Aho@110:300/11 to All on Wed Mar 7 06:57:38 2018
    On 03/07/18 03:41, joecook@gmail.com wrote:
    On Tuesday, March 6, 2018 at 1:38:08 PM UTC-5, J.O. Aho wrote:
    On 03/06/18 16:01,
    Running on a system that has no swap, and it seems users can use so much memory that it causes the machine to have kernel processes or drivers crash.

    Seems like you have too little memory on that machine for it's task, the
    only time I would say it's OK to skip swap is if the amount of RAM do be
    well dimensioned for your task.

    It's more that the system has no hard-drive and is in development.
    In the end it will have plenty of memory to do its task, but during
    development
    it's too easy to have developers mess it up and cause the need to reboot.
    I'd rather the user processes just be killed with a bad_alloc or the like.

    I would separate the development of the system and software, my
    experience from developing systems/software is that things just gets
    messy when doing those in the same place at the same time, and worse if
    the development machine suddenly becomes a live system.


    --

    //Aho

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From Jasen Betts@110:300/11 to All on Wed Mar 7 07:37:10 2018
    On 2018-03-06, joecook@gmail.com <joecook@gmail.com> wrote:
    Running on a system that has no swap, and it seems users can use so much
    memory that it causes the machine to have kernel processes or drivers crash.

    I'm looking for a way to limit the total amount of user memory available to
    all user processes. Or lacking that, for a particular user across all that user's processes.

    Unfortunately, setting a "max processes" and "max memory per process" limit
    in ulimit doesn't quite do the trick, because I want to allow a user to have a ton of small processes, or one very large one (up to some limit where it can use almost all the RAM, but leave enough for kernel).

    Any suggestions?

    Turn off overcommit. (I think you use sysconfig to do that)

    --
    This email has not been checked by half-arsed antivirus software

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: "JJ's own news server" (110:300/11@linuxnet)
  • From Steven Petruzzellis@110:300/11 to All on Wed Mar 7 08:10:13 2018
    On Tuesday, March 6, 2018 at 10:57:39 PM UTC-7, J.O. Aho wrote:
    On 03/07/18 03:41, joecook@gmail.com wrote:
    On Tuesday, March 6, 2018 at 1:38:08 PM UTC-5, J.O. Aho wrote:
    On 03/06/18 16:01,
    Running on a system that has no swap, and it seems users can use so much
    memory that it causes the machine to have kernel processes or drivers crash.

    Seems like you have too little memory on that machine for it's task, the >> only time I would say it's OK to skip swap is if the amount of RAM do be >> well dimensioned for your task.

    It's more that the system has no hard-drive and is in development.
    In the end it will have plenty of memory to do its task, but during
    development
    it's too easy to have developers mess it up and cause the need to reboot. I'd rather the user processes just be killed with a bad_alloc or the like.

    I would separate the development of the system and software, my
    experience from developing systems/software is that things just gets
    messy when doing those in the same place at the same time, and worse if
    the development machine suddenly becomes a live system.


    --

    //Aho



    I'm getting a lot of killed files. I'm guessing the The Underground Marshmallow
    Person Mac cultist has gone ballistic again. Having to endure the use of Tmux is not what most want to do.

    What were you doing? Show a case study of a successful business that has made its fortune by not caring about its clients and wares.

    I have known dogs who argue better than The Underground Marshmallow Person does. This is something beyond you.

    --
    Puppy Videos! https://groups.google.com/forum/#!topic/comp.sys.mac.system/6m_7Z7rQ6Hg https://youtu.be/OffkiSAsYo8 http://www.5z8.info/lemon-party-redux_v1o7pm_nakedgrandmas.jpg
    Jonas Eklundh Communication AB

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From Steven Petruzzellis@110:300/11 to All on Wed Mar 7 08:25:51 2018
    On Wednesday, March 7, 2018 at 12:01:14 AM UTC-7, Jasen Betts wrote:
    On 2018-03-06, joecook@gmail.com <joecook@gmail.com> wrote:
    Running on a system that has no swap, and it seems users can use so muc=
    h memory that it causes the machine to have kernel processes or drivers cra= sh.

    I'm looking for a way to limit the total amount of user memory availabl=
    e to all user processes. Or lacking that, for a particular user across al=
    l that user's processes.

    Unfortunately, setting a "max processes" and "max memory per process" l=
    imit in ulimit doesn't quite do the trick, because I want to allow a user t=
    o have a ton of small processes, or one very large one (up to some limit wh= ere it can use almost all the RAM, but leave enough for kernel).

    Any suggestions?
    =20
    Turn off overcommit. (I think you use sysconfig to do that)
    =20
    --=20
    This email has not been checked by half-arsed antivirus software



    I bet Paul F. Riddle thinks my life was perfect.=20

    Right now there are too many "works for me" Mac users and not enough people=
    with the time to help the people with old computers. Honestly, what lie?=
    =20

    You haven't been in multiple groups to even partially figure out the depths=
    of Paul F. Riddle's narcissism. Yup. It seems this is what we have to deal=
    with. Cretins who have no reason for being here other than to antagonize o= thers.=20

    I would reply to Paul F. Riddle at once but he is a cretin who distorts you=
    r words to realize his craving to call everyone a sock.=20

    I often reverse engineer beetles with my mind.=20

    Just some names Steve Carroll has used
    "Evil" John *
    "Evil" Snit *
    Big Crotch on a Small Fish
    Cornelius Munshower
    CSMA Moderator
    Edward Stanfield
    Fretwiz *
    Hitman Hero
    Measles
    Petruzzellis Kids
    Sigmond
    Slaveen
    Smit
    Steve C *
    Steve Camoll *
    Steve Carroll <noone@xxxxxxxxxxx> *
    Steve Carroll <stevecarroll@xxxxxxxxxxx> *
    Steve Carroll <trollkiller@xxxxxx> *
    Steve Carroll's Dog *
    Steve Carrolll *
    Steve Carrroll *
    Yevette Owens
    Yobo_Obyo


    --
    This broke the Internet! http://www.5z8.info/-php-deactivate_phishing_filter-48-_e3m8dt_malicious-co= okie
    https://youtu.be/E3m_i-x92D0
    Jonas Eklundh

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)
  • From Richard Kettlewell@110:300/11 to All on Wed Mar 7 09:42:42 2018
    Jasen Betts <jasen@xnet.co.nz> writes:
    On 2018-03-06, joecook@gmail.com <joecook@gmail.com> wrote:
    Running on a system that has no swap, and it seems users can use so
    much memory that it causes the machine to have kernel processes or
    drivers crash.

    I'm looking for a way to limit the total amount of user memory
    available to all user processes. Or lacking that, for a particular
    user across all that user's processes.

    Unfortunately, setting a "max processes" and "max memory per
    process" limit in ulimit doesn't quite do the trick, because I want
    to allow a user to have a ton of small processes, or one very large
    one (up to some limit where it can use almost all the RAM, but leave
    enough for kernel).

    Any suggestions?

    Turn off overcommit. (I think you use sysconfig to do that)

    It will fail long before actually running out of memory in that case.

    --
    https://www.greenend.org.uk/rjk/

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: terraraq NNTP server (110:300/11@linuxnet)
  • From Steven Petruzzellis@110:300/11 to All on Wed Mar 7 13:37:55 2018
    On Wednesday, March 7, 2018 at 12:25:52 AM UTC-7, Steven Petruzzellis wrote=
    :
    On Wednesday, March 7, 2018 at 12:01:14 AM UTC-7, Jasen Betts wrote:
    On 2018-03-06, joecook@gmail.com <joecook@gmail.com> wrote:
    Running on a system that has no swap, and it seems users can use so m=
    uch memory that it causes the machine to have kernel processes or drivers c= rash.

    I'm looking for a way to limit the total amount of user memory availa=
    ble to all user processes. Or lacking that, for a particular user across = all that user's processes.

    Unfortunately, setting a "max processes" and "max memory per process"=
    limit in ulimit doesn't quite do the trick, because I want to allow a user=
    to have a ton of small processes, or one very large one (up to some limit = where it can use almost all the RAM, but leave enough for kernel).

    Any suggestions?
    =20
    Turn off overcommit. (I think you use sysconfig to do that)
    =20
    --=20
    This email has not been checked by half-arsed antivirus software
    =20
    =20
    =20
    I bet Paul F. Riddle thinks my life was perfect.=20
    =20
    Right now there are too many "works for me" Mac users and not enough peop=
    le with the time to help the people with old computers. Honestly, what lie?= =20
    =20
    You haven't been in multiple groups to even partially figure out the dept=
    hs of Paul F. Riddle's narcissism. Yup. It seems this is what we have to de=
    al with. Cretins who have no reason for being here other than to antagonize=
    others.=20
    =20
    I would reply to Paul F. Riddle at once but he is a cretin who distorts y=
    our words to realize his craving to call everyone a sock.=20
    =20
    I often reverse engineer beetles with my mind.=20
    =20
    Just some names Steve Carroll has used
    "Evil" John *
    "Evil" Snit *
    Big Crotch on a Small Fish
    Cornelius Munshower
    CSMA Moderator
    Edward Stanfield
    Fretwiz *
    Hitman Hero
    Measles
    Petruzzellis Kids
    Sigmond
    Slaveen
    Smit
    Steve C *
    Steve Camoll *
    Steve Carroll <noone@xxxxxxxxxxx> *
    Steve Carroll <stevecarroll@xxxxxxxxxxx> *
    Steve Carroll <trollkiller@xxxxxx> *
    Steve Carroll's Dog *
    Steve Carrolll *
    Steve Carrroll *
    Yevette Owens
    Yobo_Obyo
    =20
    =20
    --
    This broke the Internet! http://www.5z8.info/-php-deactivate_phishing_filter-48-_e3m8dt_malicious-=
    cookie
    https://youtu.be/E3m_i-x92D0
    Jonas Eklundh



    I can tell from the way Paul F. Riddle complained - by being ignorant of fu= ndamentals of the KDE and more - he has not handled a computationally compl=
    ex challenge. If he had he would have understood the requirements like usin=
    g TWO equal signs to check equality!=20

    Too much glue for you, gluehead. My view is beyond your understanding. For = all the boasting Paul F. Riddle has done on this topic, the 'Content Manage=
    r' does not get how to do this. It takes a couple seconds to highlight a se= lection and 'sign' it. Not only did Vennie Bowden's question not refer to t=
    he "distro", it has _nothing_ to do with Linux. Paul F. Riddle should enter=
    a drug rehab program ;)=20

    On topic discussions will be overwhelmed once the those of us here before t=
    he eternal September are outnumbered. That and there will invariably be a m= ental midget or more in an unmoderated group (hello Paul F. Riddle). The sp= ecifics of the bullshit aside, we have all seen who regularly pitches a fit=
    when he doesn't get anyone to shill for him. The one skill Paul F. Riddle = learned well is to attempt to shame Vennie Bowden into false confession and=
    if that fails to work, shout him down or quickly change the goalpost.=20

    --
    This Trick Gets Women Hot For You!! http://tmp.gallopinginsanity.com/BilkHelp.html http://prescottcomputerguy.com/screenflow
    Jonas Eklundh Communication AB

    --- MBSE BBS v1.0.7.2 (GNU/Linux-x86_64)
    * Origin: The Kofo System II BBS (110:300/11@linuxnet)