a pure Raspi web server with Raspbian Debian

Raspberry pi server

 Setups and configurations

 Raspberry pi - Rpi

 Apache / LAMP server

Windward

 The game not the island group

anchor life saver

 Regarding unity3d

🙂 In-game char icons

 Public game server settings

🛠 Hafenzoll @raspberry
🛠 Windward defaults

 Social news aggregation

Community @steam
🌍 Windward #reddit

 Official Windward wiki

🛠 Wiki @gamepedia
Duckduckgo pirate flag
Something else

 This is in German language

💻 Linux - ubuntusers.de

 Get a handy weather widget

🌤 Weather code snippet

 Hotchpotch of weblinks

📖 Yellow pages

 We got some boring movies

🎥 Cinematique
Archives
Search cloud
Front desk clerk

No ads, no trackers and
no web beacons. Promised.

Rasberry pi | Varnish web server accelerator | Hardware ram cache


For OS Raspbian Jessie and Stretch Lite & varnishd (varnish-4.0.2 revision bfe7cd1)


Should be functioning among each Linux Debian derivate.
Some derivates show up with behaviours in a different way.


Raspberry pi as host Apache http / https web server Varnish cache Outside world


Varnish cache improves the performance of your existing http server. Sometimes it is called http reverse proxy, which reduces the time it takes to serve contents to the clients. In most cases with a Raspberry pi, Varnish works well with its defaults. I assume that you already have a Apache http server that is listening on http port 80 on your - even dynamic - private IP address.


Major benefit: by accessing your Varnish cache the lifetime of your SDcard gets extended.


Update apt-get and install Varnish with the following commands


root@raspberry:# apt-get update
root@raspberry:# apt-get install varnish


Varnish ram cache | Default configurations


Varnish Configuration Language VLC


## Alternative 2, Configuration with VCL


root@raspberry:# nano /etc/default/varnish


        ## Alternative 2, Configuration with VCL
        #
        # Listen on port 6081, administration on localhost:6082, and forward to
        # one content server selected by the vcl file, based on the request.
        #
        DAEMON_OPTS="-a :6081 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,256m"
        

root@raspberry:# nano /etc/varnish/default.vcl


        # Default backend definition. Set this to point to your content server.
        backend default {
        .host = "127.0.0.1";
        .port = "8080";
        }
        

Reboot your RbPi


root@raspberry:# shutdown -r now



Check if Varnish is actived and functioning


The number associated to cached Mem means the amount of physical memory PiRAM that is being used by cache buffers for your file system. Nothing to do with your Varnish cache. It is just misleading.

At present it has no way to smaller the malloc,256m 256 MB PiRAM cache provided by Varnish. It is just fixed as default value.


root@raspberry:# top


        KiB Mem:   1000216 total,   304628 used,   695588 free,    17180 buffers
        KiB Swap:        0 total,        0 used,        0 free.   179556 cached Mem
        
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
        ...
        898 nobody    20   0  285752  86896  84580 S   0.3  8.7   0:06.03 varnishd
        911 varnish+  20   0   86272    732  84368 S   0.3  0.1   0:05.51 varnishncsa
        ...
        

Quit Crtl C


Check the service status Active: active (running)


root@raspberry:# service varnish status


         varnish.service - Varnish http accelerator
        Loaded: loaded (/lib/systemd/system/varnish. ...
        Active: active (running) since Sat 2018-03-1 ...
        Process: 925 ExecStart=/usr/sbin/varnishd -a ...
        malloc,256m (code=exited, status=0/SUCCESS)
        Process: 374 ExecStartPre=/usr/sbin/varnishd ...
        ...
        

The terminal command netstat shows some process if used, not used (closed port) if there is no output.


root@raspberry:# netstat -tulnp


Look for varnishd PID/Program name


        Active Internet transfers (only servers)
        ...
        

And by the Varnish statistic tool varnishhist.

Functional if in the upper right corner your own Second-Level-Domain (SLD) name appears.


Raspberry pi Varnish cache


root@raspberry:# varnishhist


Quit Crtl C


Varnish allows us to use several tools to evaluate & monitor the server by means of statistics.


        varnishtop  ← grouped list with the most usual entries from different logs
        varnishhist ← a histogram that shows the time taken for the requests processing
        varnishstat ← it shows many contents on cache hits, resource consumption, etc
        varnishlog  ← it allows us to see all the requests made to the web backend server
        

Exit Crtl C


Get your Varnish version & revision


root@raspberry:# varnishd -V


14-Mar 2018
Revised 17-Mar 2018

Hafenzoll 2019