Re: Reduce the server load by asking firefox to not cache on disk

2013-05-22 Thread Andreas B. Mundt
Hi all,

I just accidentally came along a package which seems to be interesting
in the current context:

   http://packages.debian.org/wheezy/unburden-home-dir

Best regards,

 Andi


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130522102408.GA4886@fuzi



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-17 Thread Wolfgang Schweer
On Fri, May 17, 2013 at 08:18:34AM +0200, Petter Reinholdtsen wrote:
> [Nigel Barker]
> > I agree. I have been using the following on plain debian
> > workstations integrated into the SL network.
> > 
> > http://bootpolish.net/home_ltsp_ltspiceweaselhacks
> 
> Thanks.  These seem to be the relevant ones we should consider using
> in Debian Edu:
> 
>   lockPref("extensions.update.enabled", true);
>   // Use LANG environment variable to choose locale
>   lockPref("intl.locale.matchOS", true);
>   // Disable default browser checking.
>   lockPref("browser.shell.checkDefaultBrowser", false);
>   // = LTSP SPECIFIC HACKS 
>   // Disable annoying location-bar suggestion "feature" that is sludgy
>   // with thin-clients
>   lockPref("browser.urlbar.maxRichResults", 0);
>   // = MISC HACKS ==
>   lockPref("app.update.enabled", false);
> 
> There is no explanation for extensions.update.enabled and
> app.update.enabled.  Can you provide more background info?
 
IIRC, app.update.enabled allows iceweasel to check for a new version. 
This option should be set to 'false'.

extensions.update.enabled allows Iceweasel to check if updates of addons 
and extensions are available. As users might have addons installed on 
their own, this should be set to 'true'.

Wolfgang



signature.asc
Description: Digital signature


Re: Reduce the server load by asking firefox to not cache on disk

2013-05-17 Thread nigel barker
On 17 May 2013 15:18, Petter Reinholdtsen  wrote:
>>
>> http://bootpolish.net/home_ltsp_ltspiceweaselhacks
>
> Thanks.  These seem to be the relevant ones we should consider using
> in Debian Edu:
>
>   lockPref("extensions.update.enabled", true);
>   // Use LANG environment variable to choose locale
>   lockPref("intl.locale.matchOS", true);
>   // Disable default browser checking.
>   lockPref("browser.shell.checkDefaultBrowser", false);
>   // = LTSP SPECIFIC HACKS 
>   // Disable annoying location-bar suggestion "feature" that is sludgy
>   // with thin-clients
>   lockPref("browser.urlbar.maxRichResults", 0);
>   // = MISC HACKS ==
>   lockPref("app.update.enabled", false);
>
> There is no explanation for extensions.update.enabled and
> app.update.enabled.  Can you provide more background info?
>

Sorry, just a blog I discovered while trying to reduce iceweasel disc
writes. He seems to have experience with ltsp on debian in schools in
the UK.

>
> Is there no way to enable the MOZ_DISABLE_IMAGE_OPTIMIZE=1 setting
> using preferences?

I just go with this guy's settings because he seems to know what he is
doing and I don't.
Sorry to be no help.
nigel


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CADLSRd51o4yt+wRjnjq5tkbqO3xzZOErwXfzNvrjjcZ=45d...@mail.gmail.com



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-16 Thread Petter Reinholdtsen
[Klaus Knopper]
> Because, before the package can possibly install is own version of
> /usr/lib/iceweasel/iceweasel, it has to move away the original file
> with the same name. Apparently, preinst is correct for this, because
> postinst would be too late.

Right.  One problem with this approach is that APT can not ensure the
correct installation ordering if installing both iceweasel and
firefox-tuning using the same apt-get run.  In other words, this work:

  apt-get install iceweasel
  apt-get install firefox-tuning

while this will not always work:

  apt-get install iceweasel firefox-tuning

That should be solved, to ensure predictable behaviour.  One way would
be to install the script as
/usr/lib/iceweasel/iceweasel-firefox-tuning, do the diverting in the
postinst and add a dependency from firefox-tuning to iceweasel.
Anyone got a better idea?

