Closed Bug 1222629 Opened 9 years ago Closed 9 years ago

Can we bump the per-origin worker limit?

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1241485

People

(Reporter: luke, Unassigned)

Details

We're getting feedback from devs using workers that the 20-per-origin limit is too low. (Note: this isn't 20 simultaneously-active workers; the goal isn't to super-saturate the CPUs, but to reflect some pipeline in the program logic.) Once on irc I got bent to agree we should raise the limit. bug 1052398 comment 15 suggests khuey is also "not opposed". We still should have some limit, but it seems like it could be much higher, say 128. Given that there are already many many ways for a page to exhaust resource quotas, it seems like we don't need to be stingy for this on case of OS threads. (Independently, I think we should throw when the limit is hit, but that's a separate issue: bug 1052398.)
I think this makes sense. Should we have different limits on desktop/mobile/fxos?
(In reply to Luke Wagner [:luke] from comment #0) > Once on irc I got bent to agree we should raise the limit. Logs or it didn't happen ;) But more seriously: at least a few years ago some linux machines could get pretty wedged if you made a ton of threads that were all running. You would have a hard time switching to other programs and even getting the task manager up. Maybe things have gotten better since then, but at the time it didn't seem like we could treat OS threads as "just another resource" so we were a little stingier... That being said, that's really an OS problem and we shouldn't have to care, so I'm ok with bumping the limit up too.
That's a good point about not wedging the machine. We've already talked about worker thread throttling (via priority) for background tabs or when the total number of active workers is significantly greater than # cores (re: navigator.hardwareConcurrency concerns); that could help this situation too. Moreover, if a malicious site is intent doing this, it seems it could just as well use 10 origins (or, I expect, eTLD+1s) to perform the attack instead of 1.
I have the trivial patch in bug 1241485, and also did some testing what other browsers do.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.