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

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
m (add some c10k garbage)
 
 
Line 1: Line 1:
{{Ebuild
{{Ebuild
|Summary=Varnish is a state-of-the-art, high-performance HTTP accelerator
|Summary=A small, dynamic tiling window manager for X11.
|CatPkg=www-servers/varnish
|CatPkg=x11-wm/spectrwm
|Maintainer=
|Maintainer=
|Homepage=https://opensource.conformal.com/wiki/spectrwm
}}
}}
__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==
{{Note|Spectrwm was previously known as Scrotwm.}}
===Emerge===


Install {{Package|www-servers/varnish}}:
==== Introduction ====
<console>###i## emerge www-servers/varnish</console>
From their page:
spectrwm is a small dynamic tiling window manager for X11. It tries to stay out of the way so that valuable screen real estate can be used for much more important stuff. It has sane defaults and does not require one to learn a language to do any configuration. It was written by hackers for hackers and it strives to be small, compact and fast.


==Configuration==


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


{{file|name=/etc/varnish/default.vcl|desc=varnish configuration file|body=
==== Installation ====
vcl 4.0;
<console>
backend default {
# ##i##emerge x11-wm/spectrwm
    .host = "127.0.0.1";
</console>
    .port = "8080";
Xlockmore is also needed
}
<console>
}}
# ##i##emerge x11-misc/xlockmore
 
