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

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
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.
 
==Install==
===Emerge===
 
Install {{Package|www-servers/varnish}}:
<console>###i## emerge www-servers/varnish</console>


== Determine Hardware ==
==Configuration==
first determine which video card you have and which driver it requires.


<console>###i## lspci -k</console>
Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd


=== Intel ===
{{file|name=/etc/varnish/default.vcl|desc=varnish configuration file|body=
gen 1&2:
vcl 4.0;
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
backend default {
VIDEO_CARDS="intel"
    .host = "127.0.0.1";
    .port = "8080";
}
}}
}}
gen 3
 
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
{{file|name=/etc/conf.d/varnishd|desc=varnish configuration file|body=
VIDEO_CARDS="intel i915"
VARNISHD="/usr/sbin/varnishd"
}}
VARNISHADM="/usr/bin/varnishadm"
gen 4+
CONFIGFILE="/etc/varnish/default.vcl"
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
VARNISHD_OPTS="-a 127.0.0.1:80"
VIDEO_CARDS="intel i965"
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
}}
}}


=== Ati ===
Varnish will fetch data from localhost:8080 and serve accelerated proxy data on localhost:80
Open source drivers:
 
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
== BootService ==
VIDEO_CARDS="radeon"
}}


Closed source drivers:
To start varnish immediately:
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
<console>###i## rc-service varnishd start</console>
VIDEO_CARDS="fglrx"
}}


==== Hybrid ====
To start varnish at boot:
Hybrid intel/ati:
<console>###i## rc-update add varnishd default</console>
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
VIDEO_CARDS="fglrx intel"
}}


<console># ##i##aticonfig --initial --input=/etc/X11/xorg.conf</console>
== Verification ==
To verify that your traffic is going through varnish.
<console>$##i## curl -I https://www.varnish-cache.org/</console>


=== Nvidia ===
== Benchmarking ==
Open source drivers:
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.
{{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"
}}




===Other===
ab against a 3 worker cluster mode puma server
These settings are used by Parallels VM's and presumably others
<console>###i## ab -n 500 -c 100 http://127.0.0.1:3000/index.html | grep Request</console>
{{file|name=/etc/portage/make.conf|lang=|desc=set video global variable|body=
Requests per second:    110.92 [#/sec] (mean)
VIDEO_CARDS="vesa vga"
}}


== 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

Varnish

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


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 www-servers/varnish:

root # 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:

root # rc-service varnishd start

To start varnish at boot:

root # rc-update add varnishd default

Verification

To verify that your traffic is going through varnish.

user $ 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

root # 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

root # 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:

  • No results
  • No results

Media