Skip to content

Persistent high CPU load on some web sites #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ms1121 opened this issue Sep 11, 2018 · 49 comments
Closed

Persistent high CPU load on some web sites #253

ms1121 opened this issue Sep 11, 2018 · 49 comments
Labels

Comments

@ms1121
Copy link

ms1121 commented Sep 11, 2018

While the tab is selected, I am seeing high CPU usage in Firefox on some web sites… as if a thread is remaining active and the process never completes. When I disable CanvasBlocker in about:addons and select the tab again, Firefox CPU loading for the page has returned to its normal idle state.

Example: https://homebiogas.com/

@kkapsner
Copy link
Owner

How many notifications do you see in the notification popup?
grafik

@kkapsner
Copy link
Owner

Can you please try the latest Alpha (you have to disable the normal first): https://github.com/kkapsner/CanvasBlocker/releases/tag/0.5.4-Alpha3

@kkapsner
Copy link
Owner

@kkapsner
Copy link
Owner

@tavyra
Copy link

tavyra commented Sep 27, 2018

I'm on 0.5.4 and the problem still exists. Here's an address that will produce the problem without fail: https://www.windowscentral.com/how-use-custom-environments-windows-mixed-reality

@kkapsner
Copy link
Owner

Well... this pages requests ~200 DOMRect values per second - it seems that it's the ads. If I simply activate µBlock the number of requested DOMRects and therefore the CPU loads goes down.

As CB fakes this value I'm not surprised that you see an CPU load increase. But there is little I can do about it. I already try to be as efficient as possible.

PS: you will not see the high DOMRect numbers as CB only reports once for requests for the same object.

@kkapsner
Copy link
Owner

Can you please check which protection causes the problems on the other pages?

@tavyra
Copy link

tavyra commented Oct 5, 2018

I use ublock origin and umatrix, is there a rule or something I should add to keep this from happening? Disabling CB makes my cpu idle normally but I've only got like 70 notifications from ublock+umatrix+disconnect combined. I'm not sure what the other pages were that ended up freezing firefox and I can't think of any other add-ons that would be interfering.

Not knocking your efficiency either, with the exception of the random page that goes from 5% to 100% like a supercar, I haven't noticed any performance impact.

@kkapsner
Copy link
Owner

kkapsner commented Oct 6, 2018

I do not know of a specific rule. I also use NoScript which also helps.

With number of notifications I mean the number in the page action popup (see screenshot in first comment).

@kkapsner
Copy link
Owner

Can you give an example link for amazon? It runs well for me.

The amiunique thing is known and there is not really anything I can do about it - they use a very poorly written script.
You can disable the audio cache temporarily to let it run a little bit faster. But I can tell you that it will say that you are unique...
If you want to test if the fingerprint is changing with every load you can use the CB test pages: https://canvasblocker.kkapsner.de/test/

@spodermenpls
Copy link
Contributor

spodermenpls commented Oct 24, 2018

@Leeweez I can't reproduce this issue either.. maybe open a new Issue, to share detailed information about your configurations and console logs?

@kkapsner
Copy link
Owner

Same for me. Page scrolls fine.

@kokoko3k
Copy link

kokoko3k commented Oct 30, 2018

For me, it slows down on amazon when the mouse is on the image product and the zoomed version appears to the right.
--EDIT--
You may need to search i also tried to disable the protection for dom api, but it is still slow.
the only way to make it fast seems to disable the extension.

@kkapsner
Copy link
Owner

What do you see in the page action popup:
grafik

@kokoko3k
Copy link

kokoko3k commented Nov 5, 2018

Sorry for the delay, i see the following:
Faked DOMRect readout on www.amazon.it (157)

@kkapsner
Copy link
Owner

kkapsner commented Nov 9, 2018

Can you please give me your settings?

@kokoko3k
Copy link

kokoko3k commented Nov 9, 2018

