Date: Wed, 5 Jan 2000 02:41:13 +0100 (CET) From: Marc Schneiders <marc@oldserver.demon.nl> To: newbies@freebsd.org Subject: webserver on 4MB RAM (too long) Message-ID: <Pine.BSF.4.10.10001050141360.6670-100000@propro.oldserver.demon.nl>
next in thread | raw e-mail | index | archive | help
This list has 'making mistakes, boasting' in its charter. This is exactly what follows. As I like to play around with old hardware and could not find any useful purpose for a Toshiba laptop (486 SX 33) with only 4MB RAM (and not even 4096 but 39XX according to the memory test) and a dead battery, and as additional RAM and a new battery was too expensive, I decided to install FreeBSD (4.0 current) on it and see whether it would work as a webserver. It does :-) Recent versions of FreeBSD cannot be installed with less than 5MB, so I had to take the hard disk out and install on a desktop. Before I opened the laptop, tricky as that is, I wanted to find out whether it worked on the desktop. Installing (with 8 MB) went fine over nfs, but the GENERIC kernel would not boot after I reduced the RAM in the desktop to 4MB. Compiling a kernel and getting rid of unnecessary options (nfs = 250KB!) made it run. (I now have a kernel of 1.31MB). I thought it wise to find out, whether things stayed ok for a longer period. So I let the desktop (a DX 66) run rc5des (www.distributed.net) on 4MB for some time. It did great and had the same speed as other 486/66 machines I had rc5 running on. So I went to bed. Next morning the harddisks (there were two of approx. 100MB each) were spinning and the desktop seemed frozen. It could be pinged, change consoles by pressing alt-Fx, but nothing else. After some hours I turned it off and on. Again it was running rc5des ok. This happened a few times. Until one night I was up longer and found out what made the machine stop responding: the daily cron jobs at 2:00 AM. I asked some advise on the questions list (thanks!) and turned these off. I also shutdown sendmail and disabled it in /etc/rc.conf. Now the freezes did not occur any longer. (Sendmail is now on again.) Next step: the webserver. This I also tried on the desktop. I was under the impression that apache was too big, so I went for boa, which is small and doesn't fork (except in cgi). Boa is in the ports. I was lazy and ftp-ed it from another box I have it on. It worked fine. I tested it by turning the thing into a webcam server. It got a new picture every 30 seconds from a camera (attached to a Win98 PC) by ftp. Four other boxes had the webcampage on simultaneously. The pic (approx 12KB) refreshed automatically on all four, also every 30 seconds. There were no problems whatsoever, not even when I ran rc5des on the 4MB-box as well. So I opened the laptop, got the harddisk out, installed FreeBSD on it with 8MB RAM in the desktop, compiled a kernel for the laptop (with pccard) and moved it back in the laptop. It didn't work :-( The Toshiba would not see the disk anymore. I am not sure why, but running the setup for the laptop from a dos-floppy and setting harddisk to "???" (I had two options: "???" or "not installed"...) it worked, but the laptop could not find FreeBSD. So I decided to put the bootmanager on it. This has helped me in the past. Might be a simple matter of active partitions. But anyway. I did that. Then it booted ok. But ... it dropped into single user mode. Problems related to new/old ide-driver. (See current list few weeks ago: 50 messages about it at least.) Anyway, I tried this and that, put the harddisk back in the desktop, in which it did work. In the end, and after reading a bit in the current list, I decided to try the old ide-driver. This did it. I was happy. I've now been looking at my webcam for two days. It runs just fine on the laptop. Now all I have to do is hide the laptop somewhere at work and secretly attach it to the net (there is a PCMCIA-ethernet card in it), so my boss won't notice it... Maybe I can turn it into a mailserver as well. (Seems you can have one of your own with a real domain through free webhosting with dns-options at webprovider.com. Maybe I should register lowmemory.net. It is still available.) What you cannot reasonably do on this 4MB-laptop: compile ports. I tried lynx, it was still busy with bzip2 (a dependancy) after 5 hours. So I installed the package. Compiling a kernel I haven't even tried. On the desktop with 8MB RAM and a faster CPU it took two hours. I had to try out many config's to see what really counted (nfs!). So you need a 'real' box for that. Also better avoid using nmap on a server like mine. It freezes it for more than five minutes. But it did recover! Finally, a question, even though I shouldn't here: what is the best mail client to run on low memory? Not pine, I suppose. Mutt? -- Marc Schneiders marc@venster.nl marc@oldserver.demon.nl propro 1:40am up 5 days, 3:29, load average: 2.01 2.01 2.00 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001050141360.6670-100000>