Server Challenge 08

From CSLabsWiki
Revision as of 11:57, 6 March 2008 by Torreyji (talk | contribs) (added links)


The server challenge was a fun little experiment to show people how much thought and effort is required to make a HTTP server. The assignment was to take some time and program, in any language, a very simple multi-threaded HTTP 1.0 server that can at-least handle GET requests. It was open to anyone and was just for fun as an educational experience.


  • No using a languages built-in HTTPd that some languages have

The Entries


Jacob Torrey wrote an Erlang server. To run it start up Erlang and type the following:

Erlang (BEAM) emulator version 5.6 [source] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.6  (abort with ^G)
1> c(httpd).
2> httpd:start(9999). % Replace with whatever port you want
3> httpd:stop().
4> q().

The server supports the following features:

  • MIME type lookup
  • CGI and PHP (But doesn't pass GET variables)

The code can be downloaded here.


Using ab with -c 70, we got an average response time of <1ms.


Jacob Torrey also wrote a perl server. To run it type the following at the command-line:

./httpd 9999 # Pick a port here

This code was meant to be as short as possible, and thus has a very limited functionality. You can download the source code here.


Using ab with -c 10, we got an average response time of 853ms with a maximum time of 22305ms.


Jacob Torrey also started a PHP server, but didn't implement the actual HTTP specs, just a socket and threading model. If interested, the code can be downloaded here.


Unable to benchmark due to lack on HTTP implementation.


Chris Peterman wrote a server in Ruby. To run it type the following at the command-line:

ruby httpd.rb 9999 # Port optional


When running (an early version), it didn't work, nor did it respond to CTRL-C. I'm sure it fell in between the perl server and the Java server.


Justin Bennet wrote a server in Java.


Due to JDK issues, we were unable to benchmark.


The prize (a book on networking) was awarded to Jacob for the only operational servers during the event.