</console>
{{file|name=/etc/conf.d/varnishd|desc=varnish configuration file|body=
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
 
=== c10k ===
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.
 
{{file|name=/etc/conf.d/varnishd|desc=varnish concurrency settings|body=
VARNISHD_OPTS="-a 127.0.0.1:80 -p thread_pool_min=20 -p thread_pool_max=1000 -p thread_pool_add_delay=2 -s malloc,700M"
}}
 
{{file|name=/etc/varnish/default.vcl|desc=varnish concurrency settings|body=
backend default {
    .host = "127.0.0.1";
    .port = "8080";
    .connect_timeout = 600s;
    .first_byte_timeout = 600s;
    .between_bytes_timeout = 600s;
    .max_connections = 10000;
    # .port = "80" led to issues with competing for the port with apache.
}
}}
 
== BootService ==
 
To start varnish immediately:
<console>###i## rc-service varnishd start</console>


To start varnish at boot:
<console>###i## rc-update add varnishd default</console>


== Verification ==
==== Setup ====
To verify that your traffic is going through varnish.
===== xinitrc =====
<console>$##i## curl -I https://www.varnish-cache.org/</console>
Edit ~/.xinitrc:
<pre>
exec spectrwm
</pre>
Copy /etc/spectrwm.conf to your home dir as an hidden file.
<console>
$ ##i## cp /etc/spectrwm.conf ~/.spectrwm.conf
</console>
You can edit spectrwm.conf to suit your needs. The file is thoroughly commented so you won't feel lost.


== Benchmarking ==
==== Bindings (default) ====
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.
{{Note|Usually the M (Modus) key is either alt or the super key.}}
From the man page:


BINDINGS


ab against a 3 worker cluster mode puma server
    spectrwm provides many functions (or actions) accessed via key or mouse
<console>###i## ab -n 500 -c 100 http://127.0.0.1:3000/index.html | grep Request</console>
    bindings.
Requests per second:    110.92 [#/sec] (mean)


    The current mouse bindings are described below:
{| class="wikitable sortable"
|-
! Mouse binding  !! description
|-
| M1 || Focus window
|-
| M-M1 || Move window
|-
| M-M3|| Resize window
|-
| M-S-M3|| Resize window while maintaining it centered
|}                     


ab against the same server served through varnish
    The default key bindings are described below:
<console>###i## ab -n 500 -c 100 http://127.0.0.1/index.html | grep Request</console>
Requests per second:    10268.42 [#/sec] (mean)


== SSL support ==
          M-S-<Return>        term
Varnish does not support ssl.  There are packages to get around this limitation:
          M-p                menu
* {{package|stunnel}}
          M-S-q              quit
* {{package|pound}}
          M-q                restart
          M-<Space>          cycle_layout
          M-S-<\>            flip_layout
          M-S-<Space>        stack_reset
          M-h                master_shrink
          M-l                master_grow
          M-,                master_add
          M-.                master_del
          M-S-,              stack_inc
          M-S-.              stack_dec
          M-<Return>          swap_main
          M-j, M-<TAB>        focus_next
          M-k, M-S-<TAB>      focus_prev
          M-m                focus_main
          M-S-j              swap_next
          M-S-k              swap_prev
          M-b                bar_toggle
          M-S-b              bar_toggle_ws
          M-x                wind_del
          M-S-x              wind_kill
          M-<1-9,0,F1-F12>    ws_<1-22>
          M-S-<1-9,0,F1-F12>  mvws_<1-22>
          M-<Keypad 1-9>      rg_<1-9>
          M-S-<Keypad 1-9>    mvrg_<1-9>
          M-<Right>          ws_next
          M-<Left>            ws_prev
          M-<Up>              ws_next_all
          M-<Down>            ws_prev_all
          M-a                ws_next_move
          M-S-<Left>          ws_prev_move
          M-S-<Up>            ws_prior
          M-S-<Right>        rg_next
          M-S-<Left>          rg_prev
          M-s                screenshot_all
          M-S-s              screenshot_wind
          M-S-v              version
          M-t                float_toggle
          M-S-<Delete>        lock
          M-S-i              initscr
          M-w                iconify
          M-S-w              uniconify
          M-S-r              always_raise
          M-v                button2
          M--                width_shrink
          M-=                 width_grow
          M-S--              height_shrink
          M-S-=               height_grow
          M-[                move_left
          M-]                move_right
          M-S-[              move_up
          M-S-]              move_down
          M-S-/              name_workspace
          M-/                search_workspace
          M-f                search_win


== Media ==
The action names and descriptions are listed below:
{{#widget:YouTube16x9|id=JEF6_XC-2ZU}}


          term              Spawn a new terminal (see PROGRAMS above).
          menu              Menu (see PROGRAMS above).
          quit              Quit spectrwm.
          restart          Restart spectrwm.
          cycle_layout      Cycle layout.
          flip_layout      Swap the master and stacking areas.
          stack_reset      Reset layout.
          master_shrink    Shrink master area.
          master_grow      Grow master area.
          master_add        Add windows to master area.
          master_del        Remove windows from master area.
          stack_inc        Add columns/rows to stacking area.
          stack_dec        Remove columns/rows from stacking area.
          swap_main        Move current window to master area.
          focus_next        Focus next window in workspace.
          focus_prev        Focus previous window in workspace.
          focus_main        Focus on main window in workspace.
          swap_next        Swap with next window in workspace.
          swap_prev        Swap with previous window in workspace.
          bar_toggle        Toggle overall visibility of status bars.
          bar_toggle_ws    Toggle status bar on current workspace.
          wind_del          Delete current window in workspace.
          wind_kill        Destroy current window in workspace.
          ws_n              Switch to workspace n, where n is 1 through
                            workspace_limit.
          mvws_n            Move current window to workspace n, where n is 1
                            through workspace_limit.
          rg_n              Focus on region n, where n is 1 through 9.
          mvrg_n            Move current window to region n, where n is 1
                            through 9.
          ws_next          Switch to next workspace with a window in it.
          ws_prev          Switch to previous workspace with a window in it.
          ws_next_all      Switch to next workspace.
          ws_prev_all      Switch to previous workspace.
          ws_next_move      Switch to next workspace with the current window.
          ws_prev_move      Switch to previous workspace with the current
                            window.
          ws_prior          Switch to last visited workspace.
          rg_next          Switch to next region.
          rg_prev          Switch to previous region.
          screenshot_all    Take screenshot of entire screen (if enabled)
                            (see PROGRAMS above).
          screenshot_wind  Take screenshot of selected window (if enabled)
                            (see PROGRAMS above).
          version          Toggle version in status bar.
          float_toggle      Toggle focused window between tiled and floating.
          lock              Lock screen (see PROGRAMS above).
          initscr          Reinitialize physical screens (see PROGRAMS
                            above).
          iconify          Minimize (unmap) currently focused window.
          uniconify        Maximize (map) window returned by dmenu
                            selection.
          always_raise      When set tiled windows are allowed to obscure
                            floating windows.
          button2          Fake a middle mouse button click (mouse button
                            2).
          width_shrink      Shrink the width of a floating window.
          width_grow        Grow the width of a floating window.
          height_shrink    Shrink the height of a floating window.
          height_grow      Grow the height of a floating window.
          move_left        Move a floating window a step to the left.
          move_right        Move a floating window a step to the right.
          move_up          Move a floating window a step upwards.
          move_down        Move a floating window a step downwards.
          name_workspace    Name the current workspace.
          search_workspace  Search for a workspace.
          search_win        Search the windows in the current workspace.
{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 02:54, November 17, 2014

Spectrwm

   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.


   Note

Spectrwm was previously known as Scrotwm.

Introduction

From their page: spectrwm is a small dynamic tiling window manager for X11. It tries to stay out of the way so that valuable screen real estate can be used for much more important stuff. It has sane defaults and does not require one to learn a language to do any configuration. It was written by hackers for hackers and it strives to be small, compact and fast.


Installation

root # emerge x11-wm/spectrwm 

Xlockmore is also needed

root # emerge x11-misc/xlockmore


Setup

xinitrc

Edit ~/.xinitrc:

exec spectrwm

Copy /etc/spectrwm.conf to your home dir as an hidden file.

 $  cp /etc/spectrwm.conf ~/.spectrwm.conf

You can edit spectrwm.conf to suit your needs. The file is thoroughly commented so you won't feel lost.

Bindings (default)

   Note

Usually the M (Modus) key is either alt or the super key.

From the man page:

BINDINGS

    spectrwm provides many functions (or actions) accessed via key or mouse
    bindings.
    The current mouse bindings are described below:
Mouse binding description
M1 Focus window
M-M1 Move window
M-M3 Resize window
M-S-M3 Resize window while maintaining it centered
    The default key bindings are described below:
          M-S-<Return>        term
          M-p                 menu
          M-S-q               quit
          M-q                 restart
          M-<Space>           cycle_layout
          M-S-<\>             flip_layout
          M-S-<Space>         stack_reset
          M-h                 master_shrink
          M-l                 master_grow
          M-,                 master_add
          M-.                 master_del
          M-S-,               stack_inc
          M-S-.               stack_dec
          M-<Return>          swap_main
          M-j, M-<TAB>        focus_next
          M-k, M-S-<TAB>      focus_prev
          M-m                 focus_main
          M-S-j               swap_next
          M-S-k               swap_prev
          M-b                 bar_toggle
          M-S-b               bar_toggle_ws
          M-x                 wind_del
          M-S-x               wind_kill
          M-<1-9,0,F1-F12>    ws_<1-22>
          M-S-<1-9,0,F1-F12>  mvws_<1-22>
          M-<Keypad 1-9>      rg_<1-9>
          M-S-<Keypad 1-9>    mvrg_<1-9>
          M-<Right>           ws_next
          M-<Left>            ws_prev
          M-<Up>              ws_next_all
          M-<Down>            ws_prev_all
          M-a                 ws_next_move
          M-S-<Left>          ws_prev_move
          M-S-<Up>            ws_prior
          M-S-<Right>         rg_next
          M-S-<Left>          rg_prev
          M-s                 screenshot_all
          M-S-s               screenshot_wind
          M-S-v               version
          M-t                 float_toggle
          M-S-<Delete>        lock
          M-S-i               initscr
          M-w                 iconify
          M-S-w               uniconify
          M-S-r               always_raise
          M-v                 button2
          M--                 width_shrink
          M-=                 width_grow
          M-S--               height_shrink
          M-S-=               height_grow
          M-[                 move_left
          M-]                 move_right
          M-S-[               move_up
          M-S-]               move_down
          M-S-/               name_workspace
          M-/                 search_workspace
          M-f                 search_win

The action names and descriptions are listed below:

          term              Spawn a new terminal (see PROGRAMS above).
          menu              Menu (see PROGRAMS above).
          quit              Quit spectrwm.
          restart           Restart spectrwm.
          cycle_layout      Cycle layout.
          flip_layout       Swap the master and stacking areas.
          stack_reset       Reset layout.
          master_shrink     Shrink master area.
          master_grow       Grow master area.
          master_add        Add windows to master area.
          master_del        Remove windows from master area.
          stack_inc         Add columns/rows to stacking area.
          stack_dec         Remove columns/rows from stacking area.
          swap_main         Move current window to master area.
          focus_next        Focus next window in workspace.
          focus_prev        Focus previous window in workspace.
          focus_main        Focus on main window in workspace.
          swap_next         Swap with next window in workspace.
          swap_prev         Swap with previous window in workspace.
          bar_toggle        Toggle overall visibility of status bars.
          bar_toggle_ws     Toggle status bar on current workspace.
          wind_del          Delete current window in workspace.
          wind_kill         Destroy current window in workspace.
          ws_n              Switch to workspace n, where n is 1 through
                            workspace_limit.
          mvws_n            Move current window to workspace n, where n is 1
                            through workspace_limit.
          rg_n              Focus on region n, where n is 1 through 9.
          mvrg_n            Move current window to region n, where n is 1
                            through 9.
          ws_next           Switch to next workspace with a window in it.
          ws_prev           Switch to previous workspace with a window in it.
          ws_next_all       Switch to next workspace.
          ws_prev_all       Switch to previous workspace.
          ws_next_move      Switch to next workspace with the current window.
          ws_prev_move      Switch to previous workspace with the current
                            window.
          ws_prior          Switch to last visited workspace.
          rg_next           Switch to next region.
          rg_prev           Switch to previous region.
          screenshot_all    Take screenshot of entire screen (if enabled)
                            (see PROGRAMS above).
          screenshot_wind   Take screenshot of selected window (if enabled)
                            (see PROGRAMS above).
          version           Toggle version in status bar.
          float_toggle      Toggle focused window between tiled and floating.
          lock              Lock screen (see PROGRAMS above).
          initscr           Reinitialize physical screens (see PROGRAMS
                            above).
          iconify           Minimize (unmap) currently focused window.
          uniconify         Maximize (map) window returned by dmenu
                            selection.
          always_raise      When set tiled windows are allowed to obscure
                            floating windows.
          button2           Fake a middle mouse button click (mouse button
                            2).
          width_shrink      Shrink the width of a floating window.
          width_grow        Grow the width of a floating window.
          height_shrink     Shrink the height of a floating window.
          height_grow       Grow the height of a floating window.
          move_left         Move a floating window a step to the left.
          move_right        Move a floating window a step to the right.
          move_up           Move a floating window a step upwards.
          move_down         Move a floating window a step downwards.
          name_workspace    Name the current workspace.
          search_workspace  Search for a workspace.
          search_win        Search the windows in the current workspace.