Difference between revisions of "Package:Varnish"
Latest revision as of 09:14, January 1, 2015
|Source Repository:||Gentoo Portage Tree|
Summary: Varnish is a state-of-the-art, high-performance HTTP accelerator
- Build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes
- Use dev-libs/jemalloc for allocations
RSS/Atom SupportYou can now follow this news feed at http://www.funtoo.org/news/atom.xml .
Creating a Friendly Funtoo CultureThis news item details some recent steps that have been taken to help ensure that Funtoo is a friendly and welcoming place for our users.
CPU FLAGS X86CPU_FLAGS_X86 are being introduced to group together USE flags managing CPU instruction sets.
Varnish is a Web cache and HTTP accelerator. Varnish will either serve cached content, or retrieve content from the server, and cache it. Varnish cache will reduce I/O pressure on Web servers.
# emerge www-servers/varnish
as your varnish is local to your server, your server needs to be aware that it is behind a proxy, and configured for x-forwarded-for or similar to fetch real users IP addresses instead of displaying 127.0.0.1 or localhost.
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
For 10,000 concurrent connections -- or not -- a few configuration settings control the power of varnish. If you're having varnish directly serve to the outside world, dial back concurrency to say 50 or 100 connections per IP. You must take into account corporations and universities hammering several connections from a singular IP. c10k is useful information for if varnish is behind a load balancer such as pound, nginx, or tengine, and all requests are internal and local.
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, and see if you're getting hits or misses:
$ curl -I http://www.funtoo.org/Welcome
Apache-tools apache benchmark can show the power of varnish. The examples shown are running 500 requests with concurrency of 100 hits.
- Example 1
- 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)
- Example 2
- 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)
Varnish does not support ssl. There are packages to get around this limitation:
- net-misc/stunnel (package not on wiki - please add)
- www-servers/pound (package not on wiki - please add)