> Maybe
> ICETMP="${TMPDIR:-/tmp}"
> to be on the safe side in case $TMPDIR is not set for some reason.

Done.

I've fixed several issues discovered by lintian and myself in the
package and commited fixes to svn.  Please have a look, and consider
uploading the fixed package to your repository.




-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130517063222.gh5...@ulrik.uio.no



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-16 Thread Petter Reinholdtsen
[Nigel Barker]
> I agree. I have been using the following on plain debian
> workstations integrated into the SL network.
> 
> http://bootpolish.net/home_ltsp_ltspiceweaselhacks

Thanks.  These seem to be the relevant ones we should consider using
in Debian Edu:

  lockPref("extensions.update.enabled", true);
  // Use LANG environment variable to choose locale
  lockPref("intl.locale.matchOS", true);
  // Disable default browser checking.
  lockPref("browser.shell.checkDefaultBrowser", false);
  // = LTSP SPECIFIC HACKS 
  // Disable annoying location-bar suggestion "feature" that is sludgy
  // with thin-clients
  lockPref("browser.urlbar.maxRichResults", 0);
  // = MISC HACKS ==
  lockPref("app.update.enabled", false);

There is no explanation for extensions.update.enabled and
app.update.enabled.  Can you provide more background info?

> However, I thought they were already implemented on real skolelinux
> installs. At least they were on Lenny, I think..

I checked, and the browser.cache.disk.enable value was already set to
false, disabling the disk cache.  I added the ones to enable the
memory cache and disable the offline cache.

Is there no way to enable the MOZ_DISABLE_IMAGE_OPTIMIZE=1 setting
using preferences?

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130517061834.gg5...@ulrik.uio.no



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-16 Thread Klaus Knopper
On Thu, May 16, 2013 at 09:32:15AM +0200, Petter Reinholdtsen wrote:
> [Klaus Knopper]
> > Now that you mention it... The package contains a single shell
> > script, "source included", however, in case you really want to
> > rebuild the .deb, I uploaded the source to the same directory.
> 
> Great.  I imported it into our svn to make it easier to continue
> development.  Available as
> .
> Why did you use a preinst instead of a postinst?  Adding the divert
> before the package is configured seem wrong to me.

Because, before the package can possibly install is own version of
/usr/lib/iceweasel/iceweasel, it has to move away the original file with
the same name. Apparently, preinst is correct for this, because postinst
would be too late.

> > Our package moves /usr/lib/iceweasel/iceweasel to
> > /usr/bin/iceweasel/iceweasel.real and replaces the original script
> > by an additional wrapper script. Which is "not the right way", as
> > one Debian maintainer noted, but it happened to make things a lot
> > easier for support in our project.
> 
> Well, it do not seem to wrong either. :)

Ask Jonas. ;-)

> But it need some adjustment to work properly with Debian Edu.  For
> example we use libpam-tmpdir, so it need to use $TMPDIR instead of
> hardcoding /tmp/.

Maybe
ICETMP="${TMPDIR:-/tmp}"
to be on the safe side in case $TMPDIR is not set for some reason.

Regards
-Klaus


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130516164451.ga5...@knopper.net



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-16 Thread Petter Reinholdtsen
[Klaus Knopper]
> Now that you mention it... The package contains a single shell
> script, "source included", however, in case you really want to
> rebuild the .deb, I uploaded the source to the same directory.

Great.  I imported it into our svn to make it easier to continue
development.  Available as
.
Why did you use a preinst instead of a postinst?  Adding the divert
before the package is configured seem wrong to me.

> Our package moves /usr/lib/iceweasel/iceweasel to
> /usr/bin/iceweasel/iceweasel.real and replaces the original script
> by an additional wrapper script. Which is "not the right way", as
> one Debian maintainer noted, but it happened to make things a lot
> easier for support in our project.

Well, it do not seem to wrong either. :)

