LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Firefox: Process for each tab: How? (https://www.linuxquestions.org/questions/linux-desktop-74/firefox-process-for-each-tab-how-4175662781/)

rnturn 10-18-2019 03:11 PM

Firefox: Process for each tab: How?
 
I've read about browsers trying to keep an errant tab from bringing down the whole browser by running a separate process for each tab. Sounds like a good idea but how does someone actually turn that on for Firefox?

I've seen a few pages that claim to show how it's done for Firefox running on Windows but nothing that shows, specifically, how to do the same thing on Linux. I've toyed with the "Content per process" setting but it seems to have zero relationship to the number of processes/tab.

Is this "tab == process" feature Windows-only?

If so, is the best (or only) way to identify what tabs are pegging the CPU utilization via the Task Manager and the so-called "Energy impact"? Sometimes, browser performance is so-o-o sluggish it appears that it's hung and trying to open up the Task Manager might take a very long time.

I typically have htop(1) running in a virtual console to monitor who's taking over the CPU when I sense performance problems but see no means of tying Firefox PIDs to particular tabs so as to identify which process/tab to kill. Often, Firefox might be catatonic while the rest of the desktop is working just fine. Knowing what PID to clobber would be handy in those instances. Not being able to identify the culprit tab often means my best course of action is to "killall -9" everything Firefox-related and restoring the tabs when asked after restarting the browser and hoping the problem doesn't recur right away.

Surely there's a better way (besides returning to Chromium) or making the Task Manager my default page---so I don't have to wait quite so long to access it when performance goes south. (If that's even possible.)

Thoughts? Ideas?

TIA...

frankbell 10-19-2019 09:11 PM

Try this: Go to Edit-->Preferences-->General-->Performance and uncheck "Use recommended settings."

Source: https://support.mozilla.org/en-US/kb...mance-settings

Firerat 10-19-2019 10:51 PM

Quote:

Originally Posted by frankbell (Post 6048726)
Try this: Go to Edit-->Preferences-->General-->Performance and uncheck "Use recommended settings."

Source: https://support.mozilla.org/en-US/kb...mance-settings

I've recently re-checked that, Firefox 69 seems to perform much better

in the past it would be a hog, and restricting it mitigated negative effects.
However since 68 I've found Firefox to be less of a burden on mem and cpu so I'm letting it decide once again.
Time will tell, but thus far I'm happy with it.

@rnturn

what version of Firefox are you running?

frankbell 10-19-2019 10:56 PM

I also left that setting at the default. It has been working well for me.

Firefox Quantum was a huge leap forward in usability. I know it broke a number of older plugins, but I've found adequate replacements (either updated older plugins or new replacements) for the few plugins I use, and I think Mozilla made the correct choice in moving to Quantum.

There were lots of dust bunnies that needed to be cleared out of the Firefox code.

rnturn 10-21-2019 09:46 AM

Quote:

Originally Posted by Firerat (Post 6048749)
what version of Firefox are you running?

69.0.1 (x86_64)

I've already unchecked the recommended performance settings checkbox. My hope in doing that was that would unlock the individual processes feature. Even with that unchecked, when I issue:
Code:

ps -ef | grep firefox | wc -l
I still see something wa-a-ay less than the number of tabs that are opened. It makes me think that the "tab == process" feature is vaporware. :^/

Firerat 10-21-2019 09:54 AM

I get something that seems to match well with number of open tabs

Code:

pidof firefox
I did just notice that I have to load pages in the tabs to get new pid

rnturn 10-21-2019 03:27 PM

Quote:

Originally Posted by Firerat (Post 6049210)
I get something that seems to match well with number of open tabs

Code:

pidof firefox

Am I missing a smiley?

That gives me the PID of the main Firefox process (currently 3720) but not the count of the separate processes. It can vary wildly but, if each tab were a separate process, would currently expect a count in the neighborhood of 50.

Firerat 10-21-2019 03:57 PM

pidof firefox

two tabs
Code:

32523 32457 32357 32312 4044
three tabs
Code:

32523 32457 32357 32312 5735 4044
one tab
Code:

32523 32457 32357 32312 5735
four tabs
Code:

32457 32357 32312 6330 6259 6194 5735
I have a lot of bash open
Code:

pidof bash
32280 32109 29678 29607 27771 27711 27684 27306 27272 26248 24949 23637 17675 14109 9429 7571 5209 4400 3116 1158 1004 1003 984 970


what do you get with
Code:

ps -ef | grep firefox | wc -l
2 ?

how about
Code:

ps -ef | grep [f]irefox | wc -l
and you do know wc -l is redundant

Code:

ps -ef | grep -c [f]irefox
ps -ef | grep -c firefox

drop the -c and see why you get the extra 1 ;)


as for why you only have 1 PID for Firefox, I have no idea

Firerat 10-21-2019 04:05 PM

verbose

ps -e -o ppid,pid,cmd | grep [f]irefox
Code:

32312  5735 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 7305 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab
32312  6194 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 7305 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab
32312  6259 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 7305 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab
32312  6330 /usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -prefsLen 7305 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab
    1 32312 /usr/lib/firefox/firefox
32312 32357 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab
32312 32457 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 6298 -prefMapSize 215425 -parentBuildID 20191007230631 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 32312 true tab


ondoho 10-22-2019 05:52 AM

I concur with Firerat: I have 8 tabs open right now, 'pidof firefox' returns 9 PIDs.
If I open another tab, it returns 10 PIDs.
When I close that tab, I get 9 PIDs again.
However, it does not seem to go beyond 10, which kindof agrees with the Preferences saying "Max 8 processes (Default)".

But - I also find many, many more firefox processes with e.g. 'htop'.
Dozens.
But again - with 'top' I find many processes called "Web Content" - and since I have no other internet facing app open atm, they must belong to FF.

Frankly, all this is slightly beyond me, but I don't see any reason to think that FF are lying or "selling vaporware" here.

Firerat 10-22-2019 06:05 AM

Code:

for i in $(pidof firefox )
do
  echo == $i ==
  ps -p ${i}
  ps -f -p ${i}
  echo ====
done | grep -v "  PID"

the "Web Content" is indeed Firefox


tip, in top toggle command line with c

rnturn 11-19-2019 12:57 PM

Quote:

Originally Posted by ondoho (Post 6049495)
Frankly, all this is slightly beyond me, but I don't see any reason to think that FF are lying or "selling vaporware" here.

I think "lying" is a strong way to describe manner in which Mozilla has chosen to promote this feature. I still don't see any way of tying a process to a specific tab no matter how I issue "ps". Even today: dozens of tabs open but only 11 processes. "htop" shows more than that but, still, there is no documented way that I'm able to discern that associates a particular Linux process using the information that I see in either ps or htop to a particular browser tab. I am able see a Firefox process chewing up CPU but cannot know which tab accessing which web site is the culprit. I've since discovered that NoScript seems to be a huge CPU hog on some sites but, since I can't link process to tab/web site, I cannot figure out what to whitelist to keep it from acting on web pages that cause it to swamp my desktop. Sure, I could visit each and every browser tab (keep in mind that the desktop can be almost catatonic when the system is unresponsive due to Firefox processes) and disable NoScript on the tab to see if it reduces the load... then re-enabling it should that tab not be the culprit. My only alternative I've come up with so far is to disable it entirely.

BTW, I'm still on 69.0.1. Newer versions have been insisting that I create an entirely new profile and a Mozilla account. So I'm sticking at this version until I figure out how to migrate bookmarks without having to put them on someone else's computer.

Later, all...

ondoho 11-20-2019 02:51 AM

rnturn, You really seem to have a fundamental problem with FF as you have shown in at least 2 different threads now.
Have you considered actively looking for something that suits your wants better, instead of keeping these futile discussions alive?


All times are GMT -5. The time now is 07:37 AM.