Bug 194444 - [WPE][GTK] Enable CPU limit
Summary: [WPE][GTK] Enable CPU limit
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-08 12:00 PST by Michael Catanzaro
Modified: 2019-04-11 09:30 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2019-02-08 12:00:24 PST
We should consider moving the CPU limit support from WebProcessCocoa.mm into cross-platform code, and adding a new WEBKIT_WEB_PROCESS_EXCEEDED_CPU_LIMIT termination reason. Looks straightforward. The only hard part would be choosing the right limit. Cocoa makes it configurable via API, but I suspect a hardcoded limit would work better for WPE/GTK. It's not clear what that limit should be, though.
Comment 1 Konstantin Tokarev 2019-04-11 07:35:28 PDT
If it's not clear what that limit should be, how can you hardcode it? It may be different for different kinds of applications or target systems
Comment 2 Jérémy Lal 2019-04-11 08:29:55 PDT
Seconded, i occasionally use webkitgtk for svg/dom SSR intensive tasks that can load cpu at 100% for several minutes with very high memory usage. Having limits that way is an important feature, but it's also important to be able to switch them off.
Comment 3 Michael Catanzaro 2019-04-11 09:12:37 PDT
Please understand the web process will be killed if the CPU limit is reached. So you'll have to make sure your web content does NOT trigger the limit. It won't be a friendly limit that just throttles you. Point is a web browser should not be executing CPU-intensive content for long as it could drain the user's battery life.
Comment 4 Konstantin Tokarev 2019-04-11 09:25:23 PDT
>Point is a web browser should not be executing CPU-intensive content for long as it could drain the user's battery life.

Which is the last thing could I care about when my PC is plugged into AC network :)
Comment 5 Konstantin Tokarev 2019-04-11 09:28:47 PDT
What is actually important for users is blocking or at least detection of scripts which siltently do cryptomining in background
Comment 6 Konstantin Tokarev 2019-04-11 09:30:41 PDT
*for desktop users; embedded story is different, draining CPU here may make whole system unusable so it's often preferred to break misbehaving content in order to preserve stability