[ltp] Re: Re: Re: Stress testing for undervolting

Laurent Gilson linux-thinkpad@linux-thinkpad.org
Sun, 16 Jul 2006 22:00:09 +0200


Hello,

>> What i did:
>> - compress my debian with squashfs, load that image at startup into RAM,
>> switch off the HD altogether.
>
> Whoa.  I wasn't expecting that.  You know, everyone else talking about  
> their power consumption was talking about that absolute low in these  
> idle moments that are not necessarily the norm.  But if I'm reading this  
> right, you'll
> probably hitting that low on the average.

Depends on you definition of average. Like i said: i get 3 hours 45  
minutes of working with openoffice (writing texts, looking up stuff in the  
internet. Not powerpoint/slideshow-animations. And displaylight set on  
minimum). Thatīs 10.66 watt average. Playing old DOS games reduces that to  
~ 3 hours. Serious development work and iīm down to 2 hours.

If i stop everything but X and the Wlan: ~9.5-10 watt. Depends on the Wlan  
signal and traffic.

> 1) How much memory do you have?

1GB. And i really think 1.5 or 2GB would have made the job much more easy.  
Next upgrade is 2x1GB SODIMMs (any buyers for 2x 512MB sticks for R51  
around ? well tested, 100% error free ?)

> 2) How minimal of a Debian system did you squash?

X, opera, openoffice, apache, acroread, icewm, php, gimp2, perl, java  
(SDK), postgresql, scite, python, ethereal, licq, xchat, cups, ... normal  
stuff i work with ...

> Here's my current
> system's sizes as reported by `du -si -s`:

my normal /:

3.1M    bin
60M     boot  <= not available in RAM-mode
156k    dev
15M     etc
7.8G    home <= only partly available (+- 225 MB)
4.1k    initrd
499M    lib  <= only modules for 1 kernel
50k     lost+found
371M    opt  <= only vpn, java SDK and rovclock available
4.1k    proc
142M    root  <= not available in RAM-mode
3.5M    sbin
4.1k    sys
13k     tmp
4.0G    usr   <= share/doc, src and include are not available
431M    var   <= removed all the stuff from apt, apt-cache, aptdb...

The squashed files:
root@soak:/squashed-dirs# ls -lah
total 472M
drwxr-xr-x   2 root root    0 2006-07-16 15:05 .
drwxr-xr-x  20 root root    0 2006-07-16 15:05 ..
-rwx------   1 root root 1.3M 2006-07-16 15:04 bin.squashed
-rwx------   1 root root  44M 2006-07-16 15:04 lib.squashed
-rwx------   1 root root  41M 2006-07-16 15:04 opt.squashed
-rwx------   1 root root 1.5M 2006-07-16 15:04 sbin.squashed
-rwx------   1 root root 375M 2006-07-16 15:05 usr.squashed
-rwx------   1 root root  10M 2006-07-16 15:05 var.squashed

uncompressed sizes for these:
root@soak:/# du -hs bin/ lib/ opt/ sbin/ usr/ var.squashed/
3.0M    bin/
105M    lib/
94M     opt/
3.5M    sbin/
984M    usr/
110M    var.squashed/

(look at var. 10:1 compression ... squashfs 2 rocks)

> I know some of these partitions are already virtual.  I just seems
> impossible to fit a full scale system into 512MB and then still have room
> to breathe.

Fully booted the ramfs takes 713 MB. 225MB are user data (/home), 13 MB  
/etc. That leaves ~300MB RAM to work with. Not very much. But if i need  
more RAM i delete stuff in /home ... or reboot.

Look at knoppix. Itīs a 700MB iso with a shitload of programms, tools and  
... uhm ... stuff

> How did you go about selecting what to squash on your system?

Aptitude, deborphan, localpruge and minimalisitc system to start with.

> 3) SquashFS is read-only, right?

Yes. Stuff like /usr, /lib is ro in RAM mode (if something starts writing  
in /usr, /lib ... you are in trouble anyway. beside installs/updates...).  
rw-files (/etc, /home, /tmp) are stored in ramfs. /var is special:  
writeable and compressed. i use unionfs with the squashed file as first  
branch and a normal dir in the ramfs for rw-branch. It would be possible  
to make the whole thing rw with that approach. BUT since the aptdb/cache  
did not fit into the ram anyway ... maybe with 2GB RAM.

Rebulding the *.squashed-files after updates is done by a little script  
and takes about 15 min.

> So did you set up your system to have the option (say from a grub menu)  
> to boot up with a write-able Debian system?

Yes. The normal disc-based system is started w/o a initrd. If i select the  
grub-entry with my modified initrd starts into RAMmode.

At shutdown i copy back /home. If the system crashs all changes since last  
reboot are lost. A risk iīm willing to take since the whole thing only  
crashed 2 times so far. (out-of-memory because i tried to copy a 3 GB file  
into /home and a experiment with rovclock...)

> I don't know much about loading images into RAM (initrd?); the SquashFS
> HOW-TO I found didn't address this explicitly.

squashfs was not made for this. Most technices are borrowed from embedded  
systems like the nslu2 and knoppix.

btw.: knoppix works with cloop. Itīs easier to setup (since all scripts  
are already there) but also much slower (not a big difference on CD but a  
huge hit in RAM) and a bit larger (about 10%).

cu