

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this graduate-level project, students are required to develop an http server that returns documents of specified sizes based on the requested uri. The server must provide concurrency using either a forking or pre-threaded method. Students will test the server's performance using the apachebench tool and write a report comparing the two concurrency methods.
Typology: Study Guides, Projects, Research
1 / 3
This page cannot be seen from the preview
Don't miss anything!


In this project, you are required to write an HTTP server that returns a document whose size is determined by the requested URI. Your server will provide concurrency with TWO different methods. You will do some performance measurements to determine whether there is a noticeable performance difference between the two concurrency methods.
More specifically, your server needs to achieve the following requirements:
If there is only one augment, the port number is found, 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: pj3 portnum [num_threads]
./pj3 1234 starts forking server on port 1234
./pj3 3333 100 starts pre-threaded server on port 3333 with 100 threads
GET /2000 HTTP/1.
Your server should send back a HTML document that contains exactly 2,000 bytes of text, e.g. when the client save the document on the local disk, the file size should be 2,000 bytes. The returned HTML document should follow the proper format, but the content of the document can be anything. The minimum size requested to create a valid document (with HTML, HEAD and BODY tags) will be 100 bytes. So if the requested URI asks for a size less than 100 bytes, your server should return a document with 100 bytes. As an example, the following document is 100 bytes long:
100 bytes of fun
a a a a a a a a a a a a
Server Software: Apache
Server Hostname: www.cse.sc.edu Server Port: 80
Document Path: /~wyxu/foo.html Document Length: 409 bytes
Concurrency Level: 10 Time taken for tests: 0.318 seconds Sent requests: 100 Completed requests: 100 Failed requests: 0 Total transferred: 66400 bytes HTML transferred: 40900 bytes Requests per second: 314. Transfer rate: 203.911163522013 kb/s received
Connnection Times (ms) min avg max Connect: 1 3.34 17 Response: 6 29.05 110
Warning messages from ab(): [Warn:] None.
HTTP request: GET /~wyxu/foo.html HTTP/1.
User-Agent: ApacheBench-Perl/0.
Host: www.cse.sc.edu
Accept: /
Response headers: HTTP/1.1 200 OK
Date: Wed, 07 Nov 2007 23:19:12 GMT