Here they are (i've whitelisted amazon)

{
	"logLevel": 1,
	"urlSettings": [
		{
			"url": "www.amazon.it",
			"blockMode": "allowEverything"
		}
	],
	"hiddenSettings": {},
	"expandStatus": {
		"blockMode": true
	},
	"displayHiddenSettings": false,
	"whiteList": "",
	"sessionWhiteList": "",
	"blackList": "",
	"blockMode": "fakeReadout",
	"minFakeSize": 1,
	"maxFakeSize": 0,
	"rng": "nonPersistent",
	"protectedAPIFeatures": {},
	"useCanvasCache": true,
	"ignoreFrequentColors": 0,
	"minColors": 0,
	"fakeAlphaChannel": false,
	"persistentRndStorage": "",
	"persistentIncognitoRndStorage": "",
	"storePersistentRnd": false,
	"persistentRndClearIntervalValue": 0,
	"persistentRndClearIntervalUnit": "days",
	"lastPersistentRndClearing": 1541763252068,
	"askOnlyOnce": "individual",
	"askDenyMode": "block",
	"showCanvasWhileAsking": true,
	"showNotifications": true,
	"highlightPageAction": "none",
	"highlightBrowserAction": "color",
	"displayBadge": true,
	"storeNotificationData": false,
	"storeImageForInspection": false,
	"ignoreList": "",
	"ignoredAPIs": {},
	"showCallingFile": false,
	"showCompleteCallingStack": false,
	"enableStackList": false,
	"stackList": "",
	"protectAudio": true,
	"audioFakeRate": "100",
	"audioNoiseLevel": "minimal",
	"useAudioCache": true,
	"audioUseFixedIndices": true,
	"audioFixedIndices": "11",
	"historyLengthThreshold": 2,
	"protectWindow": false,
	"protectDOMRect": true,
	"domRectIntegerFactor": 4,
	"blockDataURLs": true,
	"displayAdvancedSettings": false,
	"displayDescriptions": false,
	"theme": "default",
	"dontShowOptionsOnUpdate": false,
	"isStillDefault": false,
	"storageVersion": 0.4
}

@kkapsner
Copy link
Owner

Hm... I do not see anything bad there. Does the problem persist when you disable the DOMRect protection?

@kokoko3k
Copy link

Hi,
if i disable DOMRect API protection, the problem goes away.

@kkapsner
Copy link
Owner

Hm... I still cannot reproduce but I recommend that you then only disable the DOMRect API for amazon and not whitelist it completely.

@kokoko3k
Copy link

kokoko3k commented Nov 13, 2018

Thanks, but it is not clear to me how to disable just the DOMRect API for a specific site.
In the specific site option, i've "block only blacklist", but i'm unable to find where to edit this blacklist, or maybe i'm completely wrong and there's another way (?)

-EDIT-
Whops, sorry, i completely missed the checkbox :)

@kkapsner
Copy link
Owner

For all other searchers:
image

@IceTrayz
Copy link

IceTrayz commented Dec 5, 2018

Someone on a forum had an old Windows XP box that he had to disable CanvasBlocker on as it caused websites like Amazon to become choppy like others have mentioned and he all so had to disable it on a more modern Linux skylake box as 60fps media at Youtube would stutter but was perfectly fine when CanvasBlocker was disabled so something is causing a high overhead or I/O polling that it's not always practical to use?

It might be something to do with Firefoxes API as other extensions can become sluggish on certain pages as i've noticed this with lastpass taking forever.

@kkapsner
Copy link
Owner

