| NetProg Spring 2004 HW5 |
|   Project Description | Concurrency | Written Report | Deliverables | Grading |
Submit to WebCT drop box.Late Penalty: 10%/dayHW5 can be done in C/C++ or JavaProject DescriptionYour assignment is to write an HTTP server that returns a document whose size is determined by the request URI. Your server will support 2 different for methods of providing concurrency, and you will do some performance measurements to determine whether there is a noticable difference between the two methods of concurrency. The contents of the document returned by your server can be any
HTML document you want, the size of the document is determined by the
requested URI. Your server should strip the leading slash
' If the request line looks like this: GET /1234
HTTP/1.0Your server should send back a document
that contains exactly 1,234 bytes of text. You should send back a
valid HTML document, but the content of the document can be anything.
The minimum size requested will be 100 bytes, this minimum means that
you can always create a valid document (with
This document is 250 bytes long:
Note that your server must send back an HTTP response line, a Content-Type header and a Content-Length header. None of these count towards the size of the document. Your server should send back an HTTP response line that indicates an error if the requested URI is not a number or is less than 100. ConcurrencyThe focus of this project is on the development and testing of a concurrent server. Your server must be capable of providing concurrency in 2 different ways, either a forking server (new child per request), or a pre-threaded server. A command line option is used to select the threaded server and the number of threads that should be created when the server initially starts. The first command line argument is the port number that your server should bind to. This is the only command line argument required for the forking server (if only one command line argument is used, your server should be a forking server). If a second command line argument is found, your server should treat this as the number of threads to be used for a pre-threaded server. Usage: hw5 portnum [num_threads] ./hw5 1234 starts forking server on port 1234 ./hw5 3333 100 starts pre-threaded server on port 3333 with 100 threads NOTE: On solaris.remote.cs.rpi.edu you are restricted to a
total of 64 processes, this includes your login shell and any other
processes you may be running. You need to include code that can
handle the possibility that Performance ReportOnce your server is working, you must test your server and make
some measurements of the two methods of concurrency for various request sizes and
degrees of concurrency. You do not need to provide timing or
statistics gathering code in your server, instead you will use a
client that can make lots of requests and report on the results.
The ApacheBench program is available
for making measurements - this program can generate multiple HTTP
requests to your server with any desired level of concurrency.
The program executable is installed on the CS Suns
as
You must write a brief (1-2 pages) report that describes your tests, summarizes the results, and provides some insight into what the results mean. Your report should focus on a comparison of the 2 concurrency modes
supported by your server. The general idea is to determine which mode
works best and by how much. The requests per second numbers reported
by DeliverablesYou must submit all the source code necessary for us to build your system. Your submission must also include a README that includes your name and a desciption of each file submitted (and anything else you want to tell us). You must also submit your report as part of your submission. Your report must be a file that can be easily read on the CS workstations, so either text, HTML or PDF (no Word files!). Grading50% of your grade will depend on your server code (we will build and test your server), the other 50% depends on your report. |