Part 2, Exercise 2. Setup Cache
Server
- In apache 2.2, the cached directory contain two files: one with header and one with data (to be delivered to the client). It is more faster to extract the modified date by reading a shorter header file and it is easier to read the document (the .data file) and attache the proper header to the client. In apache 1.3, the caching info and the content are saved in the same file.
For example, http://cs.uccs.edu/~cs591/apache/proxy/cache/P3B/TV@/rwE/
- Question 2.1. Why
we put cached documents in directories of different levels as opposed to
put them all in a single cache directory?
Ans: By organizing cached document in directories
of different level, each file search operation in a directory level will
be quicker. For a proxy server with large set of cached documents, the file
search will be much faster on average compared with puting all cached document
in a single directory.
- Question 2.2. Why
the cached document is saved with a file name generated by applying hash
on the url?
Ans: Without using the hash of the url as the file
name. Since all urls will start with http://<domain name>/,
The first cache level directory will contain the same directory name, e.g.,
for CacheDirLevels=2, only directory with "ht" will be there.
- Question 2.3. One
of the HTTP headers in the cached document file is the last modified. How
the cache server uses the value of this header? (Hint: http://cs.uccs.edu/~cs522/hw/hwF2004/hw.htm#hw1 exercise 2.4; http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13).
Ans: The proxy server will extract the modified date
and create a If-Modified-Since header to be appended in the relayed http
request sent to the original web site. If the returned http response is
304 (not modified), then the cached document is returned to the web browser.
Note that for the response with code 304, the original web site does not
have to send the content of the document. Therefore it is much faster. Normally,
the route between proxy server and the original web site goes through Internet
with much smaller bandwidth than the route between the proxy server and
the local web browser (local connection much faster).
Exercise 4. Evaluate Web Server Performance
using httperf.
- The web server performance was included in the following excel spread sheet. hw1/benchmark.xls
It consists of multiple
runs per web system configuration.
- Based on your benchmark
results, rank the performance of those five web servers and discuss
- Question 4.1 Why there is such
a difference between run1 (your customized apache web server) and run2
(crestone cluster)
Ans: In run1, the browser has a direct access to the
web server, while in run2, the crestone reverse proxy server ill relay the
request to blanca and then relay the response back to the sanluis. It incurs
much more protocol and server processing. Therefore run1 is much faster than
run2.
- Question 4.2 Why there is such
a difference between run1 (your customized apache web server) and run3 (blanca default apache web server)
Ans: run1 was configured with single process (-X option),
while run3 was configured to allow apache web server to prefork with several
spare child processes and to create additional child process if the load increases.
With the concurrent processing of multiple submitted requests, the run3 achieves
much faster performance.