4 ms·
Cgroups: limit memory, limit CPU, and voila - it works! Slack is one of the resource hogs that will take all that you'll give it.
by Piskvorrr 9y ago
Cgroups: limit memory, limit CPU, and voila - it works! Slack is one of the resource hogs that will take all that you'll give it.
- hippich 9y agocould you post some examples of limiting slack with cgroups?
- kevincox 9y agoSee "How do I use cgroups ?" in the kernel docs: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.t... You can do it simply by mounting the cgroup fs and writing numbers to files.
- tedunangst 9y agoSeems like there should be a better solution than making every slack user read that document.
- Spivak 9y agoSure, but sometimes we have to wrestle with shitty software. There's a scanning tool we use that unrestrained will consume all system resources, lock up all the useful software, and occasionally crash severs. Set up a cgroup with a quota and problem solved.
- Piskvorrr 9y agoAfter some failed attempts, I gave up, copy-pasted and mangled what Sam Thursfield made for Firefox, substituting Slack where applicable and uncommenting the CPU quota: https://samthursfield.wordpress.com/2015/05/07/running-firefox-in-a-cgroup-using-systemd/ https://samthursfield.wordpress.com/2015/05/07/running-firef...
- pmoriarty 9y agoIs Slack well-behaved when it runs out of memory? Or does it just crash?
- Piskvorrr 9y agoIt crashes but recovers. IMNSHO a less broken solution than an instant messenger that absolutely needs all the system resources for itself.
- vladf 9y agoWorked first try, with no problems! Thank you, really great solution!