Author Topic: FF 45.x and CPU spikes  (Read 10110 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
FF 45.x and CPU spikes
« on: October 05, 2020, 05:28:21 pm »
So if there is one complaint I have here about FF (ignoring the other blatant problems such as inability to view certain sites) it is that certain sites which do render correctly cause the CPU to spike and stay at the consistent 25-40% level across all the cores on my machine.

I have been able to track this down to specific sites, for example GMAIL is one. So long as the browser window (tab) that has GMAIL opened is focused on the spikes continue. Even after I switch to a different window (I run the XPager here, so a total of 9 virtual Desktops) the CPU spikes continue UNLESS I first open a new TAB in the same browser window that has the GMAIL tab and leave that as the last focused tab.

So for the most part I ignore it, let the spikes continue and just live with it.

However, a little over a month ago I was testing the 3.23.14 ACPI release on the AOS Testers list and found some weird stuff, specifically it was no longer possible to shut OFF a particular CPU core b/c the ACPI Power Manager would continually overwrite that change and effectively bring the core back on-line (that causes me a problem here, but that's a different story).

I logged an issue for this, the root cause has not been identified so far, but I priodically check the status of the ticket.

Well, I was out there last night and spotted another issue that was logged regarding the msg passing delays that are being seen, see https://mantis.arcanoae.com/view.php?id=3019. In that update a suggestion was made that the /NOHLT option produces a different result, a better performing one.

I was curious, so I tried it out. To my suprise here is what I found (see attached screenshot): the normal FF usage shows the spikes, but the instant FF is no longer the foreground application with focus the spikes go away. This is very different from the symptoms I described at the start of my post. The result actually is that the minute I am done looking at my GMAIL and switch to another window, another application, the spikes completely go away.

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #1 on: October 05, 2020, 06:13:21 pm »
Quote
So if there is one complaint I have here about FF (ignoring the other blatant problems such as inability to view certain sites) it is that certain sites which do render correctly cause the CPU to spike and stay at the consistent 25-40% level across all the cores on my machine.

I see that a lot. I have determined that it is the web site trying to force advertising on you. I use a HOSTS file to block a lot of that stuff, and it is pretty effective, but the web page authors seem to have discovered that they need to keep on retrying, constantly, until it works. That produces "spikes". When you go to a site, like GMail, they try to force as much advertising as possible, and most of it seems to consist of full length movies, which also causes spikes. Don't blame Firefox for that.

Quote
However, a little over a month ago I was testing the 3.23.14 ACPI release on the AOS Testers list and found some weird stuff, specifically it was no longer possible to shut OFF a particular CPU core b/c the ACPI Power Manager would continually overwrite that change and effectively bring the core back on-line (that causes me a problem here, but that's a different story).

That has always been the case. You must use the parameter in CONFIG.SYS (and reboot to activate it). Trying to use the command will turn off one, or more, processors, but as soon at ACPI decides it needs more power (usually very quickly), it will turn them back on for you.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #2 on: October 05, 2020, 06:37:18 pm »
I have tried Dmitry's test app and it results in 2 ... 11 s. Now I remember that there are delays of a few s when opening NewView. It doesn't matter if it's started via the help manager or directly.

BTW: I've always thought that this may caused by another defect on my SSD. The first time I used the entire disk and copied data to it, I noticed problems with one partition. Reformatting that partition had cured that, but other problems occurred. After that, I had to ignore that one. No other problems since then. New SSDs are waiting to be used, but I also need time to do that.

Edit: Apparently the delays were caused by corrupt ini entries. Handles reached 6 blocks. After checkini and cleanini I'm back to 2 blocks and the delays seem to be gone. Have to try Dmitry's test app again.

Edit: Dmitry's test app gives now better results: 2 ... 5 s. (Ini handles were reduced from 6 to 2 blocks.)
« Last Edit: October 21, 2020, 12:04:10 am by Andreas Schnellbacher »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #3 on: October 05, 2020, 06:57:31 pm »
There's a few things that cause CPU spikes.
Some gifs are bad. This is a by product of not supporting drawing during vsync blanks like other OS's do. This can be shown by changing the value of layers.offmainthreadcomposition.frame-rate;-1 to zero or a positive number in about:config (requires a browser restart). Of course that makes drawing slow.
Some JavaScript also does this, I use DDG for search, sometimes the page doesn't finish loading and the CPU stays busy. Possibly what Doug sees is related.
Occasionally here, I get high CPU usage after a long uptime, this doesn't go away until I revert to a backup of my profile. No idea what causes this. I did seem to fix it last time by killing the browser and restarting, needs more testing.
There also seems to be problems with the HPET https://en.wikipedia.org/wiki/High_Precision_Event_Timer. Different MBs implement it differently and there was a long discussion about our ACPI not handling correctly vs the OS/4 kernels handling. David claimed it worked well, Bitwise claimed otherwise. It seems to be better here then it was. Here is a test, http://www.gus.biysk.ru/os4/test/timerTest.html
Probably other issues as well.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #4 on: October 05, 2020, 09:18:46 pm »
Hi Doug,

I see that a lot. I have determined that it is the web site trying to force advertising on you. I use a HOSTS file to block a lot of that stuff, and it is pretty effective, but the web page authors seem to have discovered that they need to keep on retrying, constantly, until it works. That produces "spikes". When you go to a site, like GMail, they try to force as much advertising as possible, and most of it seems to consist of full length movies, which also causes spikes. Don't blame Firefox for that.

Yeah, I agree with you, which is the reason why I've been relying on the modified HOSTS file for a few years now, NoScript for at least a couple years, and most recently (about 6 months ago I would say) I deployed uBlock. So yeah, as best as I can tell I think I have the hatches pretty much locked down here...LOL!

I suspect the symptoms I'm seeing are primarily caused by the FF issues Dave highligted in his post. I know that killing off certainly web page images using the uBlock add-on gives you a bit more control. However, certain scripts that run in the back-end can be difficult to kill, and at times they flat-out break the site functionality.

...
Quote
However, a little over a month ago I was testing the 3.23.14 ACPI release on the AOS Testers list and found some weird stuff, specifically it was no longer possible to shut OFF a particular CPU core b/c the ACPI Power Manager would continually overwrite that change and effectively bring the core back on-line (that causes me a problem here, but that's a different story).

That has always been the case. You must use the parameter in CONFIG.SYS (and reboot to activate it). Trying to use the command will turn off one, or more, processors, but as soon at ACPI decides it needs more power (usually very quickly), it will turn them back on for you.

Ahh, now this I want to specifically comment on, because what you state is simply NOT quite the case.

Until the 3.23.14 TEST3 version was out, it was possible to run the ACPI drivers with the Power Manager in DISABLED status, which gave you control over actual CPU core status. You could bring any of them down or up as needed. I know, I have relied on this approach basically since going live with SMP and using the ACPI driver set. In fact, strangely enough, even if you had Power Manager ENABLED I still could control the CPU core activation. So I suspect that the previous versions of ACPI drivers wasn't quite able to manage/control something else in my hardware.

Like you, I expected that when the Power Manger is ENABLED the ACPI driver would completely control the CPU cores. However, when DISABLED the ACPI driver should NOT touch the CPU cures.

However, I reported my issue when TEST3 was out and never heard back. Eventually when the 3.23.14 was officially released the previously working functionality completely went away.

Again, keep in mind that when the Power Manager is DISABLED (OFF status) the ACPI driver should NOT be making any changes to the CPU cores.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #5 on: October 05, 2020, 09:41:50 pm »
Hi Dave,

...Occasionally here, I get high CPU usage after a long uptime, this doesn't go away until I revert to a backup of my profile. No idea what causes this. I did seem to fix it last time by killing the browser and restarting, needs more testing.
...Here is a test, http://www.gus.biysk.ru/os4/test/timerTest.html
Probably other issues as well.

I supposed there are other things that come into play here as well.

For example, I find that FF behaves somewhat differently depending on whether I have the following in my CONFIG.SYS:

SET NSPR_OS2_NO_HIRES_TIMER=1

Normally I do have it set as above in order to DISABLE the hires timer. The test you provided the link to (thanks, great reminder) produces pretty steady values and a whole bunch of misses (all RED) when I'm running with the hires timer enabled.

Now the curious thing is: does the /NOHLT option change that?

Yeah...somewhat. The hires timer will produces a steady set of good results provided that I have minimum of FF activity (actual in-browser use), the minute I start browsing that goes to all RED!

Either way all of this may be a moot point, as it turns out the results I was seeing with GMAIL are no longer present. Meaning, the spikes continue regardless of what application/tab have the focus. So much for that...LOL!

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #6 on: October 05, 2020, 11:33:12 pm »
Quote
SET NSPR_OS2_NO_HIRES_TIMER=1

I forget the specifics of what this does but on a system without ACPI, it will use the regular timer whereas ACPI means using the HPET.
Why not use Thunderbird to access Gmail? It's what I do.

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #7 on: October 06, 2020, 05:10:04 am »
Quote
Again, keep in mind that when the Power Manager is DISABLED (OFF status) the ACPI driver should NOT be making any changes to the CPU cores.

You are probably right. Remember that the latest changes to ACPI was to change the way that all works. I think there are a couple of holes in the logic. Whether that will be fixed, or not, remains to be seen. I think it would make sense to add CPU enable/disable to acpid.cfg, but I can't do it. Open an incident, I guess.

Mathias

  • Full Member
  • ***
  • Posts: 196
  • Karma: +2/-0
  • using ArcaOS
    • View Profile
    • IRC
Re: FF 45.x and CPU spikes
« Reply #8 on: October 06, 2020, 09:58:58 am »
I'm also using FF 45.x and see weird behaviour at times on numerous OS/2 machines.
Like for instance when using tabs.

As long as I stay in one tab, it's all fine.
As soon as I open a second tab, the effect starts:

Imagine the following situation:
1st tab: A HTML file hosted on a webserver on the local network. (html 1.0 nothing special, no frames, no active stuff.. just a table with links, written in eFTEPM/2)
2nd tab: a website like duckduckgo.de or let it be google.com or something else.

Now, when I switch away from 1st tab, CPU usage rises to a constant 100%on one (changing) core. As soon as I switch back to the 1st tab, CPU usage returns to 0%.
Now you could say... "ha! It's gogle's fault... somehow!" - But I've also tested it the other way around:
Google first tab, the link collection html file in 2nd tab... and same game: As soon as you switch away from first tab, CPU usage rises... but not always...
Switch back to first tab, and CPU usage returns to 0%.

Sometimes the 0% CPU usage (idle) tab may change: It happens to be 2nd or 3rd tab at times.

Interesting: When you CLOSE the "idle tab", CPU usage remains on 100% on one core! Reopen the same website in a new tab does NOT change the game: CPU usage remains high, even if you switch to that newly (reopened) tab.

VERY weird. However, staying with one tab seems to eliminate that effect.

Eugene Tucker

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +12/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #9 on: October 06, 2020, 02:00:13 pm »
All the more reason to help fund the new browser folks!

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #10 on: October 16, 2020, 02:35:43 pm »
Hi Everyone,

I thought I would provide a quick update on having deployed that /NOHLT option and observing the impact on my system.

In general, the previous issues I would run into with FF have been significantly reduced. While I do not know much about the actual logic that /NOHLT implements, I have to say that even when the CPU spikes occur (and they still do, however much less frequently) the application, and the system overall remain very responsive.

More specifically:

1) GMAIL - spikes still occur when the browser TAB has focus, but once removed (switch to another app or virtual desktop) they go away

2) SYSTEM - it used to be that whatever application was causing spikes would continue to cause them regardless of how much time has passed, that is no longer the case, I have now observed a consistent result where the CPU spikes taper off and the load across all CPU cores falls down to nearly zero, I mean literally a standard 2-4% utilization

I cannot explain it any better than that. It is just a "seat of the pants" feeling, or as we say in car racing: "butt meter" tells me the ride is faster!  ;D

Therefore, for now I'm leaving that setting in place, unless and until my hardware changes and this needs to be re-visited, or someone spells out the reason why this is a bad idea.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #11 on: October 17, 2020, 04:09:06 am »
Have you people tested a new profile? A lot of these problems are likely cruft in the profile.
My SeaMonkey wouldn't display my bitbucket pages correctly (left sidebar just gray areas) and Firefox, while displaying them, used a lot of CPU and was very slow. Tried a new SM profile and the pages loaded fine with close to no CPU usage.

mauro

  • Sr. Member
  • ****
  • Posts: 408
  • Karma: +3/-0
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #12 on: October 18, 2020, 01:01:59 pm »
Have you people tested a new profile? A lot of these problems are likely cruft in the profile.
My SeaMonkey wouldn't display my bitbucket pages correctly (left sidebar just gray areas) and Firefox, while displaying them, used a lot of CPU and was very slow. Tried a new SM profile and the pages loaded fine with close to no CPU usage.

just for a feedback, a new profile hasn't changed those page display problems in my case, but my personal idea is that FF 45.9 is still good for browsing the most of other pages, of course looking for an actual QT5 browser coming.
Furthermore, if I'm allowed to ask this question inside this thread, could someone tell whay I cannot get the sound of youtube videos? They run without audio also whit their volume gadget at 100%
If it depends by the H264 (Open264) plugin, the situation in my FF is the one shown in the image, like it is there but hasn't been installed for some reason.
Thank you


Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: FF 45.x and CPU spikes
« Reply #13 on: October 18, 2020, 07:28:09 pm »
Have you people tested a new profile? A lot of these problems are likely cruft in the profile.
My SeaMonkey wouldn't display my bitbucket pages correctly (left sidebar just gray areas) and Firefox, while displaying them, used a lot of CPU and was very slow. Tried a new SM profile and the pages loaded fine with close to no CPU usage.

just for a feedback, a new profile hasn't changed those page display problems in my case, but my personal idea is that FF 45.9 is still good for browsing the most of other pages, of course looking for an actual QT5 browser coming.

Yes, it really depends on why the CPU is peaking. I'm also using a newer build, which I've had problems uploading.
Even with the new browser, I expect that people will run both in parallel for quite a while. The new browser is going to be missing support for add-ons and it'll take a while to migrate things like passwords.
 
Quote
Furthermore, if I'm allowed to ask this question inside this thread, could someone tell whay I cannot get the sound of youtube videos? They run without audio also whit their volume gadget at 100%
If it depends by the H264 (Open264) plugin, the situation in my FF is the one shown in the image, like it is there but hasn't been installed for some reason.
Thank you

Actually that plugin doesn't do anything on our browser and is for video conferencing. The H264 playback is handled by the FFmpeg libs.
The sound widget on Youtube is broken on our port. I'd suggest downloading PMUniMix from Hobbes and playing with the various volume sliders. I had one box where the front speakers needed to be turned up to hear Youtube audio.