1. 24 Sep, 2007 5 commits
    • Cecilie Fritzvold's avatar
    • Poul-Henning Kamp's avatar
      Add code to VCC to output an identifier for each simple backend which · 6eef6757
      Poul-Henning Kamp authored
      varnishd can use to decide if a backend state can be shared between
      multiple VCL programs.
       
      Originally the idea was to calculate a strong hash over the tokens 
      which define the backend.  
      
      Considering the relatively short lengths of backend declarations
      and the infrequency of comparisons, we have opted for an extremely
      weak hash instead:  We simply output the space separted tokens as
      a string.
       
      The net change in code for simple backends is marginal, but for
      complex backends this will be a lot simpler to implement.
      
      
      
      git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2007 d4fa192b-c00b-0410-8231-f00ffab90ce4
      6eef6757
    • Poul-Henning Kamp's avatar
      Our first cut at a LRU processing contained a three way race and can · 17662d28
      Poul-Henning Kamp authored
      cause Really Weird Problems if you really provoke it.
      
      +++ Redo from start +++
      
      LRU processing is only relevant for objects which are in the cache and
      on the EXP binary heap so we merge the LRU functionality with the EXP
      code in order to share locks and object reference counts.
      
      Another thing we overlooked in the first implementation is that the VCL
      callout for LRU should be able to examine the client information for
      the session which tries to push stuff out, so that QoS/DoS issues can be
      considered:
      
      	sub vcl_dicard {
      		if (client.bandwidth > 10 mb/s) {
      			keep;
      		}
      	}
      
      (which sort of indicates that "error" should be a legal action as well)
      
      To enable this, pass the session into the stevedore when we try to
      allocate space and temporarily substitute the target object for its
      own object while we call vcl_discard().
      
      The outcome of an attempt to make space can take three values, did,
      didn't and couldn't.  In the latter case there is no point in trying
      again and again, in particular if the cause is incurable, such as
      the requested size being larger than the storage.   We still need to
      handle failure to allocate storage for that case rather than core dump.
      
      When looking for targets to nuke, we only consider objects on the
      binheap which has reference count of 1, objects with higher reference
      counts would not free space.
      
      We take prospective targets off the binheap, but retain their
      refcount, and tag them with a magic marker while we ponder their
      destiny.
      
      It is quite possible that another session could pick the object up
      via the cache while we do so, and therefore attempts to update the
      ttl or shift them in the lru chain must ignore objects which has
      the magic marker.  If the object is kept, the updated ttl will
      automatically take effect when we reinsert it in the binheap.
      
      
      
      git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2006 d4fa192b-c00b-0410-8231-f00ffab90ce4
      17662d28
    • Poul-Henning Kamp's avatar
      Add a couple of statistics counters for LRU · f80b4251
      Poul-Henning Kamp authored
      
      git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2005 d4fa192b-c00b-0410-8231-f00ffab90ce4
      f80b4251
    • Poul-Henning Kamp's avatar
      2f7fee5a
  2. 23 Sep, 2007 10 commits
  3. 21 Sep, 2007 5 commits
  4. 20 Sep, 2007 19 commits
  5. 18 Sep, 2007 1 commit