LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-18-2019, 03:11 PM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,561

Rep: Reputation: 182Reputation: 182
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...
 
Old 10-19-2019, 09:11 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,552
Blog Entries: 25

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

Source: https://support.mozilla.org/en-US/kb...mance-settings
 
1 members found this post helpful.
Old 10-19-2019, 10:51 PM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,620

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Quote:
Originally Posted by frankbell View Post
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?
 
Old 10-19-2019, 10:56 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,552
Blog Entries: 25

Rep: Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511
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.

Last edited by frankbell; 10-19-2019 at 11:00 PM.
 
Old 10-21-2019, 09:46 AM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,561

Original Poster
Rep: Reputation: 182Reputation: 182
Quote:
Originally Posted by Firerat View Post
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. :^/
 
Old 10-21-2019, 09:54 AM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,620

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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

Last edited by Firerat; 10-21-2019 at 09:56 AM.
 
Old 10-21-2019, 03:27 PM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,561

Original Poster
Rep: Reputation: 182Reputation: 182
Quote:
Originally Posted by Firerat View Post
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.
 
Old 10-21-2019, 03:57 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,620

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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
 
Old 10-21-2019, 04:05 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,620

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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

Last edited by Firerat; 10-21-2019 at 04:07 PM. Reason: fixed wrapping in code box
 
Old 10-22-2019, 05:52 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,774
Blog Entries: 9

Rep: Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473Reputation: 3473
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.
 
Old 10-22-2019, 06:05 AM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,620

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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

Last edited by Firerat; 10-22-2019 at 06:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox opens a new empty tab each time I try to open a shockwave file. Joe Messing Linux - Desktop 7 08-18-2014 03:35 PM
FC 4. Modify ALT+TAB behaviour to CTRL+TAB xtracto Linux - Software 1 09-22-2005 03:06 PM
bash "tab tab" - how to turn off? nicflatterie Linux - General 2 04-04-2005 04:09 PM
Out of tab tab benjaminrtz Linux - Newbie 2 04-30-2003 01:39 PM
Redirecting output of tab tab benjaminrtz Linux - General 1 04-28-2003 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration