7

Update: Live screenshot of when it happens

enter image description here

enter image description here

So... When I'm using Zoom, most often during screen sharing, or when someone else is screensharing, all of my cores zip up to 100%, as in the screenshot above, and everything turns really sluggish. I can make out people telling me there's an echo, and Zoom gives me that "high CPU usage is slowing down Zoom" error, but then Zoom is what's chewing through my CPUs. Even if I kill zoom, and my browser, I still have some strange sluggish behavior. I can't open apps, nothing is as responsive. It's like something goes permanently wrong.

The only way to restore normal function is to restart the machine.

Screenshots:

enter image description here

enter image description here

Should I just throw out my computer, fly to a Caribbean island and retire?

7
  • 3
    Zoom is known to be resource eater when the conference is active. Firefox may be too if you have opened dynamic sites (with animation, videos, big advertisement and so on) in it in foreground tab. Seems to be expected. – N0rbert Jun 20 '20 at 7:54
  • 1
    @NOrbert, it continues after the applications have been closed. Run "top" in the terminal. Chances are you will see a kworker process sucking up your CPU. – vanadium Jun 20 '20 at 7:56
  • @N0rbert ooo, I'll try that. What would that mean? – Costa Jun 20 '20 at 14:20
  • 1
    Try going to about:performance in Firefox and double-check the culprit is indeed zoom. – Landak Jun 28 '20 at 22:48
  • 1
    @Landak Holy crap! That just made me very happy. I had no idea about:performance existed. – Costa Jun 29 '20 at 17:03
5
+150

It sounds like you've got two problems going on as far as your computer is concerned:

  1. Zoom is a resource hog.
  2. Something in firefox is a resource hog.

I infer that what you actually mean is

  1. My GUI gets laggy and I don't like it.

1 – "Tweaking" (breaking) the scheduler to force-limit a CPU intensive process

To deal with the former, as well as complaining loudly (and not using video backgrounds), you may wish to consider limiting the amount of CPU it can have. This is done in linux via control groups or CGROUPS, which can effectively limit scheduling for a single group. For example, you can use CGROUPS to get the kernel to constrain processes within a CGROUP to use, let's say for example, 100 ms out of every 1000 ms (or .1s out of every 1s) of CPU time. This will make things worse for your Zoom experience but might be better over all.

To give this a go, sudo apt install cgroup-tools libcgroup1 libcgroup-dev, and then create a cpu-limited cgroup with

sudo cgcreate -g cpu:/cpulimit

Here, cpulimit is the group name that controls the cpu usage. Now, you have to set cpu.cfs_period_us and cpu.cfs_quota_us property on the cpulimit group.

In keeping with the above example, let's set 1 s or 1000000 us (microseconds) should be set to cpu.cfs_period_us property and 100 ms or 100000 us should be set to the cpu.cfs_quota_us property

sudo cgset -r cpu.cfs_period_us=1000000 cpulimit
sudo cgset -r cpu.cfs_quota_us=100000 cpulimit

To check to see that this is the case, run sudo cgget -g cpu:cpulimit and observe that these flags are set.

It's now the case that whatever process you add to the cpulimit CGROUP will, as the name suggests, be limited to using use 1/10th (100000/1000000 = 1/10 = 0.1 = 10%) of the total CPU cycles. At the very least, this probably helps quite a lot.

Now to actually use this and start a process, start the program or command with cgexec as follows:

sudo cgexec -g cpu:cpulimit YOUR_COMMAND

where YOUR_COMMAND can be /path/to/zoom or literally anything else.

2 – Finding performance hogs in Firefox

Firefox has a nifty about:performance page that will help you spot hungry pages. often these use a lot of javascript, display ads, or may even be so rude as to run, for example, a cryptocurrency miner without telling you. As well as killing (closing) the culprit page, one thing you might want to do to stop that happening again is taking the plunge and using a selective javascript blocker like the excellent umatrix to prevent that happening again. Sure, it breaks some pages, but you usually learn something about the web in unblocking particular links ;-).

3 – Stopping your GUI from lagging the nice way

As well as the not-often-used cgroups to place a hard limit on processor scheduling, Linux has an inbuilt idea of process priority. For reasons of history that I would love to learn if others can educate me, Linus called this priority niceness. We can renice (or sudo renice) a process to make it "nicer" -- i.e. run with a higher priority. By default, users can renice processes down to a priority of 0 (and up to 19) and root to -20. Lower niceness processes are given more priority by the scheduler. (I think the idea here is that a process that you don't really care about -- i.e. one that would be "nice to have" -- is given a higher niceness to decrease its priority).

For gnome, it /may/ help to renice the gui to a lower niceness. This is quite easy to do; e.g. sudo renice -3 -p $(pgrep Xwayland) && sudo renice -3 -p $(pgrep gnome-shell). Again, similarly to the above, nice will start a process with a specified niceness; but here you need to specify it with a - beforehand -- so that nice -10 /path/to/zoom would start zoom with a niceness of +10 (and nice --10 /path/to/zoom with a niceness of -10). This also /may/ be a better way of going about it.

1
1

This might be an issue with firefox or chrome/chromium is running in the background. Or, any else app is eating the RAM or CPU. Check the process in System Monitor and kill the process

4
  • Yup, tried this every time it happened. Nothing solved it. The CPUs wouldn't calm down even after I killed everything. – Costa Jun 30 '20 at 21:24
  • Maybe problem with CPU itself. – Yeppii Jul 1 '20 at 7:00
  • I think you overclocked your CPU – Yeppii Jul 2 '20 at 7:10
  • I must have done so inadvertently if so. – Costa Jul 2 '20 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.