first commit
This commit is contained in:
5
CS4210/cs4210/proj1/docs/CVS/Entries
Normal file
5
CS4210/cs4210/proj1/docs/CVS/Entries
Normal file
@@ -0,0 +1,5 @@
|
||||
/Project 1 Report.doc/1.1/Tue Feb 21 06:39:41 2006/-kb/
|
||||
/Project1.pdf/1.1/Tue Jan 24 01:18:22 2006/-kb/
|
||||
/report.pdf/1.1/Tue Feb 21 06:39:41 2006/-kb/
|
||||
/report.txt/1.3/Tue Feb 21 06:39:41 2006//
|
||||
D
|
||||
1
CS4210/cs4210/proj1/docs/CVS/Repository
Normal file
1
CS4210/cs4210/proj1/docs/CVS/Repository
Normal file
@@ -0,0 +1 @@
|
||||
cs4210/proj1/docs
|
||||
1
CS4210/cs4210/proj1/docs/CVS/Root
Normal file
1
CS4210/cs4210/proj1/docs/CVS/Root
Normal file
@@ -0,0 +1 @@
|
||||
/usr/_CVS
|
||||
BIN
CS4210/cs4210/proj1/docs/Project 1 Report.doc
Normal file
BIN
CS4210/cs4210/proj1/docs/Project 1 Report.doc
Normal file
Binary file not shown.
BIN
CS4210/cs4210/proj1/docs/Project1.pdf
Normal file
BIN
CS4210/cs4210/proj1/docs/Project1.pdf
Normal file
Binary file not shown.
BIN
CS4210/cs4210/proj1/docs/report.pdf
Normal file
BIN
CS4210/cs4210/proj1/docs/report.pdf
Normal file
Binary file not shown.
55
CS4210/cs4210/proj1/docs/report.txt
Normal file
55
CS4210/cs4210/proj1/docs/report.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
Project 1: Building a Rudimentary Web Server
|
||||
============================================
|
||||
|
||||
Vladimir Urazov
|
||||
Omar Zakaria
|
||||
============================================
|
||||
|
||||
|
||||
|
||||
1. Building the sources
|
||||
|
||||
The source code for the project is broken up into three directories:
|
||||
|
||||
common - this directory contains the code common to both the client and the server, such as some of the networking functionality, the multi-thread-safe list data structure, etc. This directory contains its own makefile, which builds a static library name libcommon.a from all of the source files. This library can then be included in the build of the server and the client to provide the necessary functionality.
|
||||
|
||||
server - this directory contains the http server code. Unlike the common library, it actually builds into an executable. The make file in the server can be used to build it (provided the common library has already been built).
|
||||
|
||||
client - this directory contains the code for the testing client, used to do performance and robustness tests on the server. It also builds into an executable with the make file, but assumes that the common library has already been built.
|
||||
|
||||
The simplest way to go about building the entire project is by typing 'make' in the root directory of the project. That will create a 'bin' folder there and will build all the components of the project into it. Hence, once the make process completes, the directory will contain the following files: client, libcommon.a, server. The client and the server can the be immediately run.
|
||||
|
||||
|
||||
|
||||
2. Running the Executales
|
||||
|
||||
The project build process creates two executables: server and client.
|
||||
|
||||
The server is the HTTP server. It supports the following command-line parameters:
|
||||
|
||||
port - the port that the server will listen for connections on. The default value for port is 1337.
|
||||
|
||||
pool-size - the number of threads to create to handle client requests. The default value is 16. Note that due to per-user constraints Linux imposes on the number of available threads, the server will fail creating enough worker threads if this parameter is set too high.
|
||||
|
||||
home - the path to the root document directory, relative to the directory from which we are starting the server. All the documents will be served relative to the home directory.
|
||||
|
||||
So, for example, if we are in the root directory of the project, after running make, we can start the server as follows:
|
||||
|
||||
bin/server port=80 pool-size=32 home=./home
|
||||
|
||||
(Note there shouldn't be spaces between the name of the parameter and the parameter values).
|
||||
|
||||
Note that the server has certain security restrictions, for instance it will not allow clients to go up the directory hierarchy, and also if will respond with forbidden HTTP status, if the user running the server has no permissions reading the requested file.
|
||||
|
||||
|
||||
The client executable is the testing client used for exercising the server. In order to run, it requires a url file, which is basically a plain text file with URLs that the client will request from the server. These URLs can have either host names or dotted IP addresses with them - the client can handle both kinds of URLs. The client supports the following options:
|
||||
|
||||
job-count - the number of requests to make to the server. The default value is 1. Note that this is the total number of requests to be made, and this will cycle through the URLs in the URL file. So, for example, suppose this parameter is set to 100, and the URL file contains two URLs, then each URL will be requested 50 times.
|
||||
|
||||
thread-count - the number of threads to spawn to make requests to the server at the same time. Note that these threads will handle as many requests as the job-count specifies, so, for example, if teh job count is 100, and thread-count is 10, then likely each thread will make 10 requests to the server (though that's not necessarily the case, since for example if one of the workers is taking a long time to receive the response from the server, then the others will pick up the slack).
|
||||
|
||||
url-file - the name of the file that contains the URLs to request. If no value is provided for this parameter, then the URLs will be read from the console.
|
||||
|
||||
So, if we have built the project from the root directory of the project, we can run the client as follows:
|
||||
|
||||
bin/client job-count=1000 thread-count=32 < urlfile
|
||||
Reference in New Issue
Block a user