Mike's PCjr Page Logo

The PCjr Web Server

I have a few long running retro-computing projects in progress, a few of which center around the PCjr and mTCP, my TCP/IP stack that runs on old DOS machines. And what could be more fun than combining the two?

The PCjr has been proven to be more than capable of running TCP/IP applications competently; all of the mTCP programs run well on it. Why not a web server?

In late October 2013 I started working on a simple web server for DOS. Web serving seemed simple at first; you wait for a connection, you read and parse a request, you send the content on the same connection, and then the connection closes. Well, reality is quite a bit different. HTTP 1.0 and 1.1 differ quite a bit from HTTP 0.9. Request parsing is not trivial. Performance, mapping long names to DOS 8.3 names, logging, authentication, compatibility with multiple clients, etc. all add complexity too. The web server turned out to be far more complex than I thought. And it exposed some small problems in mTCP.

In late March I did my first public test, asking people to visit the server directly. That helped me collect some data to see how the server performed against a variety of clients. I made a few notes and then put the code to the side for a few weeks as real life insisted on asserting itself.

In June I reviewed the code and made some fixes and improvements. And then I had a slighly devious idea; instead of asking people to click on a link and visit the PCjr, I would redirect existing traffic from www.brutman.com to the PCjr. The redirects are easy to put in place and the unsuspecting users would automatically be enlisted into helping me test the code. All of the technical content from my main site would be served from the PCjr, excluding the very large PDF files in the PCjr documentation directory. This includes all of the mTCP pages, the PCjr pages, images, and the other technical projects.

Here is the machine (click for a larger image):

PCjr web server

The machine is not quite stock. Here is the configuration:
  • NEC V20 CPU (still 4.77Mhz, but a little faster than the stock Intel 8088.)
  • jrIDE sidecar with 608KB additional memory (system total 736KB) and IDE interface
  • Maxtor 20GB IDE drive (behind the fan which is cooling it)
  • Western Digital 8003 Ethernet card on a PCjr to ISA bus adapter
  • IBM PC DOS 3.3
You could very easily use a PCjr with a Zip drive for mass storage and a Xircom PE3-10BT for Ethernet connectivity. Except for needing a modified LPT2 sidecar, that would be a fairly stock machine. It would not be as fast as this machine but it would still work pretty well.

Here are the run times and statistics:

Start time
Run time
Requests served
TCP Packets Sent
TCP Packets Recevied
Tueday June 17 20:37:02
240 hours
9002
142693
123337
Friday June 27 22:04:05
302 hours
12883
197881
176342
Thursday July 10 12:36:49
366 hours
12753
209824
182912

The run time is rounded down to the nearest hour. The server was only stopped to move the logs as disk space is limited.

That is 908 hours of run time and 34638 objects served. The machine was continuously powered and not rebooted the entire time. The load was not high; 38 requests per hour on average. But the machine did get a workout, especially when it was directly linked to by Ars Technica. (The article is still pointing at my cable modem directly.) And the machine is capable of handling much more traffic; it was idle most of the time.

After the third run I collected logs and powered the machine off. The next day I wanted to run chkdsk one last time before packing the machine up for a move; the hard drive would not spin up! I got over my panic, did some experiments and determined that the hard drive would spin up on a different power supply or on the existing power supply with the fan removed. So the power supply might be marginal, the fan might be drawing too much power, or the drive is failing. I did a backup and I'll figure out what to do another time.

Except for having to collect the logs every two weeks or so the machine was maintenance free. I need to add some code to "roll the logs" and compress them, which will allow for even longer run times. The machine itself is very reliable; there are not many moving parts in it. The monitor was powered off most of the time. The only weak spot in the setup is the hard drive; this particular hard drive is close to 15 years old. A FLASH based device (like a Disk On Module) would eliminate that problem. The fan noise can get to be annoying too.

The experiment is over for now - real life is intruding again. I collected a lot of data that needs to be analyzed. In the future I would like to run all of brutman.com from a PCjr.  But for now, I think I'll just give the machine a break and let it run Flight Simulator or CrossFire for a while instead.

Created July 27th 2014
(C)opyright Michael B. Brutman, mbbrutman at gmail.com

Return to Mike's IBM PCjr Page main page