What to do?
-----------

Step 1: Make prefetch content
-----------------------------

Create prefetch content. Change to pref-munger directory. Invoke the recurse.pl script as follows

perl recurse.pl <demand_server_name> <prefetch_server_name> <directory_of_demand_content> <absolute_path_of_present_directory>

This invocation creates a directory of prefetch content in prefetchservername/ based on the demand content present in the directory_of_demand_content. Move this directory such that it is accessible to the prefetch server.



Step 2: Install frontend
------------------------

In this configuration, the frontend is set as a reverse proxy in front
of the demand server. The demand server can thus be left
unmodified. The content is munged online when a client requests for
the content. The DemMunger.java file can be used to munge the content
offline so that the demand server can serve munged content directly,
thus improving performance.

$ cd to frontend/apache-2.0.39

$ ./myconfig <install_directory>

This command should install the frontend Apache in the install_directory.


$ cd to frontend/dem-munger/

$ javac DemMunger.java

3. In the config file httpd.conf created in install_directory/conf,
add the file httpd.conf.add, after modifying the directory names
appropriately.  For example, change to contain correct path of
DemMunger. Change javapath to the correct path on your frontend machine.

In the install directory, bin/apachectl should start the frontend.


Step 3: Demand and prefetch servers
-----------------------------------

The demand and prefetch servers can be unmodified Apache servers. Just ensure that the right content is picked up by the demand and prefetch servers.

Step 4: Hint Server
-------------------

1. Prepare a prediction file based on a trace.

For example: cat access_feb191998 | java -Xmx200MB MarkovPrefetchPredictor -mode gen -client ALL -server ALL -traceFormat olympic -prefThresh 0.00001 -prefetchStateFile olympic.pred -maxWindow 30 -maxHistory 1

The above command generates a prediction file olympic.pred using the markov prefetch predictor, with all the objects that have non-zero probabilities of access. This file is given as input to the hint server when it is started.

2.  (optional) Check the prediction accuracy.

cat access_feb191998 | java -Xmx200MB MarkovPrefetchPredictor -mode check -client ALL -server ALL -traceFormat olympic -prefetchStateFile olympic.pred

The above command tells you the maximum amount of hit rate you would get if the prediction file olympic.pred is used for prefetching and prefetching takes zero time (infinitely fast prefetching). This command just helps you to check how good the prediction can be. Check the help for more options.


3.

$ java HintServer --help gives you help to use the HintServer.
  
$For monitoring, you should provide the following

      * Demand Server address and port number
      * file name of the representative object to monitor (say index.html)
      * sleeptime: The value of threshold probe time interval in milliseconds.
      * prefetch state file - olympic.pred, generated in 1. This file is a java Hashtable that maps a URL to a set of URLs and their access probabilities
      * docMap File: simple text file that maps a document name to the
                     embedded file names		

example: java  -Xmx200MB HintServer --demserver <demand server name> --demport 8083 --maxpflistsize 1500 --filename <representative object> --sleeptime 100 --clientid  --prefetchStateFile olympic.pred --maxTurnValue 1500 --maxFilesPerTurn $MaxFiles"


----------------------------------------------------------------------

If things are not clear, or if you have any comments, please send us a
mail at {rkoku, ypraveen}@cs.utexas.edu. Your comments will help
us improve the README.

----------------------------------------------------------------------