This shows you the differences between two versions of the page.
saisp:labs:09:contents:08 [2014/05/05 15:20] razvan.deaconescu |
saisp:labs:09:contents:08 [2014/05/05 15:43] (current) razvan.deaconescu |
||
---|---|---|---|
Line 49: | Line 49: | ||
} | } | ||
[...] | [...] | ||
+ | </code> | ||
+ | Creăm directorul pentru cache:<code> | ||
+ | root@varnish:~# mkdir -p /var/www/cache/tmp | ||
</code> | </code> | ||
Apoi repornim serviciul Nginx:<code> | Apoi repornim serviciul Nginx:<code> | ||
- | TODO | + | root@varnish:~# service nginx restart |
+ | </code> | ||
+ | |||
+ | Apoi accesăm, de pe sistemul gazdă (''mjolnir''), URL-ul http://192.168.0.3/ sau http://192.168.0.3/data/. Serverul Nginx acționează acum ca un reverse proxy și cache. Urmărim în directorul de cache informațiile cache-uite:<code bash> | ||
+ | root@varnish:~# ls -R /var/www/cache/ | ||
+ | /var/www/cache/: | ||
+ | c tmp | ||
+ | |||
+ | /var/www/cache/c: | ||
+ | 01 | ||
+ | |||
+ | /var/www/cache/c/01: | ||
+ | 66c779a629e4b1fee8a183dbdc9ab01c | ||
+ | |||
+ | /var/www/cache/tmp: | ||
+ | </code> | ||
+ | |||
+ | Ca să comparăm Nginx cu Varnish folosim ''httperf'':<code bash> | ||
+ | student@mjolnir:~$ httperf --server=192.168.0.3 --wsess=2000,10,2 --rate 300 --timeout 5 | ||
+ | [...] | ||
+ | student@mjolnir:~$ httperf --server=192.168.0.3 --port=8080 --wsess=2000,10,2 --rate 300 --timeout 5 | ||
</code> | </code> | ||
</solution> | </solution> |