From: Dale <rdalek1967@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Firefox, Seamonkey to if I can, and memory limits.
Date: Fri, 23 Aug 2024 19:42:05 -0500 [thread overview]
Message-ID: <5f412695-d234-4e7d-445b-94dc43e03a99@gmail.com> (raw)
In-Reply-To: <e9836d11-5fbf-44a9-966c-b4a275af0c25@email.android.com>
Matt Jolly wrote:
> Hi,
>
> Cgroups are the answer. If you're on systemd you could try making a
> `slice` for Firefox that might look a bit like this:
>
> /etc/systemd/system/user-firefox.slice
>
> ```
> [Unit]
> Description=Firefox Slice
> Before=slices.target
>
> [Slice]
> MemoryAccounting=true
> MemoryLimit=512M
> ```
>
> Then you can run
>
> ```
> systemctl daemon-reload && systemctl restart user-firefox.slice
> ```
>
> Then launch Firefox in the slice like so
>
> ```
> systemd-run -q --user --scope --unit ff \
> --slice user-firefox -- firefox --profile myprofile
> ```
>
> Which will apply the limits in the slice (check the docs, there's all
> sorts) to anything running within it. You can enable the slice and run
> Firefox (or anything else you want to limit, really).
>
> You may need to adapt these commands a little, I wrote this on mobile. :)
>
> I use slices on HPC to limit users from monopolising interactive
> nodes, and our batch jobs kill anything that exceeds requested memory
> (hope that wasn't 100h into a job!). I do this on login with user
> slices but the concept is the same.
>
> Here's the docs on slice/scope settings:
> https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html#
>
> You could also try something like this:
> https://github.com/mk-fg/fgtk#cgrc
>
> You can directly do cgroups on openrc... Probably? I've never had to
> worry about it.
>
> Cheers,
>
> Matt
>
I still use openrc. I'll look around and see what I can find. Now I
know what to look for. Thing is, not sure I use cgroups either, unless
it is on by default. o_O
Dale
:-) :-)
next prev parent reply other threads:[~2024-08-24 0:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 18:38 [gentoo-user] Firefox, Seamonkey to if I can, and memory limits Dale
2024-08-23 21:22 ` Wol
2024-08-23 23:03 ` Matt Jolly
2024-08-24 0:42 ` Dale [this message]
2024-08-24 4:25 ` Matt Jolly
2024-08-24 8:30 ` Walter Dnes
2024-08-25 15:20 ` Dale
2024-08-31 17:32 ` Michael
2024-08-31 18:39 ` Dale
2024-09-01 9:35 ` Wols Lists
2024-09-01 14:24 ` Dale
2024-09-01 19:08 ` Wols Lists
2024-09-01 19:36 ` Dale
2024-09-01 20:45 ` Wol
2024-09-01 21:36 ` Dale
2024-09-02 6:49 ` Wols Lists
2024-08-24 9:15 ` Wol
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f412695-d234-4e7d-445b-94dc43e03a99@gmail.com \
--to=rdalek1967@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox