Ye Old Laptop as a Server

 in
Don't throw away that old laptop; use it as a mobile VoIP and Web server.
Vector Linux 5.8

Vector Linux is another distro tuned for slower systems. It is based on Slackware 11, but unlike Slackware, Vector strives to retain legacy drivers for very old hardware. Its forum actively supports users of equipment that is considered to be outdated. It is even used for software development and Web serving, even though the distribution's focus is on the desktop environment.

Vector Linux comes with Slapt-get, an apt-like package manager for Slackware-based systems, by default. It is quite compatible with most Slackware packages on linuxpackages.net, so installing Web server software is quite straightforward. I couldn't get a package list from Linux Packages (at the time of this writing), so I gave up and compiled Apache, Lighttpd, PHP and MySQL from scratch. I copied over the Apache and Lighttpd configuration files from Xubuntu and made sure everything was working. Then, I fired up Siege and stress-tested it.

Table 3. Performance Differences between Apache 1.3 and Lighttpd 1.4.13 on Vector Linux with a 5KB File

Ten clients, ten hits/second, 5KB fileApache 1.3Lighttpd 1.4.13
Time elapsed9 secs7 secs
Data transferred0.49MB0.49MB
Server response time0.09 secs0.00 secs
Transaction rate11 trans/sec14.2 trans/sec
Throughput0.05MB/sec0.07MB/sec
Concurrency1.000.02
Longest transaction3.00 secs0.01 secs
Shortest transaction0.00 secs0.00 secs

Similar to the results with Xubuntu, Lighttpd is a clear leader in speed on Vector Linux as well (Table 3). On Vector Linux, Lighttpd has a noticeably higher transaction rate than Apache, and Apache's longest transaction is practically three seconds slower than Lighttpd's! Throughput is just a tiny bit greater with Lighttpd than with Apache, and the concurrency is shockingly low. This speed gap closes when Lighttpd is presented with a 1MB file. Just like working with Xubuntu, you should turn off any unneeded services and even cron jobs in Vector Linux for optimal performance.

Table 4. Performance Differences between Apache 1.3 and Lighttpd 1.4.13 on Vector Linux with a 1MB File

Ten clients, ten hits/second, 1MB fileApache 1.3Lighttpd 1.4.13
Time elapsed11 secs10 secs
Data transferred97.67MB97.67MB
Server response time0.4 secs0.3 secs
Transaction rate9.1 trans/sec10 trans/sec
Throughput8.9MB/sec9.7MB/sec
Concurrency3.593.21
Longest transaction0.63 secs0.65 secs
Shortest transaction0.08 secs0.08 secs

Lighttpd on Vector Linux is the fastest performing server for static documents (Table 4). Apache follows with good results. Results from tests on 5MB files also under a considerably heavy load of 50 clients at ten connections per second showed that Apache had an average response time about 150 milliseconds faster than Lighttpd. Lighttpd and Apache had nearly equal transaction rates and throughput, but Lighttpd's concurrency was higher than Apache's. Interestingly, Lighttpd's longest transaction time was a full ten seconds shorter than Apache's!

Slackware is often known for its almost legendary server qualities, and it appears that Vector Linux measures up to them. What happens though, when you go even smaller—as small as the 50MB Damn Small Linux?

Damn Small Linux 3.3

Damn Small Linux (DSL) is known for its small size and for running well on slower systems. It also has the apt package manager. With the right apt repository, you can practically turn DSL into a full-fledged distro! It was designed to run on very old hardware, including processors such as the 386, 486, Pentium, Pentium II, Pentium III and the older AMD equivalents. Unlike Vector Linux and Xubuntu, DSL uses the “classic” 2.4 Linux kernel and BusyBox, rather than the 2.6 kernel and the GNU utilities. Like Knoppix, it is designed to run off a Live CD (or USB thumbdrive), but it serves as an excellent desktop operating system too—if you don't mind using older versions of your frequently used software.