But it need some adjustment to work properly with Debian Edu.  For
example we use libpam-tmpdir, so it need to use $TMPDIR instead of
hardcoding /tmp/.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130516073215.gp13...@ulrik.uio.no



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-16 Thread Petter Reinholdtsen
[Petter Reinholdtsen]
> Why did you use a preinst instead of a postinst?  Adding the divert
> before the package is configured seem wrong to me.

Still wonder about this one.

I suspect it would be better to provide a
/usr/lib/iceweasel/iceweasel-edu-wrapper script in the package, and do
the diverting in the postinst instead of the preinst.

> But it need some adjustment to work properly with Debian Edu.  For
> example we use libpam-tmpdir, so it need to use $TMPDIR instead of
> hardcoding /tmp/.

I've adjusted the package in svn, to a point where I believe it could
go into Debian and Debian Edu.  But the name firefox-tuning is a bit
misleading.  It is tuning iceweasel, not firefox, and tuning is a but
generic.  What about debian-edu-iceweasel-local-io or something like
that instad?

I guess we could move the rest of the iceweasel tuning into the
package, and make debian-edu-iceweasel-tuning a more fitting name. :)

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130516110619.gt13...@ulrik.uio.no



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Klaus Knopper
On Wed, May 15, 2013 at 06:25:03PM +0200, Klaus Knopper wrote:
> There are two disadvantages, though:
> 
> 1. In case the user configures a HUGE disk cache, lots of data are
> copied forward and back, so a problem may occur when many users quit
> their firefox at once (i.e. at the end of the lesson). Solution: Combine
> with the "small/no disk cache" approach.

Small correction: Actually, the regular firefox disk cache is excluded
by rsync, but for huge bookmark lists, filters or keyrings, we could
expect some network traffic.

> 2. In case the user logs out or kills his/her session without quitting
> firefox, changes to bookmarks from this session are lost. Well... This
> may happen without the script, too (kill -9).
> 
> The script should detect stale symlinks, and remove them automatically
> in case there is a leftover $HOME/.mozilla from the previous session.

Regards
-Klaus


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515163116.gc3...@knopper.net



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Klaus Knopper
On Wed, May 15, 2013 at 06:05:52PM +0200, Alf Tonny Bätz wrote:
>i have taken a look on that packages, its copy real iceweasel til
>iceweasel_real so when user click iceweasel the script copy the .mozilla
>folder to tmp, and call icewasel_real after its done. And when user exit
>iceweasel the script copy the .mozilla from tmp back to users home
>folder..
> 
>I like this approach

Our teachers and Skolelinux support teams liked it, too, since it is
non-intrusive to iceweasels normal way of operation, iceweasel just uses
a different directory (which is on the ramdisk in our scenario) for
frequent writes.

There are two disadvantages, though:

1. In case the user configures a HUGE disk cache, lots of data are
copied forward and back, so a problem may occur when many users quit
their firefox at once (i.e. at the end of the lesson). Solution: Combine
with the "small/no disk cache" approach.

2. In case the user logs out or kills his/her session without quitting
firefox, changes to bookmarks from this session are lost. Well... This
may happen without the script, too (kill -9).

The script should detect stale symlinks, and remove them automatically
in case there is a leftover $HOME/.mozilla from the previous session.

Regards
-Klaus


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515162503.gb3...@knopper.net



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Klaus Knopper
Hello Petter,

On Wed, May 15, 2013 at 05:59:12PM +0200, Petter Reinholdtsen wrote:
> [Nigel Barker]
> > However, I thought they were already implemented on real skolelinux
> > installs. At least they were on Lenny, I think..
> 
> Some of it is already in Skolelinux, but not the cache tuning.
> 
> [Klaus Knopper]
> > We used a different approach in Skolelinux-RLP: On start of
> > firefox/iceweasel, we copy the local .mozilla directory containing
> > personal bookmarks, a (small) cache and other db/sqlite files to the
> > /tmp-ramdisk in a per-user/per-process directory, and on quitting
> > firefox, we copy them back to the users NFS home directory.
> > 
> > Firefox tends to exessively write on several files, not only cache
> > data, and in case NFS does not catch up in time, you get a
> > "bufferbloat" self-denial-of-service. From our tests, only exluding
> > these files from NFS writes was able to fix a "completely stalled" >
> > 20 users NFS setup, where pupils were not able to login anymore when
> > more than ten users were running firefox. "Outsourcing" the .mozilla
> > directory helped.
> > 
> > For the firefox starter script, we made a package, it's still
> > available at http://rp.skolelinux.de/packages/firefox-tuning/
> 
> Interesting approach.  Perhaps something we should replicate for Jessie?
> 
> Where is the source package for the firefox-tuning package?  The
> directory only contain the .deb.

