VOGONS


mTCP HTTP Server Test

Topic actions

First post, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

Some of you out there are mTCP users, so this should interest you ...

I have a PCjr running an early version of the mTCP web server. It is serving (most) of its own web site:

http://67.185.176.54:8080/

That link has the main page, and it should look like my normal PCjr web site. This next link has some fun server status like memory available, DOS version, BIOS date, etc.:

http://67.185.176.54:8080/proc/

There are one or two links that are broken because I did not get all of the content moved over. Otherwise, it should work if you try it. The speed might not be great as it is a 4.77Mhz machine and multiple people can make requests at the same time, so be patient - it will catch up. No saturation bombing please, as it is easy to DoS a DOS machine.

I'm collecting log and debug data from this test to help me find problems and make it better. Your few moments of clicking will help me gather more data.

Regards,
Mike

Reply 3 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

Thanks!

I did not think to try to modify the content for the machine serving it, so most of the pictures are quite a bit larger than what they should be. But except for some time spent waiting, the machine is handling it, so it's not horrible - an easily corrected problem.

As of this writing it has taken 3600+ socket connections and served 4300+ objects. Packets sent and received is over 64KB for each. That's a nice milestone ..

Reply 4 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

Following up, the test was either a raging success or a raging failure. It was a success because the machine ran for about 67 hours before an operator error (mine) accidentally shut it down. It did not leak memory, freeze, or crash. But as far as testing goes, I didn't find any problems. I know my code isn't perfect so I need a better way to test. ; - 0

Here are some quick stats on the test:

Uptime: 67 hours
Socket connections: 6410
HTTP GET requests: 7175
HTTP HEAD requests: 21

Return code 200s (OK): 5870
Return code 301s (Moved Permanently): 75
Return code 304s (Not modified): 274
Return code 401s (Not authorized): 212
Return code 404s (Not found): 743

I served a lot of 404s because I did not have the docs on the machine ... those PDFs are too big.

Unique IP address: 514
Unique user-agent strings detected: 200

Interesting user agents:

User-Agent: Crowsnest/0.5 (+http://www.crowsnest.tv/)
User-Agent: facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)
User-Agent: Googlebot-Image/1.0
User-Agent: IrssiUrlLog/0.2
User-Agent: jack
User-Agent: Jakarta Commons-HttpClient/3.0.1
User-Agent: Java/1.6.0_35
User-Agent: Lynx/0.43b (DosLynx) libwww/2.14
User-Agent: Mozilla/3.0 (compatible; Indy Library)
User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Mac_PowerPC)
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
User-Agent: xChaos_Arachne (DOS /5.1.97;GPL,387+)
User-Agent: Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:26.0) Gecko/26.0 Firefox/26.0 SailfishBrowser/1.0 like Safari/538.1
User-Agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.8.0.7; rv:27.0) Gecko/20100101 Firefox/27.0

HTTP protocol:

HTTP 0.9 requests: 1
HTTP 1.0 requests: 94
HTTP 1.1 requests: 7101

Most interesting requests:

GET /HNAP1/ (looking for an old d-link security hole)
GET /i/am/currently/hacking/you/mike
GET /you/are/being/hacked/mike
GET /apple-touch-icon.png
GET /apple-touch-icon-precomposed.png

There were about 15 errors parsing URLs where I wish I had logged more information. I'll do better on that next time.

Remember, this test ran on a PCjr. It has a V20 CPU and a jrIDE for memory and a hard drive, but otherwise it is stock. 4.77Mhz of insane, 8088 class madness. You could easily run this test on a machine with 512K of sidecars and a parallel port connected hard drive.

Thanks for the testing help!

Mike

Reply 5 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

It's running again. The links have changed slightly - just go to http://www.brutman.com/ and navigate from there.

(I wanted more realistic traffic for the test so I am redirecting traffic from my paid web hosting to the PCjr. It has been running for a few days with the only problem being a small power outage.)

This time around the PCjr is using a real ISA Ethernet card, so it should be a little faster. I've made some bug fixes too.

Mike

Reply 7 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

No, but that's a much longer story ...

Also, most of the technical content is on the PCjr, while the other stuff is still on my normal web host. So look for mTCP and PCjr pages there. If you are curious about how many hours it has been running, how many pages it has served, error rates, free memory and DOS version check out: http://67.185.176.54:8088/proc/

Mike

Reply 8 of 13, by smeezekitty

User metadata
Rank Oldbie
Rank
Oldbie

An 8088 like CPU is awfully slow
How nmany clients can be served simultaniously?
What is harder on it, a slow client or a fast client?

Reply 9 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

The answer is, it depends ...

On an 8088 4.77Mhz machine with a decent Ethernet card you can push about 70 to 100 KB of data per second. When you add in disk access things slow down by one third to one half.

I have this particular machine setup to allow up to 8 connections at the same time. That means there can be 8 different HTTP requests going at the same time. If there are more they will be queued up and will wait. The 8 connections take turns, so one slow connection does not hurt the rest of the connections.

This is not a high bandwidth service, so a PCjr is more than capable for serving this content. If I had more visitors I would use a 286 or better depending on how much traffic we were talking about.

Keep in mind that this machine has to do all of the TCP/IP work, the HTTP request parsing, and extensive logging of each request. Yes, it is a lot of work. But this code is designed for it.

Mike

Reply 10 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

It is still running ... 200+ hours of continuous runtime and over 7000 connections served. All from a machine that is still running DOS 3.3.

Reply 12 of 13, by smeezekitty

User metadata
Rank Oldbie
Rank
Oldbie

What's the chance the source for the server could be released?
Can mTcp be be ported to 32 bit protected mode DJGPP for more memory on 386/486/pentium machines?

Reply 13 of 13, by mbbrutman

User metadata
Rank Oldbie
Rank
Oldbie

The general answer is, when it's done. I've released all of the other mTCP source code. But honestly, in the three years since that has happened I only know of two people who have used it (and told me about it). I've not received any bug fixes or new features. Based on this experience, open sourcing it is nice but not a terribly important priority.

A 32 bit port is possible. A 32 bit version would certainly perform better. But even the 16 bit versions would do better with expanded or extended memory. For some applications (IRCjr and the HTTP server) this makes sense; IRCjr could use the memory for more scrollback and multiple open servers, while the HTTP server could use it for caching content in memory and larger client buffers.

I'm happy to help anybody who is interested to do the work. But I can't do it myself - there is just not enough time.