DSL is somewhat crippled for anything but Web browsing and music playing. To use DSL as a server OS, you will need to install the GNU utilities by selecting Apps→Tools→Upgrade to GNU Utils in the System menu. This will make the DSL system more fully GNU-compatible. If you plan to use apt, you need to click on Apps→Tools→Enable Apt in the System menu. Now that the GNU utilities are installed, you can install Apache or Lighttpd. I recommend compiling everything—PHP, MySQL and the http server—from scratch. Although this takes some time and effort, it is far less complex than trying to get everything working correctly with apt or MyDSL (Damn Small Linux's own spartan package system). By compiling the Web software from source, you have complete feature control as well.

For those who don't need or want Apache 1.3, the XAMPP Project has a completely configured and working standalone Apache 2, MySQL and PHP binary package that can install anywhere on the system.

Table 5. Performance Differences between Apache 1.3 and Lighttpd 1.4.13 on DSL with a 5KB File

Ten clients, ten hits/second, 5KB fileApache 1.3Lighttpd 1.4.13
Time elapsed7 secs10 secs
Data transferred0.49MB0.49MB
Server response time0.00 secs0.09 secs
Transaction rate14.2 trans/sec10 trans/sec
Throughput0.07MB/sec0.05MB/sec
Concurrency0.020.90
Longest transaction0.01 secs3.00 secs
Shortest transaction0.00 secs0.00 secs

The speed difference between Apache and Lighttpd is quite noticeable (Table 5); Apache is clearly the faster of the two. I used the Apache package in the MyDSL package manager though, which could be optimized for older systems. Interestingly, Apache had a higher transaction rate than Lighttpd did. It also had quite a low concurrency. Although Apache is noticeably faster than Lighttpd, the hardware constraints of the laptop make any Web server lousy at anything but small files under a heavy load. However, it could serve small blogs or PHP, Perl, Ruby and Python scripts under a medium load without getting too overloaded.

Although it may seem like Lighttpd is slacking off on the first test, when it has to pull a load, it does it efficiently.

Table 6. Performance Differences between Apache 1.3 and Lighttpd 1.4.13 on DSL with a 1MB File

Ten clients, ten hits/second, 1MB fileApache 1.3Lighttpd 1.4.13
Time elapsed11.7 secs10.8 secs
Data transferred97.66MB97.66MB
Server response time0.34 secs0.35 secs
Transaction rate8.5 trans/sec9.3 trans/sec
Throughput8.3MB/sec9MB/sec
Concurrency2.93.3
Longest transaction0.70 secs0.65 secs
Shortest transaction0.08 secs0.08 secs

Test results show (Table 6) that Lighttpd quickly regained its customary speed over Apache. Lighttpd's average response time is only a fraction faster than Apache's, but the transaction rate is almost a full megabyte per second more than Apache's. Lighttpd, however, has a higher concurrency, but that didn't pose a problem when I ran a test with 50 clients connecting ten times a second, as Lighttpd was still faster. Running this test on a 5MB file returned very disappointing results. Apache had the lowest of the longest transaction times but was otherwise the same as Lighttpd in throughput and transaction rates.

Overall, DSL is the smallest of the three distros tested in this article. When fleshed out with Apache/Lighttpd, GNU and other server utilities, the disk space used is less than 100MB. In general, Lighttpd and Apache on Damn Small Linux tie in practically every aspect. You will notice some minor speed improvements with X turned off, and although there aren't many, you still may want to turn off all unneeded services. In these days of broadband, even a quarter of a second can be a quarter second too slow. Damn Small Linux may seem like a strange distribution to use as a server OS, but there is no real reason why it can't be used as one—it's just one of the few actively developed distros that uses the 2.4 Linux. Like all distros, DSL needs to be tweaked so that you can get the most out of it.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Ye old laptop server with OpenBSD

Andy Viar's picture

Trying a similar tactic, but this time with OpenBSD on an older Dell Latitude with less memory. andyviar.homeip.net

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix