Archive

Archive for the ‘Varnish’ Category

varnishadm ban

June 24th, 2015 No comments

When cleaning the cache on varnish 3.0 there is a way to only ban the specific host.

The command is:

Read more…

Categories: Varnish Tags: , , , , , ,

check_backend.sh

March 25th, 2014 No comments

Another bash script to monitor if there were any failed connections to the backend’s.
It is a simple aproach using the command:
varnishstat -1 -f backend_fail
Then it puts the output on a tmp file and next time it runs it checks if it is still having erros on the backend.

Read more…

varnish performance analyser

November 12th, 2013 No comments

A script to get the time of each requests and verify how long it took.

Example

req     | [0,1[ | [1,2] | ]2,3] | ]3,4] | ]4,5] | <=10 | <=15 | >15 | min      | max | req/s | time       | delta
81000 | 994   | 3     | 1       | 0      | 0      | 1       | 0       | 1     | 0.0000 | 53.9 | 1530 | 11:53:43 | 0.6532200000
82000 | 993   | 4     | 1       | 1      | 1      | 0       | 0       | 0     | 0.0000 | 4.9   | 1806 | 11:53:43 | 0.5536160000

Read more…

Categories: HowTo, Varnish Tags:

Script to purge varnish cache

August 15th, 2013 No comments

There is a easy way to allow developers to stop bugging us the system adminsitror, “clean the cache”.
Just setup this php page on a apache server and they can do it themselves.

Read more…

Categories: Varnish Tags: , ,

check_conntrack_unreplied

March 27th, 2013 No comments

Our front end varnish servers expierence a lot of traffic and we currently
must have a iptables NAT that routes from port 80 to port 81, where the varnish daemon listen to traffic. Doing this we end up using the iptables conntrack feature.

Read more…

How varnish can identify mobile users

November 10th, 2011 No comments

How varnish can identify mobile users

In this example it basically finds out via regex on the user-agent tag if the user
is mobile if so it redirect to a mobile site.

Read more…

Categories: HowTo, Varnish Tags: , , , , ,

Varnish security.vcl

July 21st, 2011 3 comments

How to setup Security.vcl on Varnish 3.0

Download it
wget https://github.com/KristianLyng/varnish/tree/my2.1/varnish-tools/security.vcl
# cd vcl/
# make
# cp -a vcl/ /etc/varnish/security.vcl/
(alternatively you could symlink it, of course).
Now all it has to be done is edit your normal VCL and
add this line near the top:
include “/etc/varnish/security.vcl/main.vcl”;

Read more…