[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving /tmp to tmpfs is fine



On Fri, 25 May 2012 15:25:58 +0300
Serge <sergemdev@gmail.com> wrote:

> 2012/5/25 Neil Williams wrote:
> 
> > You cannot expect to mix those two worlds and for things to "just
> > work".
> 
> Easy. Let's leave /tmp on a real disk and both world will "just work".

Do you not use swap?
 
> > If program A is too resource-hungry, find (or write) program B.
> 
> Or fix the program A, right? And here we go... By default the program
> Debian is too memory-hungry (with large tmpfs) or breaking apps (with
> small tmpfs). Let's fix that? ;)

Write program C which does only the bits of what program A does but
does it by using a lot less resources (generally there's no point
differentiating between machines with low RAM and low storage space).

e.g. netsurf in place of iceweasel. GPE instead of XFCE/Gnome.

Yes you lose functionality but functionality takes up resources, so
something has to give.
 
> > The default is fine and sane but no default will ever satisfy every
> > possible device. Low memory devices have many many more problems than
> > just where /tmp is mounted.
> 
> Every system becomes "Low memory" with these defaults.

Huh? Not true. The vast majority of systems have large amounts of swap,
so tmpfs never runs out until the swap space is full - it just gets
very, very much slower.

> Assuming you've
> set your tmpfs size to 20% you need 2.5GB memory just to "temporarily"
> unpack kernel sources and check for some files.

And? The machines I use to unpack and repack kernel packages handle
that quite nicely. 

> > That does NOT mean that Debian should change the default just to suit
> > low memory devices. [...] we just have to be careful what applications
> > we use.
> 
> So instead of fixing the defaults you suggest everybody to drop the
> programs they use (mc, firefox, mysql)? ;)

On machines which don't have the resources for those programs, yes.
There are alternatives out there - change to a less hungry program or
expand the hardware.

I write packages for both types of machines - I use powerful servers
with lots of RAM and lots and lots of disc space for the repetitive
tasks of creating smaller packages which can be more easily handled by
low resource devices which have no swap, less than 1Gb of SSD and
only 512Mb RAM. Then I write lots of new code on nice shiny
workstations with lots of RAM and lots of disc space and deploy
those packages on the units which gives a full user interface
environment using (currently) ~21% of the available 512MB of RAM.

rootfs    1020M  757M  264M  75% /
tmpfs       62M     0   62M   0% /lib/init/rw

No problem with tmpfs being in RAM, it's all about being rational in
the selection of packages.

That way, the units can run on minimal power for days when the original
desktop would drain the UPS in 10 minutes.

Different hardware -> different software selection.

When a package requires too many resources for a particular device, you
simply choose another package, write another package or expand the
hardware. As the proverb goes, you can't fit a gallon into a pint pot.

http://www.emdebian.org/

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

Attachment: pgpCz8hD3ESlX.pgp
Description: PGP signature


Reply to: