but dont all the configs need to be loaded at runtime, not sure the overhead here?  I think what you mentioned seems like a really innovative way to "call" the function but what about anyimpact to "loading" all these configs?  <div>
<br></div><div>If i understand what you are saying, i put a "call test_func;" in vcl_recv which turned into this in C</div><div><br></div><div><div>    if (VGC_function_test_func(sp))</div><div>        return (1);</div>
<div>      if</div><div><br></div><div>Are you suggesting your hash_table would take over this step ?</div><div><br></div><div>Adam</div>
<br><div class="gmail_quote">On Mon, Mar 7, 2011 at 8:02 AM, David Helkowski <span dir="ltr"><<a href="mailto:dhelkowski@sbgnet.com" target="_blank">dhelkowski@sbgnet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



  
    
    
  
  <div bgcolor="#ffffff" text="#000000">
    The best way would be to use a jump table.<br>
    By that, I mean to make multiple subroutines in C, and then to jump
    to the different subroutines by looking<br>
    up pointers to the subroutines using a string hashing/lookup system.<br>
    <br>
    You would also need a flag to indicate whether the hash has been
    'initialized' yet as well.<br>
    The initialization would consist of storing function pointers at the
    hash locations corresponding to each<br>
    of the domains.<br>
    <br>
    I attempted to do this myself when I first started using varnish,
    but I was having problems with varnish<br>
    crashing when attempting to use the code I wrote in C. There may be
    limitations to the C code that can be<br>
    used.<div><div></div><div><br>
    <br>
    On 3/6/2011 5:39 PM, AD wrote:
    </div></div><blockquote type="cite"><div><div></div><div>Hello,
      <div> </div>
      <div> what is the best way to run an instance of varnish that may
        need different vcl configurations for each hostname.  This could
        end up being 100-500 includes to map to each hostname and then a
        long if/then block based on the hostname.  Is there a more
        scalable way to deal with this?  We have been toying with
        running one large varnish instance with tons of includes or
        possibly running multiple instances of varnish (with the config
        broken up) or spreading the load across different clusters (kind
        of like sharding) based on hostname to keep the configuration
        simple.</div>
      <div><br>
      </div>
      <div> Any best practices here?  Are there any notes on the
        performance impact of the size of the VCL or the amount of
        if/then statements in vcl_recv to process a unique call function
        ?</div>
      <div><br>
      </div>
      <div>
        Thanks</div>
      <div><br>
      </div>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
varnish-misc mailing list
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a>
<a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a></pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
<a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br>
</div>