From: des Date: Mon, 27 Feb 2006 07:47:19 +0000 (+0000) Subject: Paste large portion of phk's notes. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ecc52488a9e6d15433f0319e650b35f0475ff27;p=varnish Paste large portion of phk's notes. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@31 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-doc/en/varnish-architecture/article.xml b/varnish-doc/en/varnish-architecture/article.xml index e9862da7..dfa81fc8 100644 --- a/varnish-doc/en/varnish-architecture/article.xml +++ b/varnish-doc/en/varnish-architecture/article.xml @@ -89,9 +89,8 @@ Logger The Logger keeps logs of various types of events in - circular shared-memory buffers. These buffers must be managed - using either POSIX shared memory primitives or file-backed - mmap(2). + circular shared-memory buffers. See for details. It is the responsibility of each module to feed relevant log data to the Logger. @@ -99,6 +98,144 @@ +
+ Configuration + + Policy is configured in a simple unidirectional (no loops, + no goto) programming language which is compiled into 'C' and from + there binary modules which are dlopen'ed by the main Varnish + process. + + The dl object contains one exported symbol, a pointer to a + structure which contains a reference count, a number of function + pointers, a couple of string variables with identifying + information. + + All access into the config is protected by the reference + counts. + + Multiple policy configurations can be loaded at the same + time but only one is the "active configuration". Loading, + switching and unloading of policy configurations happen via the + managment process. + + A global config sequence number is incremented on each + switch and policy modified object attributes (ttl, cache/nocache) + are all qualified by the config-sequence under which they were + calculated and invalid if a different policy is now in + effect. +
+ +
+ Logging + + + +
+ +
+ Invalidation + + When a purge request comes in, the regexp is tagged with the + next generation number and added to the tail of the list of purge + regexps. + + Before a sender transmits an object, it is checked against + any purge-regexps which have higher generation number than the + object and if it matches the request is sent to a fetcher and the + object purged. + + If there were purge regexps with higher generation to match, + but they didn't match, the object is tagged with the current + generation number and moved to the tail of the list. + + Otherwise, the object does not change generation number and + is not moved on the generation list. + + New Objects are tagged with the current generation number + and put at the tail of the list. + + Objects are removed from the generation list when + deleted. + + When a purge object has a lower generation number than the + first object on the generation list, the purge object has been + completed and will be removed. A log entry is written with number + of compares and number of hits. +
+ +
+ Management + +
+ Management commands + + + + object_query url -> TTL, size, checksum + + + {purge,invalidate} regexp + + + object_status url -> object metadata + + + load_config filename + + + switch_config configname + + + list_configs + + + unload_config + + + freeze # stop the clock, freezes the object store + + + thaw + + + suspend # stop acceptor accepting new requests + + + resume + + + stop # forced stop (exits) varnish process + + + start + + + restart = "stop;start" + + + ping $utc_time -> pong $utc_time + + + stats [-mr] -> $data + + + zero stats + + + help + + + + Cluster only: + + + config_contents filename $inline -> compilation messages + + +
+
+ References