Am Tue, 21 Mar 2017 21:51:05 +0200
schrieb Alan McKinnon <alan.mckin...@gmail.com>:

> On 21/03/2017 21:50, Kai Krakow wrote:
> > Am Tue, 21 Mar 2017 21:35:36 +0200
> > schrieb Alan McKinnon <alan.mckin...@gmail.com>:
> >  
> >> This post is rather vague, sorry about that in advance.
> >>
> >> I've spent much time on this and gotten absolutely nowhere. So I
> >> conclude all my thoughts and assumptions are wrong and not worth
> >> even sharing (on account of them being so wrong).
> >>
> >> I have firefox like this:
> >>
> >> [I] www-client/firefox
> >>       Available versions:  45.7.0^d 45.8.0^d (~)51.0.1^d {bindist
> >> custom-cflags custom-optimization dbus debug ffmpeg +gmp-autoupdate
> >> +gstreamer gtk2 hardened hwaccel jack +jemalloc +jemalloc3 +jit
> >> neon pgo pulseaudio rust selinux +skia startup-notification
> >> system-cairo system-harfbuzz system-icu system-jpeg
> >> system-libevent system-libvpx system-sqlite test wifi L10N="ach af
> >> an ar as ast az be bg bn-BD bn-IN br bs ca cak cs cy da de dsb el
> >> en-GB en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy ga gd
> >> gl gn gu he hi hr hsb hu hy id is it ja ka kk km kn ko lij lt lv
> >> mai mk ml mr ms nb nl nn or pa pl pt-BR pt-PT rm ro ru si sk sl
> >> son sq sr sv ta te th tr uk uz vi xh zh-CN zh-TW"} Installed
> >> versions:  51.0.1^d(21:30:20 21/02/2017)(dbus gmp-autoupdate
> >> jemalloc pulseaudio skia startup-notification system-harfbuzz
> >> system-icu system-jpeg system-libevent system-libvpx system-sqlite
> >> wifi -bindist -custom-cflags -custom-optimization -debug -gtk2
> >> -hardened -hwaccel -jack -neon -pgo -rust -selinux -system-cairo
> >> -test L10N="en-GB en-ZA -ach -af -an -ar -as -ast -az -bg -bn-BD
> >> -bn-IN -br -bs -ca -cak -cs -cy -da -de -dsb -el -eo -es-AR -es-CL
> >> -es-ES -es-MX -et -eu -fa -ff -fi -fr -fy -ga -gd -gl -gn -gu -he
> >> -hi -hr -hsb -hu -hy -id -is -it -ja -ka -kk -km -kn -ko -lij -lt
> >> -lv -mai -mk -ml -mr -ms -nb -nl -nn -or -pa -pl -pt-BR -pt-PT -rm
> >> -ro -ru -si -sk -sl -son -sq -sr -sv -ta -te -th -tr -uk -uz -vi
> >> -xh -zh-CN -zh-TW") Homepage: http://www.mozilla.com/firefox
> >> Description:         Firefox Web Browser
> >>
> >> with these plugins:
> >> - adblockplus
> >> - flashblock
> >> - foxyproxy standard
> >> - restart browser
> >> - user agent switcher
> >> - youtube all html5
> >>
> >> Occasionally, according to no discernable pattern, all my tabs on
> >> all some/most/all Firefox windows stop responding. Clicking and
> >> scrolling in the content has no effect. Can't open new tabs, can't
> >> close tabs, can't switch to existing tabs. Sometimes it affects
> >> only one firefox window, sometimes all firefox windows.
> >>
> >> Imagine if you will that firefox is coded with one global loop that
> >> gets user actions and responds, then that loop gets stuck
> >> somewhere. The firefox window will not be affected (controlled by
> >> KDE), and neither is the X-server but the tabs can all do nothing
> >> till the loop unsticks. It's an effect like that.
> >>
> >> Sometimes it does work after a delay >30s.
> >> The sysadmin in me says 30s? Hah, check DNS resolver timeouts.
> >> Checked, found nothing unusual. Proxy looks OK, VPN looks OK,
> >> Chrome never has this problem so it's firefox specific.
> >>
> >> Firefox itself is up, it responds correctly to moving around the
> >> menus, just can't do some of the actions like open the Addons page
> >> (that is regular content in a tab).
> >>
> >> The issue ALWAYS goes away if I restart firefox, either with the
> >> restart addon or Alt-F4 and start from KDE menu. I have "load
> >> previous tabs" set to true so those actions are pretty equivalent.
> >>
> >> DE is Plasma 5, and the problem isn't from a recent upgrade, I've
> >> been battling with this for ages through MANY kde and firefox
> >> updates.
> >>
> >> My question:
> >> Where the hell do I start to figure out what's really going on?
> >> I used up all my sysadmin troubleshooting knowledge and have had to
> >> revert back to n00b status on this one.  
> >
> > I didn't use Firefox in a long time but remember similar effects
> > until I stopped using AdBlock Plus (Chrome showed similar stalls
> > with it, just not completely blocking, only one tab blocking). If
> > this is what affects you, maybe try Ghostery instead (which is what
> > I am using with Chrome now).
> >
> > If it doesn't help, deactivate the next addon. Every addon hooking
> > into web site rendering can create such problems easily, so start
> > with those addons first.
> >  
> 
> 
> Good advice I'll do that.
> 
> But, I did do that test already and disabled all addons a while ago, 
> problem still happened. I won't swear I did the test properly, maybe
> I made a mistake.
> 
> Still, it's worth repeating just make sure

Test one by one... Either disable all, then enable one by one, or
vice-versa.

Chances are that your FS may be blocking on sync. Do you maybe have a
very high value in /proc/sys/vm/dirty_background_{ratio,bytes}?

If ratio is 0, then bytes is used. Ratio is a percent of your physical
RAM. With the default kernel value in modern systems, this is
ridiculously high for desktop systems. Maybe put a fixed value, like
128MB. The dirty background value is the amount of outstanding writes
before a foreground process blocks on further writes. If this value is
high, a sync may cause processes to freeze for a long time. Setting
this to a lower value forces single processes to block early and give
the kernel a chance to write back dirty data.

The next value to check is dirty_{ratio,bytes}. That is the combined
maximum of outstanding data before the cache must be flushed. If this
is hit, all writing processes freeze. So, having the background value
high gives a greater chance of hitting this early.

The default values are 10% and 20% (ratio). I've made the 20% ratio
into 10% and put 128MB for background which works quite well:
Foreground processes are blocked for shorter times (because writing
128MB can be a few seconds or less, where 1.6GB can be minutes in a
worse case, so if overall limit is hit, I'm screwed). The overall
dirty buffer is still big enough to let the system buffer writes of
multiple processes. My system has 16GB RAM, you may want to adjust it
or try different values.

$ cat /etc/sysctl.d/98-caching.conf
vm.dirty_background_bytes = 134217728
vm.dirty_ratio = 10

Maybe point your Firefox cache to a tmpfs. If you're using tmpfs, don't
put swappiness to low, otherwise data sitting in tmpfs cannot be
swapped out and will cause filesystem caches to be discarded to early.
I'm working with a 32GB tmpfs and standard swappiness for emerge, and I
see no problems although multiple gigabytes of emerge build data may be
swapped out. Still, emerge is so much faster now. But then, my swaps
are on different disks (and I have multiple for getting some RAID-like
striping of swap space).

Also, depending on which FS you're using, trying deadline instead of
CFQ may greatly improve your desktop experience (browsers should
benefit most from this).

-- 
Regards,
Kai

Replies to list-only preferred.


Reply via email to