For diverse reasons I won't bother explaining, including stubborness worthy of a vasque mule, I faced the completely unnecesary task of turning a P75 with 800MB of disk space and 16MB of RAM into a modern workstation capable of performing the usual tasks:
- Graphical web navigation.
- MP3 audio
- MPEG video reproduction (yes, really ;-)
Plus whatever crossed my mind while using it. Of course I can't ask this tired piece of silicon to be fast, but I won't settle for inadequate performance. I am too poor to have a toy computer, I want it to be useful, and do real work.
Because of diverse installation issues (this is a notebook with a floppy disk WITHOUT linux drivers, and no optical drive), I only managed to install Debian. Since I like apt-get, I decided to ignore other problems (not even a network config tool????), and stick with it. I am using testing, which is more uptodate than stable, but not as broken as unstable.
I could probably use much less memory and disk using an old distribution, like Slackware 96. After all, I used that on 16MB 486s, and I remember it working ok.
But... the browser would be Netscape 2.0, and there were no mp3 players, so, fuggedhaboutit.Conclusion: Debian/Testing
Extremely important: hdparm. This tool configures several things about the hard disk (DMA usage, 32 bit transferences, etc.) Since this is a senior computer, most options are not supported, but with a little effort I managed to increase the transfer speed from 1.7MBps to 4.7MBps, more or less what a semi-modern desktop does without optimizing.
Obviously, if we are memory starved, we should not waste it running unneeded stuff. I applied this rule with taliban-worthy zeal.
- Clean up /etc/inittab.
Why 6 virtual consoles? Cut it to 2.
Graphical login? I am the only user! Adding this line provides a X session for user ralsina:
sx:2:respawn:/bin/su - ralsina -c exec xinit >/dev/null 2>&1The use of exec prevents the shell from running after X starts, and use of xinit saves a process (startx calls xinit anyway)
Only klogd and apmd are running by default.
Kernel 2.2.20, hand built, static support for all devices, no firewall, no PCI, no nothing, low latency patched.
X Window System
XFree86 v3.3 uses less memory. But it didn't work. So, I am using 4.1.
To save memory, you can remove diverse modules. I avoided xfs, and made X itself load the fonts.
Also, drop support for Speedo and Type1 fonts, leaving only TTF support (I am using the MS core fonts).Those two changes save about 2MB of RAM.
You can also remove extensions like XRENDER, XVideo, etc. but that would invove recompiling X. There is a tempting option called XTiny, used on PDAs and such, and maybe I will try that someday.
I configured the X server for a 16bpp color depth. That saves memory when creating offscreen pixmaps, since those are always the depth of the screen. This saves much memory when opening a web page, for example. It would be better to use 8bpp, if only it wouldn't look so awful.
You can also save disk space removing pieces of X, such as xieperf.
Forget KDE. Forget GNOME. Forget even Window Maker. Think small.
Some window managers are small, but they achieve their size by shifting functionality into helper apps. I was looking for a WM that was small, but allowed me to assign shortcuts, had a menu to launch apps, and some sort of taskbar. The support for diverse applets would be a plus.
The answer: fluxbox. Uses less than 500KB of RSS while doing all the above.
The shell is actually a rather large app. bash uses almost 2MB of RAM!. So, I made ash the default shell, which is 75% smaller.
Obviously ash is not a very nice interactive shell, but if you make /bin/sh a symlink to /bin/ash, the startup scripts use it, and they become much faster.
Notice that when you start an application from fluxbox, it starts a shell, the shell in turn, starts the app. That shell stays idly in memory for the life of the application!
To save that memory, I made ash the user shell, and made the terminal start bash explicitely.
You can also save that memory by configuring the WM to start "exec rxvt" instead of "rxvt", making rxvt replace the shell in memory, but that doesn't avoid the slower startup time of bash.
In short, using ash saves a little RAM, but it also makes the computer feel a lot faster!
- Terminal emulators
Loaded each one, measured each one, rxvt is by far the smallest.
- MP3 player
mp3blaster. Small, powerful, and using the -2 and -8 options, it uses little CPU. No other app could play without skipping.
- MPEG Video Player
Only one works in this box: MPegTV. Shareware, and the pretty version (mtv) uses too much memory. But thr CLI version, mtvp gives me 320x240 at 12fps! As long as it is without sound, else it becomes jerky.
- Gnutella client
I tried one, it worked, I liked, it stays: mutella
- Web browser
No contest: Graphical Links under X. Fast, supports many pages, a real gem. A previous version said "No contest: Opera". Well, that was then, this is now ;-)
Conclusion: fluxbox, links, mutella, rxvt, MPegTV, ash.
I will let my system do the talking. Here is a regular session, navigating the web, downloading with mutella, connected to a server via ssh, all within X except for a text editor. Notice how her I am using Opera. That is because it is old. Currently I use a couple less MB.
|ralsina||1236||0.0||1.0||2560||148||?||S||11:50||0:09||rxvt -e ash|
If you have tips to share, or want to know details on anything mentioned on this article, just post a comment, or email me using the link in this very page.