Difference between pages "Package:Awesome (Window Manager)" and "Package:Varnish"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
(Started "Getting Started" section)
 
(add apache benchmarking)
 
Line 1: Line 1:
{{Ebuild
{{Ebuild
|Summary=A dynamic floating and tiling window manager.
|Summary=Varnish is a state-of-the-art, high-performance HTTP accelerator
|CatPkg=x11-wm/awesome
|CatPkg=www-servers/varnish
|Maintainer=
|Maintainer=
|Homepage=http://awesome.naquadah.org/
}}
}}
__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.


== About Awesome ==
==Install==
===Emerge===


Awesome is a highly configurable window manager distributed under GPL-2 license. It handles both '''tiling and floating''' layouts. You can go into a '''fine-grained customization''' to suit your needs with '''Lua scripting'''. As a window manager, awesome is an ideal choice if you plan to ''get rid of your mouse''.
Install {{Package|www-servers/varnish}}
<console>###i## www-servers/varnish</console>


=== Vocabulary ===
==Configuration==


;Screen: A physical monitor plugged into your computer.
Configuration is controlled by /etc/varnish/default.vcl & /etc/conf.d/varnishd
;Client: A window.
;Tag: A tag is something like a workspace or a desktop that you may find in other window managers. However, it is slightly more flexible as you can attach a ''client'' to multiple tags. Moreover, each ''screen'' has its own range of tags.
;Layout: A layout is a way to arrange your ''clients'' in the current tag (eg. floating, horizontaly tiled, verticaly tiled, focused client full-screen, ...)
;Widget: A widget is a box that can contain text, images or more advanced objects. It enables you to add pieces of information in the status bar (at the top-right of each ''screen'') such as the time, the volume level or your battery load. You can also add widgets in the title bar of a ''client''.


== USE flags ==
{{file|name=/etc/varnish/default.vcl|desc=varnish configuration file|body=
vcl 4.0;
backend default {
    .host = "127.0.0.1";
    .port = "8080";
}
}}


{| class="wikitable"
{{file|name=/etc/conf.d/varnishd|desc=varnish configuration file|body=
|-
VARNISHD="/usr/sbin/varnishd"
! Name !! Description
VARNISHADM="/usr/bin/varnishadm"
|-
CONFIGFILE="/etc/varnish/default.vcl"
| dbus || Enables awesome to receive signals from dbus (eg. to trigger events on hotplug)
VARNISHD_OPTS="-a 127.0.0.1:80"
|-
VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
| doc || Includes extra HTML documentation (using doxygen)
}}
|-
| gnome || Enables you to use awesome as gnome's window manager (See. [http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome Quickly Setting up Awesome with Gnome])
|}
 
== Installation ==


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


<console>
== BootService ==
###i## emerge -a awesome
</console>


Then you can add this line to your <code>~/.xinitrc</code>:
To start varnish immediately:
<console>###i## rc-service varnishd start</console>


{{file|name=~/.xinitrc|body=
To start varnish at boot:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome
<console>###i## rc-update add varnishd default</console>
}}


And run <code>xinit</code> to launch awesome. You can also configure a display manager instead, but this is not covered in this document.
== Verification ==
To verify that your traffic is going through varnish.
<console>$##i## curl -I https://www.varnish-cache.org/</console>


== Getting Started ==
== 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.


So, you should see a nice awesome background and a top bar which includes your tags on the left (from 1 to 9), the status bar (containing a clock widget) on the right and, on the very left, an icon representing the current layout.


You can switch against tags by typing <code>Mod4 + [1..9]</code> or <code>Mod4 + Left/Right</code>. Where Mod4 is the "Super" key and [1..9] any digit from 1 to 9. Mod4 is the default modifier for awesome key bindings, yet you can configure another one (See [[#Configuration Configuration]]).
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)


== Configuration ==


Awesome user configuration files are located in <code>~/.config/awesome/</code>. For now, a single file called <code>rc.lua</code> should lie in this directory. It contains the default configuration (including widgets, tags, key bindings, ...). Note that if you don't know Lua, you can still proceed some customization. As far as I'm concerned, I only had to learn Lua basics when I started to create my own widgets.
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)


{{fancynote|A quick introduction to awesome configuration will be described here soon.}}
[[Category:Server]]
[[Category:Daemons]]


{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 19:24, August 23, 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 # 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)