Next Previous Contents

19. Appendix B - Dealing with Limited Resources or Tuning the System

19.1 Related HOWTOs

  1. LBX-HOWTO
  2. Small-Memory-HOWTO

19.2 Introduction

As mentioned in the introduction laptops sometimes have less resources if you compare them to desktops. To deal with limited space, memory, CPU speed and battery power, I have written this chapter.

19.3 Small Space

Introduction

There are different types of techniques to gain more disk space, such as sharing of space, freeing unused or redundant space, filesystem tuning and compression. Note: some of these techniques use memory instead of space. As you will see, there are many small steps necessary to free some space.

Techniques

  1. Stripping: Though many distributions come with stripped binaries today it is useful to check this. For details see man strip. To find every unstripped file you can use the file command or more convenient the tool findstrip. Attention: don't strip libraries, sometimes the wrong symbols are removed due to a bad programming technique. Or use the --strip-unneeded option.
  2. Perforation: zum(1)reads a file list on stdin and attempts to perforate these files. Perforation means, that series of null bytes are replaced by lseek, thus giving the file system a chance of not allocating real disk space for those bytes. Example: find . -type f | xargs zum
  3. Remove Odd Files and Duplicates: Check your system for core files, emacs recovery files <#FILE#> vi recovery files <FILE>.swp, RPM recovery files <FILE>.rpmorig and patch recovery files. Find duplicates, you may try finddup. Choose a system to name your backup, temporary and test files, e.g. with a signature at the end.
  4. Clean Temporary Files: , e.g. /tmp, there is even a tool tmpwatch.
  5. Shorten the Log Files: usually the files in /var/log.
  6. Remove Files: Remove files which are not "necessary" under all circumstances such as man pages, documentation /usr/doc and sources e.g. /usr/src .
  7. Unnecessary Libraries: You may use the binstats package to find unused libraries (Thanks to Tom Ed White).
  8. Filesystem: Choose a filesystem which treats disk space economically e.g. rsfs. Tune your filesystem e.g. tune2fs. Choose an appropriate partition and block size.
  9. Reduce Kernel Size: Either by using only the necessary kernel features and/or making a compressed kernel image bzImage.
  10. Compression: I didn't check this but AFAIK you may compress your filesystem with gzip and decompress it on the fly. Alternatively you may choose to compress only certain files. You can even execute compressed files with zexec
  11. Compressed Filesystems:

    - For e2fs filesystems there is a compression version available e2compr , see http://debs.fuller.edu/e2compr/ .

    - DMSDOS which enables your machine to access Windows95 compressed drives (drivespace, doublestacker). If you don't need DOS/Windows95 compatibility, i.e. if you want to compress Linux-only data, this is really discouraged by the author of the program. See http://fb9nt-ln.uni-duisburg.de/mitarbeiter/gockel/software/dmsdos/ .

  12. Partition Sharing: You may share swap-space (see Swap-Space-HOWTO) or data partitions between different OS (see mount). For mounting MS-DOS Windows95 compressed drives (doublespace, drivespace) you may use dmsdos http://metalab.unc.edu/pub/Linux/system/filesystems/dosfs/.
  13. Libraries: Take another (older) library, for instance libc5 , this library seems to be smaller than libc6 aka glibc2 .
  14. Kernel: If your needs are fitted with an older kernel version, you can save some space.
  15. GUI: Avoid as much Graphical User Interface (GUI) as possible.
  16. Tiny Distributions: There are some distributions available which fit from one 3.5" floppy to 10MB disk space and fit for small memories, too. See appendix A and below.
  17. External Storage Devices (Hard Disks, ZIP Drives, NFS, SAMBA): Since many notebooks may be limited in their expandability, using the parallel port is an attractive option. There are external harddisks and ZIP Drives available. Usually they are also connectable via PCMCIA. Another way is using the resources of another machine through NFS or SAMBA etc.

19.4 Harddisk Speed

Use the tool hdparm to set up better harddisk performance. Though I have seen laptop disk enabled with striping, I can't see a reason to do so, because IMHO aka RAID0 striping needs at least two different disks to increase performance.

See UNIX and LINUX Computing Journal: Tunable Filesystem Parameters in /proc How to increase, decrease and reconfigure filsystem behavior from within /proc.

19.5 Small Memory

Related HOWTOs

  1. Small-Memory-mini-HOWTO by Todd Burgess <tburgess@uoguelph.ca > http://eddie.cis.uoguelph.ca/~tburgess
  2. Modules-mini-HOWTO
  3. Kerneld-mini-HOWTO

Techniques

Check the memory usage with free and top.

Mergemem Project . Many programs contain memory areas of the same content that remain undetected by the operating system. Typically, these areas contain data that have been generated on startup and remain unchanged for longer periods. With mergemem such areas are detected and shared. The sharing is performed on the operating system level and is invisible to the user level programs. mergemem is particularily useful if you run many instances of interpreters and emulators (like Java or Prolog) that keep their code in private data areas. But also other programs can take advantage albeit to a lesser degree.

You may also reduce the kernel size as much as possible by removing any feature which is not necessary for your needs and by modularizing the kernel as much as possible.

Also you may shutdown every service or daemon which is not needed, e.g. lpd, mountd, nfsd and close some virtual consoles. Please see Small-Memory-mini-HOWTO for details.

And of coarse use swap space, when possible.

If possible you use the resources of another machine, for instance with X, VNC or even telnet. For more information on Virtual Network Computing (VNC), see http://http://www.uk.research.att.com/vnc/ .

19.6 Low CPU Speed

You may want to overdrive the CPU speed but this can damage your hardware and I don't have experience with it. For some examples look at Adorable Toshiba Libretto - Overclocking http://www.cerfnet.com/~adorable/libretto.html.

19.7 Power Saving Techniques

  1. If you don't need infrared support, disable it in the BIOS or shutdown the IrDA device driver. There are also some IrDA features of the kernel which are useful for saving power.
  2. PCMCIA services consume much power, so shut them down if you don't need them.
  3. I'm not sure to which extend the backlight consumes power. WARNING: AFAIK this device can only bear a limited number of uptime circles. So avoid using screensavers.
  4. For some examples to build batteries with increased uptime up to 8 hours look at Adorable Toshiba Libretto http://www.cerfnet.com/~adorable/libretto.html.
  5. For information about APM look at the APM chapter above.
  6. A hacked rclock . Booker C. Bense has hacked the rclock program to include a simple battery power meter on the clock face.
  7. xbatstat. A battery level status checker for Linux and X.
  8. The "noatime" option when mouting filesystems tells the kernel to not update the access time information of the file. This information, although sometimes useful, is not used by most people (do you know that ls -lu gives you the access time?). Therefore, you can safely disable it, then preventing disk access each time you cat a file. Here is an example of a /etc/fstab with this power-saving option:
    /dev/hda7 /var ext2 defaults,noatime 0 2
    
  9. hdparm hdparm is a Linux IDE disk utility that lets you set spin-down timeouts and other disk parameters. It works also for some SCSI features.
  10. Mobile Update Daemon This is a drop-in replacement for the standard update daemon, mobile-update minimizes disk spin ups and reduces disk uptime. It flushes buffers only when other disk activity is present. To ensure a consistent file system call sync manually. Otherwise files may be lost on power failure. mobile-update does not use APM. So it works also on older systems.
  11. noflushd: noflushd monitors disk activity and spins down disks that have been idle for more than <timeout> seconds. It requires a kernel >=2.2.11 . Useful in combination with hdparm and mount with noatime option to bring down disk activity.
  12. Toshiba Linux Utilities This is a set of Linux utilities for controlling the fan, supervisor passwords, and hot key functions of Toshiba Pentium notebooks. There is a KDE package Klibreta, too.
  13. At Kenneth E. Harker's page there is a recommendation for LCDproc LCDProc . "LCDproc is a small piece of software that will enable your Linux box to display live system information on a 20x4 line backlit LCD display. This program shows, among other things, battery status on notebooks." I tried this package and found that it connects only to the external Matrix-Orbital 20x4 LCD display http://www.matrix-orbital.com/, which is a LCD display connected to a serial port. I can't see any use for a laptop yet.
  14. Diald: Dial Daemon . The Diald daemon provides on demand Internet connectivity using the SLIP or PPP protocols. Diald can automatically dial in to a remote host when needed or bring down dial-up connections that are inactive.
  15. KDE http://www.kde.org provides KAPM, Kbatmon and Kcmlaptop. Written by Paul Campbell kcmlaptop is a set of KDE control panels that implements laptop computer support functions, it includes a dockable battery status monitor for laptops - in short a little icon in the KDE status bar that shows how much battery time you have left. It also will warn you when power is getting low and allows you to configure power saving options. Similar packages you may find at the GNOME project http://www.gnome.org/ . See the software maps at both sites.
  16. Please see Battery Powered Linux Mini-HOWTO by Hanno Mueller, hanno@lava.de http://www.lava.de/~hanno/ for more information.