I always recommend to identify the part of CB that causes the slowdown (in the case of Youtube I would guess it's the DOMRect-API). The problematic parts can be disabled individually (also on a site by site level).

@ghost
Copy link

ghost commented Dec 29, 2018

I'm getting Firefox errors CanvasBlocker is slowing things down on https://steamdb.info.

This is what CanvasBlocker reports after the page loads (for instance, on the Sales page):

Faked DOMRect readout on steamdb.info
(92)

@kkapsner
Copy link
Owner

It's working fine for me - what are your settings and versions (Firefox/CB)?

@ghost
Copy link

ghost commented Jan 1, 2019

Other than appearance settings I'm running on the default CB settings. Testing it a bit more over the past two days the warning seems to appear only sometimes now. It could be that the official SteamDB Firefox addon could be conflicting with something, I'll test it out some more.

@codejodler
Copy link

Hello Korbinian,
I also noted excessive load after installing the CanvasBlocker addon/extension. Then i tried to figure things and found that another extension, EclipsedMoon (for the Palemoon browser) has a setting 'canvas.poison' checked, in the prefs section 'reduce fingerprinting', and when i uncheck that, the abnormal load is gone, at least on the few sites i tried since then.
This is not totally obvious since that Moon extension is supposed to fake useragents, but actually does a lot more.
So my idea is that the two are somehow fighting over the final result :D

I would not go so far as to notify the Eclipsed Moon developers. I mean, they're doing the best they can.
I think CanvasBlocker should just include a comment directly in the prefs, that the user is responsible for having not any other plugin mingling into the Canvas business.
Cheers,
mi

@kkapsner
Copy link
Owner

Hm... I'm not quite sure where to put such a comment so it's not too in the way but the people read it.

@spodermenpls
Copy link
Contributor

@kkapsner Maybe put such a disclaimer just in the descriptions here and on AMO for now?

@kkapsner
Copy link
Owner

kkapsner commented Feb 2, 2019

Sounds like a good idea.

kkapsner added a commit that referenced this issue Feb 2, 2019
@kkapsner
Copy link
Owner

kkapsner commented Feb 2, 2019

Done

@mutantsushi
Copy link

This is website that triggers persistent script/CPU warning:
https://paizo.com/community/forums/pathfinder/playtest

Also, it happens on Twitter.

The warning doesn't occur, but Disqus discussions won't even display without CB disabled.
(not even logged in to be able to comment, but Disqus comments won't even load with CB)

@kkapsner
Copy link
Owner

I don't get a single CanvasBlocker notification or warning on this page. Please check the notifications to get to know which API/scripts trigger the CB protection.

Twitter is probably the DOM-Rect API. It usually gets a little bit better if you disable the notifications for DOM-Rect.

I have no clue about the Disqus problem (but I know that their technological approach is horrible). Can you give me an example page?

@AeliusSaionji
Copy link

I've just installed this extension today and can attest to it causing serious performance issues.

Observe: https://aelius.keybase.pub/canvasblocker%20amazon%20image%20performance.mp4

@AeliusSaionji
Copy link

AeliusSaionji commented Mar 23, 2019

Also, even when I'm not interacting with the Amazon webpage, firefox is chewing through 20% of my CPU when canvas blocker is loaded. Disabling canvasblocker and refreshing the page allows firefox to idle again.

(I've since read through the thread and excluded amazon from DOM-Rect api, which does sidestep the issue)

@kkapsner
Copy link
Owner

I am aware of this issue but have no good idea how to solve it. There is no good way to distinguish between fingerprinting and legit use of the DOMRect-API.

Maybe I should analyse the amazon code to get the exact problem...

@kkapsner
Copy link
Owner

kkapsner commented May 4, 2019

The code at amazon is not great. It seems to me that they read the DOMRect more often than necessary. The numbers I get when I count every readout are insane (several thousand for one mouse movement). So the only thing I can do is to improve the overall performance of the DOMRect API.

kkapsner added a commit that referenced this issue May 4, 2019
kkapsner added a commit that referenced this issue May 4, 2019
kkapsner added a commit that referenced this issue May 4, 2019
Additional factor 2.6 = total factor 4.7 (For #253).
@kkapsner
Copy link
Owner

kkapsner commented May 4, 2019

I managed to get some performance improvements. The zoomed view at amazon is better but far of being good.

@kokoko3k
Copy link

kokoko3k commented May 6, 2019

Thanks kkapsner!

I'm thinking...
Would it be possible to add an "antihammer" option so that CanvasBlocker wouldn't allow more than (insert number here) requests per second?

@manyplay
Copy link

manyplay commented May 7, 2019

Hi,thx for the great addon!
Can you check the message system on ebay!
I have to disable the addon if i want to write a message...
The edit field is not writable...

@kkapsner
Copy link
Owner

kkapsner commented May 7, 2019

@kokoko3k I could implement that but it would not help the user of such sites as it would completely break them. And despite it being written poorly it's a legitimate use of the API.

@manyplay please open a separate issue for your problem with all the details needed.

kkapsner added a commit that referenced this issue May 11, 2019
Total improvement compared to 0.5.8: 7.2 (For #253)
@kkapsner
Copy link
Owner

With the latest improvements the amazon page is usable. Not good, but usable.

@kkapsner
Copy link
Owner

Please test the latest 0.5.9 as it has some performance improvements.

@kokoko3k
Copy link

Definitely better, thank you!

@kkapsner kkapsner added the bug label Jun 9, 2019
@kkapsner
Copy link
Owner

kkapsner commented Jun 9, 2019

I think with 0.5.10 the performance is acceptable. So I will close this issue. If someone still has an example page that uses lots of CPU or is slow I can reopen this issue.

@vkvijay143
Copy link

vkvijay143 commented Sep 2, 2022

thank you so much..it's working for my website https://ecogenn.com

@buggsi
Copy link

buggsi commented Jul 26, 2024

I was having performance issues on Amazon as well, when hovering on an image (it zooms in on it), if I move the mouse, the CPU would increase to 15% and memory would rise; at some point it reached 4GB for an Amazon tab, and the "zoom navigation" was choppy and slow. I use many extensions, and I pinpointed that CB was causing the problem. Enabling or disabling HW acceleration didn't help. So, after reading this thread, I found that indeed the DOM-Rect had the highest hits:

image

I disabled it as you instructed here #253 (comment) and now the image zooming is fluid again. I used amazon.*, is that a correct usage?

image

Newegg has a similiar zooming feature as Amazon, their DomRect started around 30 hits and after a while it went up to 200, however it doesn't cause any slowdowns (if it does, I know how to fix it now).

My question is, when disabling the DOM-Rect API for a specific site, does it affect the fingerprint faking?

@kkapsner
Copy link
Owner

I used amazon.*, is that a correct usage?

It will match the mentioned domains. But also something like amazon.evil.attacker.net.

My question is, when disabling the DOM-Rect API for a specific site, does it affect the fingerprint faking?

It affects the fingerprinting through the DOM-Rect API. But all the other ways are still protected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests