Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Howto optimize Flash in Firefox

  1. #1
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    871
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Talking Howto optimize Flash in Firefox

    Hi,
    this is a renewed guide for optimize flash on firefox browser based on my old guide plus new hints.

    This guide is intended for poor old 32bit pc (like mine) with Lucid, Firefox 3.6.6 and Flash 10.1.x. Of course, anyone can give a try.

    I do not guarantee that these instructions works for you. On my box these settings improve the performances pretty much.

    1) Install flash plugin
    Code:
    sudo apt-get --purge remove gnash adobe-flashplugin swfdec-mozilla && sudo apt-get install flashplugin-nonfree
    2) Optimize Firefox
    Open Firefox
    Code:
    Choose the menu Edit -> Preferences -> Advanced -> Network -> Connection -> Settings
    and choose No proxy option, then click Ok, then Close
    In the address bar type about:config and filter/change the following settings:
    Code:
    network.dns.disableIPv6 true
    network.http.max-connections 96
    network.http.max-connections-per-server 32
    network.http.max-persistent-connections-per-server 8
    network.http.pipelining true
    network.http.pipelining.ssl true
    network.http.pipelining.maxrequests 8
    network.http.proxy.pipelining true
    network.prefetch-next false
    network.dns.disableipv6 true
    browser.sessionstore.interval 240000
    mousewheel.accelleration.factor 5
    mousewheel.accelleration.start 3
    3) Install Firefox extensions
    Install Flashblock extension: https://addons.mozilla.org/en-US/firefox/addon/433
    Install LSO, this is a handy privacy FF extension for Flash: https://addons.mozilla.org/en-US/firefox/addon/6623
    Install ADBlock Plus extension: https://addons.mozilla.org/en-US/firefox/addon/1865/
    Install BetterCache extension (and leave the default values): https://addons.mozilla.org/en-US/firefox/addon/6371/
    Install Load Tabs Progressively extension: https://addons.mozilla.org/en-US/firefox/addon/91919/

    Now restart Firefox and close Firefox

    4) Disable xgl
    Code:
    mkdir ~/.config/xserver-xgl
    touch ~/.config/xserver-xgl/disable
    5) Set OverrideGPU
    Code:
    sudo mkdir /etc/adobe
    echo "OverrideGPUValidation=true" > ~/mms.cfg
    sudo mv ~/mms.cfg /etc/adobe/
    6) Disable Pango
    Edit this file:
    Code:
    gedit ~/.bashrc
    and add this line at the end of the file, save and close
    Code:
    export MOZ_DISABLE_PANGO=1
    7) Disable localhost for IPv6
    Edit the file:
    Code:
    sudo gedit /etc/hosts
    remove localhost entry in IPV6 section of /etc/hosts
    Before:
    Code:
    # The following lines are desirable for IPv6 capable hosts
    	::1     localhost ip6-localhost ip6-loopback
    After:
    Code:
    # The following lines are desirable for IPv6 capable hosts
    	::1     ip6-localhost ip6-loopback
    Be careful on this setting if you are using IPV6 (I'm not usisg it), see: https://bugs.launchpad.net/ubuntu/+s...se/+bug/301430

    8 ) Optimize FF sqlite (updated)
    Install sqlite3
    Code:
    sudo apt-get install sqlite3
    Close Firefox
    Create & edit script for cron:
    Code:
    sudo touch /etc/cron.daily/start-sqlite-ff
    sudo chmod +x /etc/cron.daily/start-sqlite-ff
    sudo gedit /etc/cron.daily/start-sqlite-ff
    Insert the following text and save:
    Code:
    #!/bin/bash
    PROC=`pgrep -n firefox`
    if [ "$PROC" != "" ]; then echo "Firefox is running"; exit 1; fi
    find $HOME/.mozilla/ \( -name "*.sqlite" \) -exec sqlite3  {} "vacuum" \;
    Run the script:
    Code:
    sudo /etc/cron.daily/start-sqlite-ff
    Done.

    9) Xorg optimization

    Edit this file (if not exist, as supposed to be, create it):
    Code:
    sudo gedit /etc/X11/xorg.conf
    Paste the following text:
    Code:
    Section "DRI"
     Mode 0666
    EndSection
    
    Section "Extensions"
     Option "Composite" "Enable"
    EndSection
    Save the file and exit. This boost a lot.
    (Thx Labello & Lovinglinux for this)

    10) Optimize RWIN settings

    Go to http://www.speedtest.net/ test your connection speed and track down the values.

    On terminal window paste this command:
    Code:
    sudo sysctl -w net.core.rmem_default=524288 net.core.rmem_max=524288 net.core.wmem_default=524288 net.core.wmem_max=524288 net.ipv4.tcp_wmem="4096 87380 524288" net.ipv4.tcp_rmem="4096 87380 524288" net.ipv4.tcp_mem="524288 524288 524288" net.ipv4.tcp_rfc1337=1 net.ipv4.ip_no_pmtu_disc=0 net.ipv4.tcp_sack=1 net.ipv4.tcp_fack=1 net.ipv4.tcp_window_scaling=1 net.ipv4.tcp_timestamps=1 net.ipv4.tcp_ecn=0 net.ipv4.route.flush=1
    Then go back on http://www.speedtest.net/ and re-test your connection; the results should be improved in evident way, if so, make the command implemented above permanent; open the file:
    Code:
    sudo gedit /etc/sysctl.conf
    And add the following at the end of the file:
    Code:
    net.core.rmem_default = 524288
    net.core.rmem_max = 524288
    net.core.wmem_default = 524288
    net.core.wmem_max = 524288
    net.ipv4.tcp_wmem = 4096 87380 524288
    net.ipv4.tcp_rmem = 4096 87380 524288
    net.ipv4.tcp_mem = 524288 524288 524288
    net.ipv4.tcp_rfc1337 = 1
    net.ipv4.ip_no_pmtu_disc = 0
    net.ipv4.tcp_sack = 1
    net.ipv4.tcp_fack = 1
    net.ipv4.tcp_window_scaling = 1
    net.ipv4.tcp_timestamps = 1
    net.ipv4.tcp_ecn = 0
    net.ipv4.route.flush = 1
    Save and close; then:
    Code:
    sudo sysctl -p
    Source: http://swik.net/Ubuntu/Only+Ubuntu/H...and+RWIN/cbnda

    11) Fix css fixed background bug

    Bug source: https://bugzilla.mozilla.org/show_bug.cgi?id=438911
    Edit this file:
    Code:
    gedit ~/.mozilla/firefox/*.default/chrome/userContent.css
    Past the following lines and save:
    Code:
    /* Smooth Scrolling: Disable Fixed Background Images */
    body {
    background-attachment: scroll !important;
    background-repeat:no-repeat;
    }
    12) Tune memory + FF cache in RAM (at least with 1GB RAM on board)

    Edit this file:
    Code:
    sudo gedit /etc/sysctl.conf
    and past the following lines at the end:
    Code:
    # Improve memory
    vm.swappiness=10
    
    # Improve file/folder browsing speed
    vm.vfs_cache_pressure=50
    
    # Set maximum amount of memory allocated to shm to 256MB
    kernel.shmmax = 268435456
    Save and do the following command:
    Code:
    sudo sysctl -p
    Open Firefox and type in the address bar about:config; then with right click on window choose New -> String and insert browser.cache.disk.parent_directory and as a value /dev/shm
    Close Firefox

    Now reboot your pc and enjoy!

    -------------------------------------------------------------------------
    *11/14/2010 Updated extensions
    *10/23/2010 Tune memory
    *10/18/2010 Updated RWIN optimization
    *10/17/2010 Added userContent.css workaround
    *10/16/2010 Remove Ondemand tweak and added Xorg optimization
    *10/16/2010 Added RWIN optimization
    Last edited by dentaku65; November 14th, 2010 at 03:45 AM.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  2. #2
    Join Date
    Aug 2008
    Location
    Brazil
    Beans
    12,497
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Howto optimize Flash in Firefox

    Thanks for sharing.

    For item 8 I would recommend SQLite Optimizer or using the command below:

    Code:
    find $HOME/.mozilla/ \( -name "*.sqlite" \) -exec sqlite3  {} "vacuum" \;
    They both will guarantee all sqlite databases are optimized and not only the default ones, after all several extensions create databases of their own.

    Also check my Firefox and Flash optimization tutorials at http://firefox-tutorials.blogspot.com

  3. #3
    Join Date
    Sep 2007
    Location
    sweden
    Beans
    20

    Re: Howto optimize Flash in Firefox

    Just wanted to give a big thanks for this. I can now see flash in fullscreen on my celeron/x1300 laptop! (running crunchbang however but still)!

    http://ubuntuforums.org/images/smilies/guitar.gif

    Dentaku65 / Lovinglinux! You rule!

  4. #4
    Join Date
    Oct 2010
    Location
    London, UK
    Beans
    12
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto optimize Flash in Firefox

    Hi,

    thanks a lot for your help, now flash videos are much better than before. Still I can't run smoothly 720p video but at least it's usable.

    Just one thing: flash videos are not played automatically when you open a web page with some of them. How can I change this setting?

    Thanks

  5. #5
    Join Date
    Jun 2010
    Location
    In A Big Pepsi Bottle
    Beans
    211
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Howto optimize Flash in Firefox

    what is xgl? also is there any side effects from disabling it?also what is pango and why should you disable it?

  6. #6
    Join Date
    Apr 2007
    Location
    West Sussex U.K.
    Beans
    227
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Howto optimize Flash in Firefox

    Great Howto, only problem I had was with the Xorg section, giving me a parsing error, should have looked at which line it was, but I've just assumed its from here, so commented out for now. Will play around with it soon, just not yet, just spent most of the weekend getting my xorg right!

    Otherwise great Howto, Thanks

  7. #7
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    871
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Howto optimize Flash in Firefox

    Quote Originally Posted by alswar View Post
    Hi,

    thanks a lot for your help, now flash videos are much better than before. Still I can't run smoothly 720p video but at least it's usable.

    Just one thing: flash videos are not played automatically when you open a web page with some of them. How can I change this setting?

    Thanks
    This is the Flashblock extension: https://addons.mozilla.org/en-US/firefox/addon/433
    If you remove it you'll get flash video play automatically or you can keep it and choose (white list) in which site to disable this extension.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  8. #8
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    871
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Howto optimize Flash in Firefox

    Quote Originally Posted by rolnics View Post
    Great Howto, only problem I had was with the Xorg section, giving me a parsing error, should have looked at which line it was, but I've just assumed its from here, so commented out for now. Will play around with it soon, just not yet, just spent most of the weekend getting my xorg right!

    Otherwise great Howto, Thanks
    Can you post your xorg.conf?
    As far I can tell the conf posted on #1 it is workig well on my old Intel card.
    Are you not running compiz?
    Last edited by dentaku65; November 15th, 2010 at 06:28 PM.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  9. #9
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    871
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Howto optimize Flash in Firefox

    Quote Originally Posted by soldier1st View Post
    what is xgl? also is there any side effects from disabling it?also what is pango and why should you disable it?
    Xgl it is an old architecture of X server http://en.wikipedia.org/wiki/Xgl replaced by AIGLX

    Disable Pango it is useful only if you have a Firefox version compiled with --enable-pango; the Pango option will slow down scrolling and rendering fonts on FF
    Last edited by dentaku65; November 15th, 2010 at 06:26 PM.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  10. #10
    Join Date
    Jun 2010
    Location
    In A Big Pepsi Bottle
    Beans
    211
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Howto optimize Flash in Firefox

    Quote Originally Posted by dentaku65 View Post
    Xgl it is an old architecture of X server http://en.wikipedia.org/wiki/Xgl replaced by AIGLX

    Disable Pango it is useful only if you have a Firefox version compiled with --enable-pango; the Pango option will slow down scrolling and rendering fonts on FF
    i use the default firefox app that comes with ubuntu. also does ubuntu use aiglx and xgl was just left in for compatability reasons?i'm asking these questions as i don't want to fubar my install.
    Last edited by soldier1st; November 16th, 2010 at 07:16 AM.

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •