Firefox brutally slow under Linux now

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
Seems there's been some kind of update and FF is brutal slow. Loading web pages feels like dialup, sometimes they even stop loading half way, and everything is white. Have to hit F5 several times to get stuff to load properly.

Is there a way to fix this? It's really bad. Running Linux Mint 18.
 

Bardock

Senior member
Mar 12, 2014
346
39
91
I have Ubuntu and it's working great for me? Maybe erase your profile.

Just start Firefox from terminal with


Firefox -P

To bring up Firefox manager. Then create a new profile. Could be an extension slowing you, do you have any installed?
 

Qwertilot

Golden Member
Nov 28, 2013
1,604
257
126
Try it with a few of the myriad other browsers first to make sure it just firefox of course.
(You've very likely done this.).
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
Yeah I have chromium installed which is bare (no bookmarks or extensions or changed settings or anything like that) and it's faster.

The firefox slowdown seems to be really sporadic. When it's slow, when I do "top" it also shows that it's using over 100% cpu. There's also a process called "Web Content" that will hog the cpu a lot, even when idle. It's sporadic though. Like right now it's not bad, but sometimes I'll be typing and it's super jerky.
 

lxskllr

No Lifer
Nov 30, 2004
57,426
7,613
126
I get all the symptoms you're talking about, but not nearly to the same degree. My machines are as old as first gen C2Ds, and it isn't unusable. Slower than chromium, but nothing that can't be lived with.
 

you2

Diamond Member
Apr 2, 2002
5,705
938
126
Are you swapping ? Also both firefox and chrome will leak memory like a ... the real killer these days in all these browser is java-script. Sites frequently set up loops that sit there and pull ads. I've started disabling java script by default.
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
Actually I think I am slightly. Right now it's acting normal, though still using a lot of resources:

Code:
Tasks: 188 total,   1 running, 187 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.1 us,  0.4 sy,  0.0 ni, 97.1 id,  0.4 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  8008824 total,   338268 free,  1440188 used,  6230368 buff/cache
KiB Swap:  8310780 total,  8246176 free,    64604 used.  5906804 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                          
 2303 ryan      20   0 1216632 137144  32256 S   6.7  1.7  18:37.49 cinnamon                                         
25231 ryan      20   0 2514512 549684 124504 S   6.7  6.9  19:24.41 Web Content                                      
    1 root      20   0  185536   4448   2668 S   0.0  0.1   0:02.92 systemd                                          
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.02 kthreadd                                         
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.18 ksoftirqd/0                                      
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H                                     
    7 root      20   0       0      0      0 S   0.0  0.0   0:55.81 rcu_sched                                        
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh


I'll have to post when it starts to act up again just to compare.
 

amd6502

Senior member
Apr 21, 2017
971
360
136
how many tabs do you have open?

have you tried

about:performance

let me try that again:
a b o u t : p e r f o r m a n c e

it's quite useful

using private windows or clearing your cache every so often can also help speed it up.

There are tracking scripts that run on many pages that do statistics and who knows what sort of waste and abuse of computation, and if you have a large number of cookies with tons of search term history and page visits, then the computation is vastly increased. With a private window all cookies are cleared and usually there isn't much for these scripts to process; still I've seen pages that even with private window and cleared cookies will create arrays gigabytes large just to slow down the computer and increase the likelihood of ad misclicks.

I'd also recommend palemoon browser. if you're running on a low memory system you might consider the 32 bit version; more memory efficient. https://linux.palemoon.org/download/mainline/

I'm trying to hold out as long as possible to upgrade from 17 to 18. I'm expecting a whole lot of bugs and headaches from the switch to systemd if I were to upgrade.
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
I typically only have like 5-10 tabs open at very most. FF does not seem to release resources so even if you close tabs it's still slow. It seems it only takes one "trigger" site to make it slow, then it's going to be slow until it's fully restarted. Normally that involves kill -9 because even when you close it, it stays open in the background and won't let you reopen it.

Right now it seems ok, but I'll try that about:performance tab next time it starts to act up. Typically anything with video is going to kill it. Like I was trying to watch the NASA live feed during the eclipse and I pretty much could not even type anything in text boxes like forums etc.
 

amd6502

Senior member
Apr 21, 2017
971
360
136
Next time it acts up, can you do a 'top' command and give us an output.

Firefox (or any other app) can get your system to a crawling halt if it ever consumes all of your physical memory. I guess you have 8gb which is good, so it would take a pretty nasty malicious page to get your computer to swap.

Also, what is about : performance telling you, when you encounter the slowdown?

Have you done a Mint system update and are you running a pretty current version of firefox?
 

you2

Diamond Member
Apr 2, 2002
5,705
938
126
Is it cpu slow or swapping slow ? You can check swapping via iostat -x 2 /dev/sd*

I typically only have like 5-10 tabs open at very most. FF does not seem to release resources so even if you close tabs it's still slow. It seems it only takes one "trigger" site to make it slow, then it's going to be slow until it's fully restarted. Normally that involves kill -9 because even when you close it, it stays open in the background and won't let you reopen it.

Right now it seems ok, but I'll try that about:performance tab next time it starts to act up. Typically anything with video is going to kill it. Like I was trying to watch the NASA live feed during the eclipse and I pretty much could not even type anything in text boxes like forums etc.
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
CPU mostly. When it's slow it's usually pegging cpu to 100%. Though it does use most of the ram too. It just keeps growing. It's only using about 600MB right now as I type this though. The slow down really seems to happen if I decide to watch any kind of video or multimedia. Or some random websites will make it slow too. Usually terribly written ones that have too much js. But then it will continue being slow even when closing the tab. Ex: it does not release resources. It's not unusual for it to start using like 8GB of ram which will then cause swapping.
 

manly

Lifer
Jan 25, 2000
11,027
2,148
126
My experience was mostly in Mac OS X, but none of the modern Web browsers releases RAM the way you'd assume they would. Some are better than others, Chrome is thought to be the most aggressive at using RAM. Safari on Mac is known for great energy efficiency, but since version 6.x it will basically use up all RAM on your system if you never quit it. Firefox tends to be thought of as "somewhere in the middle". I'm not speaking of mobile variants because their process model is quite different and a mobile OS can kill a process whenever it's backgrounded.

My retired Mac has 3 GB of RAM, and using a Web browser with numerous tabs was a big problem. There were some tricks such as killing the page rendering process (Safari). You assume that if you close a tab (or window), any RAM resources used by the history (stack) of pages in that tab would be released. This is only partially the case, if you close all windows, you'll never get back to the original baseline of the app when you first opened it. FWIW I believe Firefox is just barely rolling out multi-process to more users, so this is a problem.

I don't get the CPU spikes that you're seeing; that is more likely a runaway script or bad plug-in.

Now I have 16 GB of physical RAM so hardware has mostly solved the problem for me. The crazy thing is how memory hungry Thunderbird is. I realize all email clients have an HTML renderer built-in but Thunderbird really should have just a small fraction of the "browsing" history of Firefox. See below. Uptime < 48 hours so this is gonna get much worse as the weeks go by.
Code:
top - 11:02:51 up 1 day, 22:00,  1 user,  load average: 1.06, 0.84, 0.61
Tasks: 247 total,   1 running, 245 sleeping,   0 stopped,   1 zombie
%Cpu(s):  3.6 us,  0.6 sy,  0.0 ni, 95.7 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16148460 total,  6180728 free,  5669544 used,  4298188 buff/cache
KiB Swap:  2097148 total,  2097148 free,        0 used.  7866904 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND    
 3016 manly     20   0 5196852 2.525g 356800 S  28.5 16.4 217:13.25 Web Content
 2853 manly     20   0 3816216 1.275g 499508 S   2.0  8.3 102:19.42 firefox    
 3131 manly     20   0 3285136 1.061g 131668 S   0.0  6.9   8:58.05 thunderbird
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
This started again. It seems to be worse when the computer has been sitting idle for days and it's opened for the first time. Even simple things like moving cursor around, it does not activate hover stuff or places where cursor is suppose to change (ex: finger icon) because it's so choppy. Have to click multiple times for stuff to go etc. It's terrible.

Even a simple web page like duckduckgo takes about 20 seconds to load.
 

edcoolio

Senior member
May 10, 2017
275
75
56
This started again. It seems to be worse when the computer has been sitting idle for days and it's opened for the first time. Even simple things like moving cursor around, it does not activate hover stuff or places where cursor is suppose to change (ex: finger icon) because it's so choppy. Have to click multiple times for stuff to go etc. It's terrible.

Even a simple web page like duckduckgo takes about 20 seconds to load.

Make sure hardware acceleration is turned off.

Get rid of any adblockers that are not ublock origin, as they tend to beat up the CPU.

Good tweaks HERE and HERE.

Make sure and move the cache to RAM.
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
Yeah I always turn hardware acceleration off as it tends to cause weird issues like one half of the screen not updating in sync with the other. Does ublock work for Youtube now? At one point Youtube found a way to defeat it so I had to switch to Adblock Plus.

Right now I seem to have lost all cursor hover type ability. Even going through bookmarks there is zero response. Heck even the text cursor just stays as a text cursor throughout the browser while in the edit box. Iti's so slow that it's not changing cursors as needed.

Is there a way I can do a full reinstall? If I just do a regular uninstall it still leaves crap behind.

Edit: Seems a full reboot helped for now.
 
Last edited:

amd6502

Senior member
Apr 21, 2017
971
360
136
On my Mint 17 box I feel like Ubuntu is using some really dumb Firefox versions (the buggiest possible?). One of my wilder theories was they want people to upgrade from 1404-LTS to the new 2017 version so they put retarded updates to annoy people into doing a dist-upgrade.

So what I did recently was just download the latest firefox and installed it somewhere in my home directory. So I've temporarily switched away from using Ubuntus firefox.

You should give that a try. Also give Palemoon a try. http://linux.palemoon.org/download/installer/

Download the tarball and hit it with tar -xvf
 

Red Squirrel

No Lifer
May 24, 2003
67,403
12,142
126
www.anyf.ca
Hmmm how hard is it to install Firefox without using repos? I would figure something like that would drag you through the depths of dependency hell as it's still a rather complex program.

Might have to do just that. Could maybe even experiment with running it in a chroot environment, that's how a browser SHOULD be run anyway because it would stop potential malicious sites from being able to access your system files.
 

you2

Diamond Member
Apr 2, 2002
5,705
938
126
Have you watched memory usage to see if it is swapping. Part of the problem is many web pages run continously (java script); I was doing some tcp dumps and noticed that several sites setup java script loops to continously pull ads. If you have many open tabs this adds up quite fast and java scrip is not that efficient in many cases. On chrome i've completely disabled java script.