Difference between revisions of "Server Challenge 08"

From CSLabsWiki
Jump to: navigation, search
(Added, need to add links later)
 
m (added links)
Line 29: Line 29:
 
* CGI and PHP (But doesn't pass GET variables)
 
* CGI and PHP (But doesn't pass GET variables)
  
The code can be downloaded here.
+
The [http://people.clarkson.edu/~torreyji/serverchallenge/httpd.erl code can be downloaded here].
  
 
====Benchmark====
 
====Benchmark====
Line 41: Line 41:
 
</code>
 
</code>
  
This code was meant to be as short as possible, and thus has a very limited functionality. You can download the source code here.
+
This code was meant to be as short as possible, and thus has a very limited functionality. You can [http://people.clarkson.edu/~torreyji/serverchallenge/httpd.pl download the source code here].
  
 
====Benchmark====
 
====Benchmark====
Line 47: Line 47:
  
 
===PHP===
 
===PHP===
[[User:Torreyji|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.
+
[[User:Torreyji|Jacob Torrey]] also started a PHP server, but didn't implement the actual HTTP specs, just a socket and threading model. If interested, [http://people.clarkson.edu/~torreyji/serverchallenge/httpd.phps the code can be downloaded here].
  
 
====Benchmark====
 
====Benchmark====

Revision as of 11:57, 6 March 2008

Summary

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.

Rules

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

The Entries

Erlang

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).
{ok,httpd}
2> httpd:start(9999). % Replace with whatever port you want
http_server
3> httpd:stop().
ok
Quitting
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.

Benchmark

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

Perl

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.

Benchmark

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

PHP

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.

Benchmark

Unable to benchmark due to lack on HTTP implementation.

Ruby

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

ruby httpd.rb 9999 # Port optional

Benchmark

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.

Java

Justin Bennet wrote a server in Java.

Benchmark

Due to JDK issues, we were unable to benchmark.

Results

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