Hacker News new | ask | show | jobs
by deprave 3285 days ago
Please DO process-per-tab. I have a lot of memory. I want you to use it. If it's not enough, I will buy more memory or a stronger device. But please, whatever you do, don't make security or stability trade offs for me. The M:N threading model has never worked out. We know 1:1 works. Please do that. Please, please, please use a process-per-tab.
7 comments

Why? You can change the number of processes to e.g. 1000 and you will basically get one process per tab until you reach 1000 tabs, and if you do, you will need really a large amount of memory.

one process per tab is specifically why I quit using chrome, it wasn't working even for small amount of tabs (100) it ate RAM like crazy. Mozillas approach is better, user can control how many processes are created - users have control.

It's simple. There is no way Firefox can guarantee anywhere near the level of stability and security Chrome offers without a process per tab. OS primitives operate in terms of processes (scheduling, memory, sandboxing, and so on) and Firefox will not be able to use any of them. I really want to use Firefox, but I'm almost certain not doing a process-per-tab will be the last nail in its coffin. The code will be more complex to maintain, and no advantages in security or performance will be gained, leading to less users and thus less maintainers.

If there was one thing that caught my attention with Chrome back when it was released (2008?) it was its reliance on OS primitives (processes) as the building blocks for a stable and secure browser. This is essentially the same argument the Varnish folks did when comparing to other proxy solutions like Squid back in the day. I don't understand why Firefox is taking this route.

> There is no way Firefox can guarantee anywhere near the level of stability and security Chrome offers without a process per tab.

It has no security benefit without Site Isolation (which isn't unconditionally a process per origin either for performance reasons). In both Chrome and Firefox, any site can embed another cross-origin site in an iframe, and it will share a process (and a main thread).

Chrome does not use an unconditional process per tab. Nobody would.

I believe Chrome is moving to having cross-domain iframes in separate processes. I remember seeing a flag for it.
Not for all sites unconditionally, only for those that opt into site isolation or are high value. Too many sites have tons of iframes to do otherwise.
Chrome doesn't appear to default to process per tab either. See: https://www.chromium.org/developers/design-documents/process...
Go to about:config and change dom.ipc.processCount to a high number. You'll get the behaviour you want.

Four is a reasonable default, especially given that multi-process is so new. It's possible that the default number may increase in the future, but that will depend heavily on memory usage.

My counter-point. Please DON'T do process-per-tab! I don't have a lot of memory (just 8GB, of which a lot is consumed by other applications running concurrently). I don't want Firefox to become like Chrome (with several processes - not necessarily process-per-tab, as clarified by others) and become all sluggish and slow down the system just because I opened 50 tabs (I open many more tabs normally)! For me, Firefox has always excelled in handling tons of tabs compared to Chrome. I'm also sure that the Firefox team is aware of the trade-offs and has thought through this for a long, long time.
> I have a lot of memory

Not to do process-per-tab and 500 tabs. Each browser process is several tens of megabytes, somewhat unavoidably (that's assuming you do some sort of embryonic startup and then forking so const non-relocatable data can be shared; if you don't it's a lot more). So on pretty much any consumer hardware you would be constantly swapping at best.

Which is why there is not a single browser that does process-per-tab. Chrome certainly doesn't: once you have more than a few tabs they start multiplexing them across processes.

>Please DO process-per-tab. I have a lot of memory. I want you to use it.

I hope that you ask them to add it as an option instead of replacing the current model. Firefox already uses my 8GB memory quite easily when I have many tabs open.

It is available as an option. "dom.ipc.processCount" in about:config allows you to set the maximum number of processes that it'll use. Set it to something like 1000 and it'll use a separate process for each tab (unless you actually open up 1001 tabs).

They are also working on a UI for changing that max process count (don't think that's in Firefox 54, but I could be wrong), but that UI currently only offers values 1 through 7, as it's just really unlikely that a normal user would actually want to sacrifice their RAM like that.

Chrome doesn't do process per tab either.
even chrome doesn't do one process per tab afaik, if I recall they do something closer to process per domain