Gallery Web app so that it'll run comfortably within 256MB-ish, down from 1GB minimum, ie less than half of the physical memory. Mainly took all night thinking (and working on another aspect) and then about 10 lines of code... Now if only all applications could halve their resource requirements that easily. Actually I'd like something with a little bit of direct digital discrete I/O so I don't need to use my K8055 board, and either support for more SDHC or direct drive for an external low-power HDD or SSD for my ~160GB of bulk data, or another USB so I could plug both those peripherals in without a USB hub. I think that in principle I could bring one of those (SATA for example) out from the plug, and I don't think the Open RD client gives enough more to be worth the extra space and cost (and probably consumption). I'm hoping that Zero/Shark will give me decent Java performance on the ARM. I've verified which Linux build is most power-efficient due to being 'tickless'.
See more of the SheevaPlug setup.
The laptop used is a Lambda 320N sourced from XePhi (since defunct). It has a small screen, 1.73GHz Intel Dual Core CPU, 2GB RAM, 120GB hard drive, DVD-RW and WiFi. It is fitted out with a 4G SD memory card in the SD port, from which the machine can boot and run without waking the hard disc often. The aim is to minimise hard disc traffic and keep it spun down to save power.
Adam of XePhi loaded Ubuntu (7.04: "Feisty Fawn") and configured it to boot from the 4GB SD card, and with the SD partitions shadowed on the hard disc. If the SD card 'wears out' I will be able to easily bring up the system and construct a new bootable SD card with dd one command. (Plus a fixup for the SD card filesystem UUIDs and boot order in /etc/fstab and /boot/grub/menu.list...) Adam also set up the machine as for a typical secure 'server' with most services shut down and most ports firewalled off. This is the state that I have any new dedicated Linux Web host handed over to me too. Adam gave me superb support by email long after delivery to get things working 'just right' with a new kernel and the power-saving stuff, etc, etc!
(Note that "Feisty Fawn" does not support all the latest power-reduction tweaks, such as tickless kernel, and full cpu frequency management. The next release ("Gutsy Gibbon") contains more and so an upgrade should help reduce consumption. In particular the new 'tickless idle' feature to allow the CPU to sleep longer. I have installed and I am running the newer (Gutsy) kernel.)
A very useful tool is PowerTop from Intel, which helps spot which applications may be wasting CPU cycles and thus power.
A Linux package called laptop-mode can tweak a number of aspects of a machine to reduce its power consumption, the main feature being its ability to spin-down and shut-down hard discs/drives that are idle, and tweaking various parts of Linux to make that happen much more often than it otherwise could.
To install the laptop-mode stuff I will need to do:
apt-get install laptop-mode-tools apt-get install laptop-mode
I edit /etc/laptop-mode/laptop-mode.conf to ensure that:
Adding a line:
/usr/sbin/laptop-mode start
to /etc/rc.local to ensure that laptop-mode gets enabled automatically at boot.
Note that since the cpufreq kernel module(s) do not seem to load automatically, I may precede the laptop-mode start with a suitable modprobe or three, such as:
/sbin/modprobe acpi_cpufreq
We can check if laptop-mode is active with:
These last two will only work where CPU clock-speed adjustment is available.
(I tried to use cpufreqd for a while, but it jammed and got 'stuck' needing a manual restart. So I crafted a simple Java-based 'JCPUFreqD' that does what I need, available as a BZIP2ed GNU-tar image.)
Essentially the rules of CPU power management to bear in mind are:
Here were some steps that I took to minimise CPU/system power, but keep performance good when power is available:
for f in /sys/bus/usb/devices/*/power/autosuspend; do if [ -f "$f" ]; then echo 1 > $f; fi; done
When I go into my 'less conserving' mode I let all CPUs range over all available speeds and push the up_threshold down to ~75% to be more eager to spring in to action. I also set CPU-usage sampling to be as fast as possible ('sampling_rate_min') to be as eager as possible again to ramp up performance when needed.
When the battery voltage is reasonably high the laptop is taken off-grid: ~20W.
When the battery voltage gets even higher, the laptop does all sorts of extra optional work (such as computations for my AI project): another ~30W.
This means that the system can absorb up to ~50W of excess available power with useful computational work. Such as the entire output of an 8-turbine MotorWind...
For stability I have discovered that it is wise to slowly ramp up consumption. Start by raising maximum CPU clock, then slowly add more load to the CPUs, etc, etc, over a matter of several minutes. Then back off very quickly to a minimal draw (a la TCP slow-start) if any of the sensors suggest that battery voltage is dropping.
If it ever looks like that will not be enough then we can tune the software workload to use 100% CPU since the laptop maximum consumption is ~60W. Note that I can probably also power my new ZyXEL ADSL modem (as of 2008-06) directly from 12V DC if required.
Thus I'm using the Net as a software dump load for my RE system!
Some random notes for the moment until they get better organised...