19.8 Kernel

Related HOWTOs

Many kernel features are related to laptops. For instance APM, IrDA, PCMCIA and some options for certain laptops, e.g. IBM ThinkPads. In some distributions they not configured. And the kernel is usually bigger than necessary. So it's seems a good idea to customize the kernel. Though this task might seem difficult for the beginner it is highly recommended. Since this involves dangerous operations you need to be careful. But, if you can install a better kernel successfully, you've earned your intermediate Linux sysadmin merit badge. - Since this topic is already covered in other documents I want handle this here.

19.9 Tiny Applications and Distributions

A small collection yet, but I'm looking for more information.

  1. BOA - "Lightweight and High Performance WebServer. boa is a single-tasking HTTP server. That means that unlike traditional web servers, it does not fork for each incoming connection, nor does it fork many copies of itself to handle multiple connections. It internally multiplexes all of the ongoing HTTP connections, and forks only for CGI programs (which must be separate processes.) Preliminary tests show boa is capable of handling several hundred hits per second on a 100 MHz Pentium."
  2. MGR - a graphical windows system, which uses much less resources than X.
  3. Low Bandwidth X:

    Alan Cox in LINUX REDUX February 1998 " .. there are two that handle normal applications very nicely. LBX (Low Bandwidth X) is the official application of the X Consortium (now OpenGroup www.opengroup.org). Dxpc http://ccwf.cc.utexas.edu/~zvonler/dxpc is the alternative most people prefer. These systems act as proxy X11 servers and compress datastreams by well over 50 percent for normal requests, often reaching a reduction to 25 percent of the original bandwidth usage. With dxpc, X windows applications are quite usable over a 28.8 modem link or across the Internet."

  4. blackbox - "This is a window manager for X. It is similar in many respects to such popular packages as Window Maker, Enlightenment, and FVWM2. You might be interested in this package if you are tired of window managers that are a heavy drain on your system resources, but you still want an attractive and modern-looking interface."
  5. xfce - xfce is a lightweight and stable desktop environment for various UNIX systems.
  6. linux-lite - distribution based on a 1.x.x kernel for systems with only 2MB memory and 10MB harddisk. URL see above.
  7. smallLinux - http://smalllinux.netpedia.net/ . Three disk micro-distribution of Linux and utilities. Based on kernel 1.2.11. Root disk is ext2 format and has fdisk and mkfs.ext2 so that a harddisk install can be done. Useful to boot up on old machines with less than 4MB of RAM.
  8. cLIeNUX - client-use-oriented Linux distribution.
  9. minix - not a Linux but a UNIX useful for very small systems, such as 286 CPU and 640K RAM http://www.cs.vu.nl/~ast/minix.html . There is even X support named mini-x by David I. Bell ftp://ftp.linux.org.uk/pub/linux/alan/ .
  10. screen - tiny but powerful console manager. John M. Fisk <fiskjm@ctrvax.vanderbilt.edu> in LINUX GAZETTE July 1, 1996 :"It's a GUI, GUI, GUI, GUI world! " -- or so the major OS manufacturers would have you belief. Truth is, that while this is increasingly the case, there are times when the command line interface (CLI) is still a very good choice for getting things done. It's fast, generally efficient, and is a good choice on memory or CPU constrained machines. And don't forget that there are still a lot of very nifty things that can be done at the console."
  11. tinyirc - "A tiny, stripped down IRC Client. Doesn't have most of the more advance commands in the ircII family of IRC Clients, nor does it have any color, but it works, and it's tiny."

19.10 Hardware Upgrade

You may also take into account to upgrade the hardware itself, though this may have some caveats, see chapter Open a Laptop Case above. If you need a survey about the possibilities, you can take a look at http://www.upgrade.de, this page is also available in French and English.


Next Previous Contents

Hosting by: Hurra Communications Ltd.
Generated: 2007-01-26 17:58:32