Now that you mention it... The package contains a single shell script,
"source included", however, in case you really want to rebuild the .deb,
I uploaded the source to the same directory.

Our package moves /usr/lib/iceweasel/iceweasel to
/usr/bin/iceweasel/iceweasel.real and replaces the original script by an
additional wrapper script. Which is "not the right way", as one Debian
maintainer noted, but it happened to make things a lot easier for
support in our project.

Regards
-Klaus


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515161419.ga3...@knopper.net



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Alf Tonny Bätz
i have taken a look on that packages, its copy real iceweasel til
iceweasel_real so when user click iceweasel the script copy the .mozilla
folder to tmp, and call icewasel_real after its done. And when user exit
iceweasel the script copy the .mozilla from tmp back to users home folder..

I like this approach

Best Regards Alf Tonny Bätz


2013/5/15 Petter Reinholdtsen 

> [Nigel Barker]
> > However, I thought they were already implemented on real skolelinux
> > installs. At least they were on Lenny, I think..
>
> Some of it is already in Skolelinux, but not the cache tuning.
>
> [Klaus Knopper]
> > We used a different approach in Skolelinux-RLP: On start of
> > firefox/iceweasel, we copy the local .mozilla directory containing
> > personal bookmarks, a (small) cache and other db/sqlite files to the
> > /tmp-ramdisk in a per-user/per-process directory, and on quitting
> > firefox, we copy them back to the users NFS home directory.
> >
> > Firefox tends to exessively write on several files, not only cache
> > data, and in case NFS does not catch up in time, you get a
> > "bufferbloat" self-denial-of-service. From our tests, only exluding
> > these files from NFS writes was able to fix a "completely stalled" >
> > 20 users NFS setup, where pupils were not able to login anymore when
> > more than ten users were running firefox. "Outsourcing" the .mozilla
> > directory helped.
> >
> > For the firefox starter script, we made a package, it's still
> > available at http://rp.skolelinux.de/packages/firefox-tuning/
>
> Interesting approach.  Perhaps something we should replicate for Jessie?
>
> Where is the source package for the firefox-tuning package?  The
> directory only contain the .deb.
>
> --
> Happy hacking
> Petter Reinholdtsen
>
>
> --
> To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmas...@lists.debian.org
> Archive: http://lists.debian.org/20130515155912.gl13...@ulrik.uio.no
>
>


Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Petter Reinholdtsen
[Nigel Barker]
> However, I thought they were already implemented on real skolelinux
> installs. At least they were on Lenny, I think..

Some of it is already in Skolelinux, but not the cache tuning.

[Klaus Knopper]
> We used a different approach in Skolelinux-RLP: On start of
> firefox/iceweasel, we copy the local .mozilla directory containing
> personal bookmarks, a (small) cache and other db/sqlite files to the
> /tmp-ramdisk in a per-user/per-process directory, and on quitting
> firefox, we copy them back to the users NFS home directory.
> 
> Firefox tends to exessively write on several files, not only cache
> data, and in case NFS does not catch up in time, you get a
> "bufferbloat" self-denial-of-service. From our tests, only exluding
> these files from NFS writes was able to fix a "completely stalled" >
> 20 users NFS setup, where pupils were not able to login anymore when
> more than ten users were running firefox. "Outsourcing" the .mozilla
> directory helped.
> 
> For the firefox starter script, we made a package, it's still
> available at http://rp.skolelinux.de/packages/firefox-tuning/

