|Source Repository:||Gentoo Portage Tree|
Summary: Varnish is a state-of-the-art, high-performance HTTP accelerator
Varnish is a webcache & http accelerator. Varnish will either serve cached content, or retireve content from the server, and cache it. Varnish will reduce I/O pressure from webservers.
Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd
Varnish will fetch data from localhost:8080 and serve accelerated proxy data on localhost:80
To start varnish immediately:
# rc-service varnishd start
To start varnish at boot:
# rc-update add varnishd default
To verify that your traffic is going through varnish.
$ curl -I https://www.varnish-cache.org/
If your system has apache installed apache benchmark can show the power of varnish. The examples shown are running 500 requests with concurrency of 100 hits.
ab against a 3 worker cluster mode puma server
# ab -n 500 -c 100 http://127.0.0.1:3000/index.html | grep Request
Requests per second: 110.92 [#/sec] (mean)
ab against the same server served through varnish
# ab -n 500 -c 100 http://127.0.0.1/index.html | grep Request
Requests per second: 10268.42 [#/sec] (mean)