Ye Old Laptop as a Server

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

Resourceful people can use an old desktop as a server of some sort, but they also may have an old laptop around collecting dust. Although most of today's desktop environment software runs too slowly on these older laptops, you may not want to get rid of yours yet. These cast-offs easily can be transformed not only into a low-power server, but also into a mobile VoIP and Web server.

Let's look a three Linux distros with this in mind and test two different Web servers. The Ye Old Laptop used in this article is a Dell Latitude with a 1.0GHz Intel Pentium III Mobile CPU and 256MB of RAM. Keep in mind that Web 2.0 software may be too much for these old cast-offs. So, if you need to serve the latest-and-greatest flashy content, you're better off buying a new desktop computer. The server configuration I used and tested on every Linux distribution is Apache 1.3.34, Lighttpd 1.4.13, PHP 5 and MySQL Server 5.

Xubuntu 7.04

Xubuntu is an official Ubuntu distribution for old or slow systems. The main difference between it and Ubuntu is that Xubuntu uses the Xfce window manager instead of GNOME. An X-less Ubuntu or Kubuntu installation should have the same performance results as an X-less Xubuntu. With X running, Xubuntu requires at least 128MB of RAM, but the minimum requirements for the Xubuntu Alternate CD without X are 64MB of RAM. It uses the Ubuntu repositories, which are filled with programs that satisfy nearly every system administrator's needs. I installed Apache 1.3 and Lighttpd 1.4, MySQL Server 5 and PHP 5 with apt-get install apache lighttpd and apt-get install mysql-server-5.0 php5. For some reason, I had to install Apache 2.0 (and all its dependencies) to get PHP to work with Apache 1.3. After I got it working, I then uninstalled Apache 2.0.

After configuring Apache and Lighttpd, I stress-tested the Web server over a 100Mb Ethernet connection with Siege, a benchmarking and HTTP regression-testing utility. It is designed to let Web developers measure the performance of both their code and their servers to see how well the server functions on the Internet under a heavy load. Siege supports basic authentication, the HTTP and HTTPS protocols, and even cookies. This utility allows system administrators to hit their Web server with both a concurrent and configurable number of simulated users.

I generated a 5KB file with dd and ran a stress test with siege 192.168.1.179/5kb -c10 -r10 on a fairly new computer, simulating ten clients refreshing ten times each second (a fairly heavy load). To improve results, I turned off all unneeded services, including Xorg, Samba, the FTP server and the IRC server. If you run Siege with the -b command-line argument, it runs the test without any delay for throughput benchmarking. This means that the server gets all the hits at once (but that isn't a very realistic scenario). Without the -b flag, Siege invokes each simulated user with a delay of at least one second. Table 1 shows the performance differences between Apache 1.3 and Lighttpd 1.4.13.

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

Ten clients, ten hits/second, 5KB fileApache 1.3Lighttpd 1.4.13
Time elapsed9 secs8 secs
Data transferred0.2MB0.35MB
Server response time0.06 secs0.00 sec
Transaction rate11.00 trans/sec12.5 trans/sec
Throughput0.02MB/sec0.04MB/sec
Concurrency0.70.02
Longest transaction3.00 secs0.04 secs
Shortest transaction0.00 secs0.00 secs

The tests performed on Xubuntu 7.04 (Table 1) reveal that the transaction rate is high, and the shortest transfer time is about a millisecond or less. (Siege can't calculate anything below a millisecond.) This is mainly because my network consists of only 20 feet of cable. Depending on your connection, testing over the Internet will show a greater latency than over a local network. According to the Siege man page, concurrency is the average number of simultaneous connections. When the number rises, the server performance decreases, especially on slower hardware.

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

Ten clients, ten hits/second, 1MB fileApache 1.3Lighttpd 1.4.13
Time elapsed12 secs12 secs
Data transferred108.41MB108.40MB
Server response time0.5 secs0.4 secs
Transaction rate8.3 trans/sec8.2 trans/sec
Throughput9.0MB/sec8.9MB/sec
Concurrency4.33.5
Longest transaction1.30 secs0.75 secs
Shortest transaction0.1 secs0.1 secs

The tests performed on the 1MB file (Table 2) show that under a heavy load, Lighttpd 1.4.13 performs the best with smaller files (such as blog posts without any pictures). Performance, however, is still higher than Apache with 5KB files. Interestingly, the heavier the load, the better Apache performed. Results from tests on 5MB files under a very heavy load of 50 clients at ten connections per second showed a 0.1 second higher response time and a 0.1MB/sec higher throughput than Lighttpd. Lighttpd still had shorter transaction times that were four seconds less than Apache though.

On Xubuntu, Lighttpd is the fastest performing server for static documents, although Apache follows close behind. For best results in Xubuntu, turn off all unneeded services, so that if the server gets a heavy load, it will have a few more resources to improve speed. I found Xubuntu to be quite fast and easy to get running, but there are other distros to consider, such as Vector Linux.

______________________

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