Slashdot Mirror


Firefox Takes the Next Step Towards Rolling Out Multi-Process To Everyone (arstechnica.com)

An anonymous reader quotes a report from Ars Technica: With Firefox 50, Mozilla has rolled out the first major piece of its new multi-process architecture. Edge, Internet Explorer, Chrome, and Safari all have a multiple process design that separates their rendering engine -- the part of the browser that reads and interprets HTML, CSS, and JavaScript -- from the browser frame. They do this for stability reasons (if the rendering process crashes, it doesn't kill the entire browser) and security reasons (the rendering process can be run in a low-privilege sandbox, so exploitable flaws in the rendering engine are harder to take advantage of). Moreover, these browsers can all create multiple rendering engine processes and use different processes for different tabs. This means that the scope of a crash is narrowed even further, typically to a single tab. Internet Explorer and Chrome both implemented this long ago, in 2009. Firefox, however, has not offered a similar design. Although work on a multi-process browser was started in 2009, under the codename Electrolysis, that work was suspended between 2011 and 2013 as priorities within the organization shifted. In response, Mozilla started switching to a new extension system in 2015 that opened the door to a multi-process design. The first stage of Firefox's move to multi-process involves separating the browser shell from a single rendering process that's used by every tab. In Firefox 48, that feature was enabled for a small number of users who used no extensions. Firefox 49 was rolled out to include users running a limited selection of extensions. Now, in Firefox 50, a separate renderer process is used for most users and most extensions. Developers are now able to mark their extensions as explicitly multi-process compatible. Firefox 51 will extend this even further to cover all extensions, except those that are explicitly marked as incompatible. Mozilla says that, even with the limited changes made in Firefox 50, responsiveness of the browser has improved by 400 percent due to the separation between the renderer and the browser shell. During page loads, responsiveness will increase to 700 percent.

17 of 154 comments (clear)

  1. Firefox...hmmm by hyades1 · · Score: 5, Funny

    Isn't that the browser a lot of people used to use before the developers decided to wreck just about everything they liked in order to turn it into some kind of inferior imitation of Chrome?

    --
    I've calculated my velocity with such exquisite precision that I have no idea where I am.
    1. Re:Firefox...hmmm by grcumb · · Score: 5, Funny

      I wouldn't say splitting stuff into different processes is wrecking Firefox.

      Every single grizzled, grey-haired veteran of the Browser Wars is putting on his best Comic Book Guy expression right now, and saying, "Multi-process vs multi-threaded, is it? You are discussing the virtues of a multi-process software application from a security perspective? How... interesting."[*]

      --------------
      [*] The decade-long turf-war between supporters of multi-process architectures and adherents of the multi-threaded heresy is legendary, for those who survived it. It consisted largely of a bunch of jaded old fucks warning each succeeding generation of new kids that multi-threaded sounds like a better optimisation, but if you just live with the extra few cycles required to spawn each new process, you get software that's way easier to manage. And successive generations of way-too-fucking-clever comp-sci grads yelling, 'Fine, gramps, but it won't matter how secure your apps are, 'cause no one's gonna buy them!!' and then rage-fragging a few more newbs before going back to coding their magnum opus. Then the SystemD singularity did for the Linux community what Trump did to the electorate, and all the old fucks quietly barred the door to their cabin in the woods, and cleaned their shotgun.[**]

      [**] And then Netscap^H^H^H^H^H^HFirefox announces that multi-process is cool and more secure.

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
    2. Re:Firefox...hmmm by Motherfucking+Shit · · Score: 4, Insightful

      It's coming back, albeit gradually. They're getting rid of bloatware like Hello, Pocket is easy to disable, and Classic Theme Restorer still works fine even though it shouldn't have to exist. Going from 47 to 50, memory usage has dropped for me. I still see some hiccups. Ghostery doesn't work properly for me in 50.x (its dialog is blank). According to the Add-on Compatibility Reporter, about half my addons are "Not compatible with multiprocess," so I won't turn that on. And something changed between 50.0.2 and 50.1 that causes brief freezes when I'm scrolling.

      I at least feel like they're finally moving the project in a good direction, being a good browser instead of trying to be an entire OS.

      --
      "BSD: Free as in speech. Linux: Free as in beer. Windows 10: Free as in herpes." --Man On Pink Corner in #52607549.
    3. Re:Firefox...hmmm by MSG · · Score: 3, Informative

      No, it's the browser people use because they want to sync their bookmarks *and* have extensions on a mobile device.

    4. Re:Firefox...hmmm by fisted · · Score: 2

      Netscap^H^H^H^H^H^HFirefox announces that [...]

      What is this NFirefox? I hadn't heard about it yet. New firefox? Next firefox?

      That said, am I the only one who does NOT want multi-process simply because it's annoying as fuck already that firefox hogs ONE core? I don't want it to hog EVERY core, for resource waste, noise and temperature reasons.

    5. Re:Firefox...hmmm by sremick · · Score: 4, Insightful

      Chrome? Isn't that the trojan that gets bundled with every unrelated download one finds on the internet, and then once it gets sneaks onto a user's computer and tricks the user into making it their default browser, arrogantly takes over the computer spawning a dozen background processes that exhaust all available CPU and RAM, bringing everything to a crawl?

      I've been in IT for decades, and have been rather ambivalent about Firefox-vs-Chrome until just recently, mainly just being content as long as users weren't using IE. However, despite any influence from me, I've seen countless longtime Chrome fans abandoning it and coming back to Firefox because of the background process/CPU/RAM issue I mention above. This is also being seen on both Windows and Mac platforms... it's not specific to either OS. At my work, Firefox continues to be the deployed browser of choice to all the many thousands of computers we manage because Chrome is an ass and thinks you don't want to use your computer for anything but web browsing.

    6. Re:Firefox...hmmm by postbigbang · · Score: 2

      Firefox 50.1 has taken its trickle of rendering and tab cleanup to be measured in furlongs per fortnight. It has become horrifically slow, not the reverse using common add-ins.

      Worse, some pages simply die or are rendered incorrectly if at all.

      While I used Firefox loyally, especially for its debug qualities, I might actually be forced to change because it is stunningly slow even on fast hardware. It's like I leaped back to 1998.

      --
      ---- Teach Peace. It's Cheaper Than War.
  2. Re:Stopping processes of background tabs? by Anonymous Coward · · Score: 2, Interesting

    It's actually something they're investigating for Firefox right now, and one of their focuses for the whole Project Quantum thing seems to be to try to reduce the amount of CPU usage that background tabs get (unless it's somehow clear that they're supposed to be working in the background without being slowed down too much). Hard to say what the results will be at this early stage, but there's a lot of interesting stuff that seems possible now that they've rewritten most of the browser to support e10s.

  3. Surprisingly my plugin still works by rsilvergun · · Score: 2

    last I heard they were going to break it with version 40 sometime in August. There's a ton of work that'll have to be done to make it work properly in a multi-process environment. More or less a full re-write. To say nothing of having to redo all my UI components. Here's hoping they get cross compatibility with Chrome so I can at least get some code reuse out of it.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  4. Re:Not all rosy by trparky · · Score: 4, Informative

    You can control how many sub-processes are created by the browser using an entry at the about:config screen. If you set it to one it will only spawn one sub-process. This will of course negate the whole idea of having sub-processes since all tabs would be running in one rendering sub-process but it would fix your issue.

  5. Re:How many DNS queries can it launch by DonaId+Trump · · Score: 5, Funny

    We're going to fix that problem in my first 100 days in office, believe me. DNS is low energy and high latency, SAD! Did you know there are DNS servers in Mexico and CHY-NA, folks? I'm going to make it ILLEGAL and force every link on the cyber to go through my new URL shortening service, HTTP://BIG.LY. I'm appointing Barron to run it so you know it's going to be the best!

  6. Re:Not all rosy by tepples · · Score: 2

    I've been using Firefox 51 from the firefox-next PPA in Xubuntu on a 1-core, 2-thread Atom N450 laptop for a couple weeks now. Even if all tabs run in one process, scrolling still runs smoothly because it's in a separate process, though occasionally I outrun the rendered portion and there's a delay before the blank part fills in.

  7. Re:Not all rosy by subreality · · Score: 2

    I suggest you look at cgroups. Instead of relying on the processes to play nice with resources, you can specify the resources you want allocated to each user. For instance, if each user has cpu.shares=1024, then it'll fully balance - if user A starts an old firefox and it's running singlethreaded, and user B starts a new firefox and it spawns 50 processes, you'll see user A's process consuming 50% of CPU, and user B's flock consuming 1% CPU each.

    In this way you specify what you want to achieve (user B doesn't steal all the CPU making life suck for user A), instead of how to achieve it (singlethreaded software, and relying on users to not run more than one copy). It's easier and more efficient.

    The other cool part: this may already be set up for you. On my Ubuntu 14.04 system this is all done by default when I log in.

  8. Re:Not all rosy by munch117 · · Score: 2

    I'm curious, in what way does turning threads into processes overrun CPU resources? Threads can peg the CPU meter on multiple cores just as easily as processes can. Is it a page table thing or an OS scheduler thing or what?

    It seems to me that you have an operating-system level problem. If nice and ulimit and the OS scheduler aren't cutting it, then they need to be improved or replaced.

  9. Re:Not all rosy by AmiMoJo · · Score: 3, Informative

    They can't win. If they don't do it, Firefox's performance and security will continue to fall behind and the vast majority of users will complain. If they do it, a small number of users with unusual use-cases will complain that it breaks their system. If they try to accommodate both it will create much more work and delay the feature.

    Oblig. XKCD.

    --
    const int one = 65536; (Silvermoon, Texture.cs)
    SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
  10. Re:That's nice by AmiMoJo · · Score: 2

    Firefox doesn't leak memory these days. Some add-ons do, but that's the add-on developer's fault. Part of the trade-off for having powerful add-ons with deep ties into the browser is the risk of memory leaks and security issues. Chrome is much more restrictive and aggressively manages add-ons, but even there you can get memory leaks with Javascript heavy sites like GMail.

    --
    const int one = 65536; (Silvermoon, Texture.cs)
    SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
  11. Generally speaking a good thing by m.dillon · · Score: 2, Interesting

    I'm glad they're finally giving each tab its own process. Of course, if they didn't they'd wind up in the dust bin of history... its about the minimum of work they need to do just to keep Firefox relevant. There is much more they need to do in addition. Honestly, Firefox's biggest competition here, after fixing the tab problem, is going to be chrome 55 with its significantly improved (reduced) memory footprint.

    The interesting thing about giving each tab its own process is that although this increases the total amount of memory used by the browser, it also has the effect of reducing the memory fragmentation that forces the OS to keep almost every byte of it in core (Firefox is best known for this effect). With the process separation, the OS will have a much easier time paging out unused memory without nominal browser operation forcing every single last page back in. THAT is a big deal, and is one of the reasons why chrome is so much more usable than firefox.

    I regularly leave my browser(s) running for weeks. Process sizes generally bloat up during that time, to the point where the browser is consuming ~8GB+ of ram. With Firefox the horrid memory management in-browser forces most of that to stay in core. With chrome, most of it gets paged out and stays out. This makes chrome far more usable, particularly considering the fact that my workstation runs from a SSD and has a relatively large (~60G) swap partition configured.

    But these days I'm a chrome user. Firefox has been too buggy for at least the last 4 years. It crashes on all sorts of things, taking the whole browser out with it. And after all this time they *STILL* can't fix the idiotic pop-up windows. Disable popups only disables some of them. That and the bugs is the main reason why I stopped using Firefox.

    In terms of sandboxing... also a good thing. In addition to the work the browser does, I also segregate my browser instances into multiple dummy user accounts (that my GUI buttons can just ssh into from my main account), and run multiple instances of the browser from those. One for unsecure browsing, one for browsing important accounts, and one with the most bulletproof setup I can think of (no video group access, no direct X server access)... which is slow, but about as safe as its possible to be in an X environment.

    People often forget about user account separation. It's a bit sad.

    -Matt