Difference between pages "Video" and "Package:Varnish"

(Difference between pages)
(Determine Hardware)
 
m (add a lecture, and remove missing categories.)
 
Line 1: Line 1:
Video is set up by setting global variables in [[make.conf]] & portage takes care of the rest.
+
{{Ebuild
 +
|Summary=Varnish is a state-of-the-art, high-performance HTTP accelerator
 +
|CatPkg=www-servers/varnish
 +
|Maintainer=
 +
}}
 +
__TOC__
 +
'''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.
  
== Determine Hardware ==
+
==Install==
first determine which video card you have and which driver it requires.
+
===Emerge===
  
<console>###i## lspci -k</console>
+
Install {{Package|www-servers/varnish}}:
 +
<console>###i## emerge www-servers/varnish</console>
  
=== Intel ===
+
==Configuration==
gen 1&2:
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="intel"
+
}}
+
gen 3
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="intel i915"
+
}}
+
gen 4+
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="intel i965"
+
}}
+
  
=== Ati ===
+
Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd
Open source drivers:
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="radeon"
+
}}
+
  
Closed source drivers:
+
{{file|name=/etc/varnish/default.vcl|desc=varnish configuration file|body=
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
vcl 4.0;
VIDEO_CARDS="fglrx"
+
backend default {
 +
    .host = "127.0.0.1";
 +
    .port = "8080";
 +
}
 
}}
 
}}
  
==== Hybrid ====
+
{{file|name=/etc/conf.d/varnishd|desc=varnish configuration file|body=
Hybrid intel/ati:
+
VARNISHD="/usr/sbin/varnishd"
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VARNISHADM="/usr/bin/varnishadm"
VIDEO_CARDS="fglrx intel"
+
CONFIGFILE="/etc/varnish/default.vcl"
 +
VARNISHD_OPTS="-a 127.0.0.1:80"
 +
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
 
}}
 
}}
  
<console># ##i##aticonfig --initial --input=/etc/X11/xorg.conf</console>
+
Varnish will fetch data from localhost:8080 and serve accelerated proxy data on localhost:80
  
=== Nvidia ===
+
== BootService ==
Open source drivers:
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="nouveau"
+
}}
+
Closed source [[Package:NVIDIA_Linux_Display_Drivers | drivers]]:
+
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
VIDEO_CARDS="nvidia"
+
}}
+
  
 +
To start varnish immediately:
 +
<console>###i## rc-service varnishd start</console>
  
===Other===
+
To start varnish at boot:
These settings are used by Parallels VM's and presumably others
+
<console>###i## rc-update add varnishd default</console>
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
+
 
  VIDEO_CARDS="vesa vga"
+
== Verification ==
}}
+
To verify that your traffic is going through varnish.
 +
<console>$##i## curl -I https://www.varnish-cache.org/</console>
 +
 
 +
== Benchmarking ==
 +
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
 +
<console>###i## ab -n 500 -c 100 http://127.0.0.1:3000/index.html | grep Request</console>
 +
Requests per second:    110.92 [#/sec] (mean)
  
== Install ==
 
once your video cards variable is set in make.conf merge changes into your system
 
  
<console>###i## emerge -avuND world</console>
+
ab against the same server served through varnish
 +
<console>###i## ab -n 500 -c 100 http://127.0.0.1/index.html | grep Request</console>
 +
Requests per second:    10268.42 [#/sec] (mean)
  
=== Select Driver ===
+
== SSL support ==
 +
Varnish does not support ssl.  There are packages to get around this limitation:
 +
* {{package|stunnel}}
 +
* {{package|pound}}
  
{{note|change the number of card eselected to match the card of your system}}
+
== Media ==
<console>###i## eselect opengl list
+
{{#widget:YouTube16x9|id=JEF6_XC-2ZU}}
###i## eselect opengl set 1</console>
+
  
{{note|some setups can make use of opencl}}
+
{{EbuildFooter}}
<console>###i##eselect opencl list
+
###i##eselect opencl set 1</console>
+

Revision as of 21:54, November 3, 2014

www-servers/varnish


Source Repository:Gentoo Portage Tree

Summary: Varnish is a state-of-the-art, high-performance HTTP accelerator

Use Flags

tools
Build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes
jemalloc
Use dev-libs/jemalloc for allocations

Varnish

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.

Install

Emerge

Install Varnish:

# emerge www-servers/varnish

Configuration

Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd

/etc/varnish/default.vcl: varnish configuration file
vcl 4.0;
backend default {
    .host = "127.0.0.1";
    .port = "8080";
}
/etc/conf.d/varnishd: varnish configuration file
VARNISHD="/usr/sbin/varnishd"
VARNISHADM="/usr/bin/varnishadm"
CONFIGFILE="/etc/varnish/default.vcl"
VARNISHD_OPTS="-a 127.0.0.1:80"
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"

Varnish will fetch data from localhost:8080 and serve accelerated proxy data on localhost:80

BootService

To start varnish immediately:

# rc-service varnishd start

To start varnish at boot:

# rc-update add varnishd default

Verification

To verify that your traffic is going through varnish.

$ curl -I https://www.varnish-cache.org/

Benchmarking

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)

SSL support

Varnish does not support ssl. There are packages to get around this limitation:

Media