Interesting approach.  Perhaps something we should replicate for Jessie?

Where is the source package for the firefox-tuning package?  The
directory only contain the .deb.

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515155912.gl13...@ulrik.uio.no



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Klaus Knopper
Hello

On Wed, May 15, 2013 at 10:50:13PM +0900, nigel barker wrote:
> On 15 May 2013 21:55, Petter Reinholdtsen  wrote:
> > My friend Alf Tonny Bätz in Narvik told me that he changed the Firefox
> > setup to disable disk caching, to reduce the network traffic on the
> > diskless workstations and reduce the load on the server.
> >
> > This is the change he did in
> > /usr/lib/firefox/default/preferences/firefox.js:
> >
> > // Prevent disk loading, cace to mem
> > pref("browser.cache.disk.enable", false);
> > pref("browser.cache.offline.enable", false);
> > pref("browser.cache.memory.enable", true);
> > pref("browser.cache.memory.max_entry_size", -1);
> >
> 
> I agree. I have been using the following on plain debian workstations
> integrated into the SL network.
> 
> However, I thought they were already implemented on real skolelinux
> installs. At least they were on Lenny, I think..

We used a different approach in Skolelinux-RLP: On start of
firefox/iceweasel, we copy the local .mozilla directory containing
personal bookmarks, a (small) cache and other db/sqlite files to the
/tmp-ramdisk in a per-user/per-process directory, and on quitting
firefox, we copy them back to the users NFS home directory.

Firefox tends to exessively write on several files, not only cache data,
and in case NFS does not catch up in time, you get a "bufferbloat"
self-denial-of-service. From our tests, only exluding these files from
NFS writes was able to fix a "completely stalled" > 20 users NFS setup,
where pupils were not able to login anymore when more than ten users
were running firefox. "Outsourcing" the .mozilla directory helped.

For the firefox starter script, we made a package, it's still available
at http://rp.skolelinux.de/packages/firefox-tuning/

Regards
-Klaus


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515144803.gc4...@knopper.net



Re: Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread nigel barker
On 15 May 2013 21:55, Petter Reinholdtsen  wrote:
> My friend Alf Tonny Bätz in Narvik told me that he changed the Firefox
> setup to disable disk caching, to reduce the network traffic on the
> diskless workstations and reduce the load on the server.
>
> This is the change he did in
> /usr/lib/firefox/default/preferences/firefox.js:
>
> // Prevent disk loading, cace to mem
> pref("browser.cache.disk.enable", false);
> pref("browser.cache.offline.enable", false);
> pref("browser.cache.memory.enable", true);
> pref("browser.cache.memory.max_entry_size", -1);
>

I agree. I have been using the following on plain debian workstations
integrated into the SL network.

However, I thought they were already implemented on real skolelinux
installs. At least they were on Lenny, I think..

http://bootpolish.net/home_ltsp_ltspiceweaselhacks

nigel


--
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/cadlsrd5+b6ycvat5gczccfnb-hqu2axys0nerntrjqtzcos...@mail.gmail.com



Reduce the server load by asking firefox to not cache on disk

2013-05-15 Thread Petter Reinholdtsen
My friend Alf Tonny Bätz in Narvik told me that he changed the Firefox
setup to disable disk caching, to reduce the network traffic on the
diskless workstations and reduce the load on the server.

This is the change he did in
/usr/lib/firefox/default/preferences/firefox.js:

// Prevent disk loading, cace to mem
pref("browser.cache.disk.enable", false);
pref("browser.cache.offline.enable", false);
pref("browser.cache.memory.enable", true);
pref("browser.cache.memory.max_entry_size", -1);

He report that the result was that the load average went down 3 when
60 pupils logged in and started firefox at the same time.  The load
used to be around 5 for quite a while during login, and now it is
around 2, and it is quickly falling even lower.

This seem like something we should put in our
debian-edu-config/share/iceweasel/defaults/preferences/debian-edu.js
to enable by default.  Any objections?

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-edu-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130515125544.gh13...@ulrik.uio.no