r5242 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/doc/sphinx/tutorial varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl

tfheen at varnish-cache.org tfheen at varnish-cache.org
Wed Sep 22 10:20:56 CEST 2010


Author: tfheen
Date: 2010-09-22 10:20:56 +0200 (Wed, 22 Sep 2010)
New Revision: 5242

Added:
   branches/2.1/varnish-cache/doc/sphinx/tutorial/intro.rst
   branches/2.1/varnish-cache/doc/sphinx/tutorial/tut001.rst
   branches/2.1/varnish-cache/doc/sphinx/tutorial/vtc_files/
Modified:
   branches/2.1/
   branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
   branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
   branches/2.1/varnish-cache/bin/varnishd/vparam.h
   branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
   branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
   branches/2.1/varnish-cache/include/vct.h
   branches/2.1/varnish-cache/include/vev.h
   branches/2.1/varnish-cache/lib/libvarnish/tcp.c
   branches/2.1/varnish-cache/lib/libvarnish/vev.c
   branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
Log:
Merge r4754: Add the first tutorial example, based on the new -L flag to varnishtest.



Property changes on: branches/2.1
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170

Copied: branches/2.1/varnish-cache/doc/sphinx/tutorial/intro.rst (from rev 4754, trunk/varnish-cache/doc/sphinx/tutorial/intro.rst)
===================================================================
--- branches/2.1/varnish-cache/doc/sphinx/tutorial/intro.rst	                        (rev 0)
+++ branches/2.1/varnish-cache/doc/sphinx/tutorial/intro.rst	2010-09-22 08:20:56 UTC (rev 5242)
@@ -0,0 +1,51 @@
+%%%%%%%%%%%%
+Introduction
+%%%%%%%%%%%%
+
+Most tutorials are written in "subject-order", as the old Peanuts
+strip goes::
+
+	Jogging: A Handbook
+	Author:  S. Noopy
+	    Chapter 1: Left foot
+		It was a dark and stormy night...
+
+This is great when the reader has no choice, and nothing better to
+do, but read the entire document before starting.
+
+We have taken the other approach: "breadth-first", because experience
+has shown us that Varnish users wants to get things running, and then
+polish up things later on.
+
+With that in mind, we have written the tutorial so you can break off,
+as Calvin tells Ms. Wormwood, "when my brain is full for today", and
+come back later and learn more.
+
+That also means that right from the start, we will have several
+things going on in parallel and you will need at least four, sometimes
+more, terminal windows at the same time, to run the examples.
+
+A word about TCP ports
+----------------------
+
+We have subverted our custom built regression test tool, a program
+called ```varnishtest``` to help you get through these examples,
+without having to waste too much time setting up webservers as 
+backends or browsers as clients, to drive the examples.
+
+But there is one complication we can not escape:  TCP port numbers.
+
+Each of the backends we simulate and the varnishd instances we run
+needs a TCP port number to listen to and it is your job to find them,
+because we have no idea what servers are running on your computer
+nor what TCP ports they use.
+
+To make this as easy as possible, we have implemented a ```-L
+number``` argument to all the varnish programs, which puts them in
+"Learner" mode, and in all the examples we have used 20000 as
+the number, because on most systems the middle of the range
+(1000...65000) is usually not used.
+
+If these ports are in use on your system (is your colleague also running
+the Varnish tutorial ?) simply pick another number and use that
+instead of 20000.

Copied: branches/2.1/varnish-cache/doc/sphinx/tutorial/tut001.rst (from rev 4754, trunk/varnish-cache/doc/sphinx/tutorial/tut001.rst)
===================================================================
--- branches/2.1/varnish-cache/doc/sphinx/tutorial/tut001.rst	                        (rev 0)
+++ branches/2.1/varnish-cache/doc/sphinx/tutorial/tut001.rst	2010-09-22 08:20:56 UTC (rev 5242)
@@ -0,0 +1,78 @@
+.. _TUT001:
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+TUT001: Let's see if varnishtest is working
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+In the first window, start this command::
+
+	varnishtest -L20000 S001.vtc
+
+Then in the second window, run this one::
+
+	varnishtest -L20000 C001.vtc
+
+If things work as they should, both programs spit out 5 lines, looking
+like this in the first window::
+
+	*    top  TEST S001.vtc starting
+	**   s1   Started on 127.0.0.1:20012
+	**   s1   Ending
+	*    top  RESETTING after S001.vtc
+	*    top  TEST S001.vtc completed
+
+and like this in the second window::
+
+	*    top  TEST C001.vtc starting
+	**   c1   Starting client
+	**   c1   Ending
+	*    top  RESETTING after C001.vtc
+	*    top  TEST C001.vtc completed
+
+If that did not work, please consult the XXX: troubleshooting section.
+
+Now, try again, but this time run the client with a couple of ``-v``
+arguments::
+
+	varnishtest -vv -L20000 C001.vtc
+
+Now the output contains a lot mode detail::
+
+	*    top  TEST C001.vtc starting
+	***  top  client
+	**   c1   Starting client
+	***  c1   Connect to 127.0.0.1:20012
+	***  c1   connected fd 3
+	***  c1   txreq
+	**** c1   txreq| GET / HTTP/1.1\r\n
+	**** c1   txreq| \r\n
+	***  c1   rxresp
+	**** c1   rxhdr| HTTP/1.1 200 Ok\r\n
+	**** c1   rxhdr| Foo: bar\r\n
+	**** c1   rxhdr| Content-Length: 12\r\n
+	**** c1   rxhdr| \r\n
+	**** c1   http[ 0] | HTTP/1.1
+	**** c1   http[ 1] | 200
+	**** c1   http[ 2] | Ok
+	**** c1   http[ 3] | Foo: bar
+	**** c1   http[ 4] | Content-Length: 12
+	**** c1   body| Hello World!
+	**** c1   bodylen = 12
+	***  c1   closing fd 3
+	**   c1   Ending
+	*    top  RESETTING after C001.vtc
+	*    top  TEST C001.vtc completed
+
+First the client does a ``txreq`` -- "transmit request", and you can
+see the HTTP request it sends to the server, a plain boring "GET".
+
+Then it does a ``rxresp`` -- "receive response", and we can see the
+HTTP response we get back, including the HTTP object body.
+
+Now try again, this time running the server in the first window with
+``-vv``. 
+
+If things do not work the way you expect, adding those ``-v`` options
+is a good place to start debugging.
+
+Next we put a Varnish cache between the server and the client: _TUT002


Property changes on: branches/2.1/varnish-cache/include/vct.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/include/vev.h
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170


Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170
   + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048,5162,5170




More information about the varnish-commit mailing list