How to limit cpu and memory usage of the whole desktop?

30 views Asked by At

I'm having a recurring issue that sometimes my desktop freezes and is totally irresponsive blocking my computer from doing anything.

So whatever the underlaying issue may be i think it would be sane in any context to save some resources for a tty to handle these cases.

So can you give me any insight of what I'm doing wrong?

I'm dealing with cgroups, but for some (weird-stupid) reason systemd-run is not the same as bash -c so after I created this desktop.slice file:

cat /etc/systemd/system/desktop.slice

[Slice]

CPUQuota=90%

MemoryHigh=12G

MemoryMax=13G

MemorySwapMax=2.5G

and running xfce4 like: systemd-run --scope --slice=desktop.slice --user it loads a really nice desktop with the exception that there is no input method avaible, nor keyboard, nor mouse, and the only way to close the session and recover control is through ssh.

0

There are 0 answers