Fuqing Wang, Jian Ma, Jun Li, Tian Chen
Note: Please check the IP address for each node before configuration. For example, if the IP address for
cache
node is10.10.1.1
, so you need to replace all10.10.1.2
with10.10.1.1
for any involved configuration below.Here we assume you are familiar with basic Linux commands, and know how to login to GENI nodes using
ssh
.
1.1 Proxy (cache) server (Apache Traffic Server 7.1.2)
-
Install ATS (Install from source code is preferred, see here, note that the trafficserver commands & configurations will be under directory
/opt/ts/
)sudo apt-get update && sudo apt-get install trafficserver
-
Fix bug if you install ATS from apt-get (reference)
sudo mkdir /var/run/trafficserver sudo chown -R trafficserver:trafficserver /var/run/trafficserver
-
Create Mapping Rules for HTTP Requests
sudo vim /etc/trafficserver/remap.config
Then add a mapping rule (in order to set ATS as a reversed proxy):
map http://10.10.1.2:8080/ http://10.10.2.2:80/
Note: Please check if the IP address of cache node is
10.10.1.2
. If its10.10.1.1
, replace10.10.1.2
above with10.10.1.1
-
Configure ATS to accept all request for caching:
sudo vim /etc/trafficserver/records.config
Modify the following line (cache all objects no matter what the request header is):
CONFIG proxy.config.http.cache.required_headers INT 0
Then save and quit vim using
:wq
. -
Filter URL for objects that are not to be cached
sudo vim /etc/trafficserver/cache.config
Add rule: (this rule means any object from any host with suffix
nocache
will never be cached by ATS)dest_domain=. suffix=nocache action=never-cache
-
Then reload configuration and restart ATS:
sudo traffic_ctl config reload sudo traffic_ctl server restart
-
Set link delay
sudo tc qdisc add dev eth1 root netem delay 10ms
1.2 Server (Apache2 Web Server 2.4.29)
-
Install Apache2
sudo apt-get update && sudo apt-get install apache2
-
[Optional] Configure static file path in VirtualHost setting file (here you can set another folder as static folder instead of
users/[your_path]/
)sudo vim /etc/apache2/sites-available/000-default.conf
Add the following lines:
Alias /static/ /users/[your_path]/ <Directory /users/[your_path]/> Require all granted </Directory>
Then restart apache2 web server:
sudo service apache2 restart
You can skip this step, then all the file to be delivered should be under
/var/www/html/
-
Set link delay
sudo tc qdisc add dev eth1 root netem delay 100ms
-
Generate file for experiments
wget pcvm1-19.genirack.nyu.edu/static/generateFile.sh sudo bash generateFile.sh
This step will download a script called
generateFile.sh
. Two folders -cache/
andnocache/
will be created with 20 files of size from 5MB to 100MB generated.
-
Install pip3
sudo add-apt-repository universe sudo apt-get update && sudo apt-get install python3-pip
-
Install matplotlib using pip3
sudo pip3 install matplotlib
Library 'matplotlib' will be used to plot line charts.
-
Login to
client
node, and direct to the folder you want to execute you experiments (e.g./users/[your_Path]/
). -
Retrieve codes for experiments using
wget
:wget pcvm1-19.genirack.nyu.edu/static/experiments/exp1_timeWithCache.py wget pcvm1-19.genirack.nyu.edu/static/experiments/exp1_timeWithoutCache.py wget pcvm1-19.genirack.nyu.edu/static/experiments/exp1_plot.py wget pcvm1-19.genirack.nyu.edu/static/experiments/exp2_hitrate.py wget pcvm1-19.genirack.nyu.edu/static/experiments/exp2_plot.py
Note: Please check the IP address for 'cache' node. If the IP address for
cache
node is10.10.1.1
, so you need to replace all10.10.1.2
with10.10.1.1
for any involved experiment code retrieved above.
-
Login to
cache
node -
Check status
sudo /etc/init.d/trafficserver status
Now there are no cached object in proxy server, we can run this:
python3 exp1_timeWithoutCache.py
The result will be written into ./result/timeWithoutCache.txt
, each line is a pair of file size and latency (in seconds), separated by a 'tab'.
Then to measure latencies to retrieve files with cache:
python3 exp1_timeWithCache.py
Similarly, the result will be recorded as ./result/timeWithCache.txt
.
Eventually we can get the plot of cache vs no-cache by:
python3 exp1_plot.py
The plot will be generated as ./result/exp1.png
Our plot look like this:
First to get the average latency for a file of fixed size as a function of hit rate, execute the following command:
# example: python3 exp2_hitrate.py -l 100 -s 10
python3 exp2_hitrate.py -l [loop times] -s [file size]
The result will be recorded as ./result/latency_hitrate_[file size].txt
.
Then to get a plot of latency as a function of hit rate, run the following command:
python3 exp2_plot.py -s [file size]
Note:
[file size]
here should be same as the value when you runexp2_hitrate.py
.
The plot will be generated as ./result/exp2_[file szie]MB.png
Our plot look like this: