2

What is wrong with firefox (Web content)? Is this an issue? Is there a way to reduce it?

This 'Web content' always pops-up when I start Firefox (I guess these are different tabs because I closed this and a web page crashed. And moreover, when the tab is active (firefox is on the front), the usage increases to 200+%, but when it goes to the back (other window active above it like the terminal), the usage goes normal again (even though the tabs are still open at the back).

top - 00:04:18 up  3:03,  3 users,  load average: 2.97, 2.12, 1.16
Tasks: 197 total,   1 running, 196 sleeping,   0 stopped,   0 zombie
%Cpu(s): 39.2 us, 17.7 sy, 15.7 ni, 26.4 id,  0.3 wa,  0.4 hi,  0.3 si,  0.0 st
MiB Mem :   7859.5 total,   3069.1 free,   1745.0 used,   3045.4 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   4966.1 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                 
  32002 sh3ll     20   0 9701368 634172 178636 S 162.1   7.9   2:01.73 Web Content           

I'm using Firefox 83.0

enter image description here

terdon
  • 234,489
  • 66
  • 447
  • 667
Heich-B
  • 131
  • 5
  • Related, possibly a duplicate: [unix.stackexchange.com/questions/321997](https://unix.stackexchange.com/questions/321997) – Freddy Nov 29 '20 at 17:46
  • Please, do not post screenshots. They cannot be indexed or cited in the comments. Is this something that happens all the time? You could simply have a misbehaving script, a cryptocurrency miner ... You can also kill that WebContent process and then revisit the tabs to see which page created the problem. We need more information, it could even be hardware acceleration. Please state for how long that happens and if you can recreate it, along with the version of Firefox, at the very least. – Eduardo Trápani Nov 29 '20 at 18:22
  • @EduardoTrápani Added more info :) Should I remove the image even though I added the info as text? – Heich-B Nov 29 '20 at 18:38
  • Go to about:performance. Is there any tab with a Medium or High energy impact? – Wieland Nov 29 '20 at 18:47
  • @Wieland Yeah there is, Twitch (high usage) :/ I think the iGPU isn't able to handle it and my Nvidia dGPU is a pain in the ass to set up. What should I do? – Heich-B Nov 29 '20 at 18:52
  • Is this happening when you play videos? That can be normal, especially if you aren't using hardware acceleration (I'm not sure if firefox can use hardware accel decoding, so far I've only seen it working on chromium built with the right codecs - I haven't tried on firefox yet). – rudib Nov 29 '20 at 19:12
  • @rudib Yeah, more specifically when watching in high quality. – Heich-B Nov 29 '20 at 19:27
  • @Heich-B that's more or less to be expected then. If your hardware acceleration isn't working, you can try to use different codecs that are easier on the CPU (Artem's answer) (I'm not sure if that is possible with twitch). You could also try to get hardware accel working I havent tried with firefox yet, but [here is the arch wiki page](https://wiki.archlinux.org/index.php/Firefox#Hardware_video_acceleration). `VA-API` should be what you're looking for then. – rudib Nov 29 '20 at 20:43
  • @Heich-B but it's possible that `Web Content` is doing something different than video decoding... (but if the load increases with the quality, it'd at least seem that way) – rudib Nov 29 '20 at 20:48

1 Answers1

2

Normally it shouldn't happen unless you have a website open which is mining cryptocurrency, doing other calculations or rendering something (e.g. it's a game).

How to approach issues like this one:

  • Make sure you're using the latest version of Firefox at the moment as well as the current stable Linux kernel (5.9.11) and GPU drivers (including Mesa). Some distros are really slow in terms of incorporating new software, e.g. Debian, so generally they are ill-advised for being used on the desktop.

  • Try reproducing the issue with a fresh/new Firefox profile without changing any preferences or installing any add-ons - if it's reproducible file a bug report at https://bugzilla.mozilla.org/

  • If it's not reproducible with a fresh profile, install your add-ons one by one: find out the culprit and disable it. Report the bug to https://addons.mozilla.org/

  • Firefox as of recently has become quite demanding in terms of hardware. For some older GPUs you may need to disable hardware acceleration to get the most of it. Go to about:preferences General -> uncheck the "Use recommended performance settings" under Performance and disable "Use hardware acceleration if available". See if it helps. If it does, you may still need to file a bug report at https://bugzilla.mozilla.org/, so that Mozilla developers could blacklist hardware acceleration for your hardware by default, so that other people similar to you didn't suffer.

  • If your computer is sufficiently old, your Firefox may consume 100% of CPU just by watching YouTube videos alone because the VP9 codec at resolutions above 1080p is quite demanding. Lower the resolution or use this extension: https://addons.mozilla.org/firefox/addon/h264ify/

Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64
  • The main issue was that whenever I switched to 1080p (my screens highest display), the CPU fan started spinning at hight RPM, so I now use Nvidia to start firefox using `prime-run` and now the fan doesn't start (does this indicate that temps are maintained?) BTW my laptop isn't that old (8 GB RAM, 4 GB Nvidia 940MX, i5 7th Gen) – Heich-B Nov 30 '20 at 04:41
  • 1
    Mixed graphics laptops are a royal PITA under Linux and I cannot even say they work well under Windows. – Artem S. Tashkinov Nov 30 '20 at 08:07