This shows you the differences between two versions of the page.
|
scgc:laboratoare:06 [2020/11/18 18:40] darius.mihai [9. [BONUS - 20p] Load balancing in Varnish] Update varnish load balance link |
scgc:laboratoare:06 [2021/10/27 14:08] (current) maria.mihailescu |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Laboratory 06. Load balancing and web acceleration ====== | + | ====== Load balancing and web acceleration ====== |
| ===== Lab Setup ===== | ===== Lab Setup ===== | ||
| - | * We will be using a virtual machine in the [[http://cloud.curs.pub.ro/|faculty's cloud]]. | + | * We will be using a virtual machine in the [[http://cloud.grid.pub.ro/|faculty's cloud]]. |
| - | * When creating a virtual machine follow the steps in this [[https://cloud.curs.pub.ro/about/tutorial-for-students/|tutorial]]. | + | |
| * When creating a virtual machine in the Launch Instance window: | * When creating a virtual machine in the Launch Instance window: | ||
| * Select **Boot from image** in **Instance Boot Source** section | * Select **Boot from image** in **Instance Boot Source** section | ||
| Line 97: | Line 96: | ||
| Using Wireshark (or tcpdump), start a capture on the br0 interface on the client machine. | Using Wireshark (or tcpdump), start a capture on the br0 interface on the client machine. | ||
| <code> | <code> | ||
| - | student@scgc:~$ sudo tcpdump -i br0 | + | student@scgc:~$ sudo tcpdump -i br0 -e |
| </code> | </code> | ||
| Notice the IP and MAC addresses from: | Notice the IP and MAC addresses from: | ||
| Line 299: | Line 298: | ||
| </code> | </code> | ||
| - | We will also need to change the DocumentRoot of the Apache server on ''scgc-vm-2''. For this, edit''/etc/apache2/sites-available/000-default.conf'' and change the DocumentRoot from ''/var/www/html'' to ''/var/www''. | + | We will also need to change the DocumentRoot of the Apache server on ''scgc-vm-2''. For this, edit''/etc/apache2/sites-available/000-default.conf'' and change the DocumentRoot from ''/var/www/html'' to ''/var/www''. Restart the ''apache2'' service. |
| In order to measure the duration of the data transfer with and without Varnish, use ''httperf'' on the host machine in order to download the following file: http://10.0.0.20/data/10M.dat for direct access or http://10.0.0.10/data/10M.dat for Varnish access. | In order to measure the duration of the data transfer with and without Varnish, use ''httperf'' on the host machine in order to download the following file: http://10.0.0.20/data/10M.dat for direct access or http://10.0.0.10/data/10M.dat for Varnish access. | ||
| Line 305: | Line 304: | ||
| While ''httperf'' is running, check with ''htop'' the load on both virtual machines. | While ''httperf'' is running, check with ''htop'' the load on both virtual machines. | ||
| - | Use the ''--uri'' option for ''httperf'' to specify what page is to be accessed (in our case http://10.0.0.20/data/10M.dat). Notice the difference between the Request rate parameter for the direct access and the Varnish access. | + | Use the ''%%--%%uri'' option for ''httperf'' to specify what page is to be accessed (in our case http://10.0.0.20/data/10M.dat). Notice the difference between the Request rate parameter for the direct access and the Varnish access. |
| ==== 5. [10p] Varnish statistics ==== | ==== 5. [10p] Varnish statistics ==== | ||