Set my own value in C for use in VCL

Kristian Lyngstol kristian at varnish-software.com
Thu Jan 20 16:14:47 CET 2011


On Thu, Jan 20, 2011 at 02:58:25PM +0000, Philip Prince wrote:
> I apologise for the C error; my colleague looking over my shoulder and
> reading this email with me had a laugh about it. However, even when I
> remove the line above and the two lines below (which could bring sp back
> into scope) the behaviour is identical. 

I believe there was an other posts explaining that the \013 was incorrect
in this situation, so I'll leave it at that :)

> That segfault-ing Varnish may be one of my guilty pleasures
> notwithstanding, I have now searched for VMODs and have found a reference
> to them in the 'Documentation for trunk.'  Curiously, they don't appear
> to be documented in the 'Documentation for the latest stable release'
> which was the path I was stumbling down.

That is correct. VMods are not part of any release yet, and we are just now
trying them out ourself and thus expect them to change a bit before
release of 3.0. So the reason there's no documentation of in-line C is
intentional, but the lack of documentaiton for VMods is just because we
haven't gotten to it yet :)

> Unfortunately, our preferred development environment (PHP on Macs for
> delivery on Ubuntu) does not lend itself to rapid prototyping C modules.
> The inline C seemed to amenable to me faffing about for a bit until I get
> something working.

Quite understandable, this is why we've realized we need to make it easier.

> I have a client who is very concerned about the very first access to a
> not-yet-cached bit of information by many, many people all at the same
> time. Their preference is to receive a retry response rather than queue
> and wait for the backend to respond (it is an expensive request) if
> someone else has already accessed the URL but the cache has not yet been
> populated with its content. Is there a built-in that would be ideal for
> this scenario?

Hmm, not quite. But 2.1.4 has req.ignore_busy, which will by-pass the
waiting list, but then you have to ensure (in vcl_miss) that you don't
request the same object multiple times... I suppose you could set a
marker in vcl_miss when an object is being requested, but all of this
quickly gets dirty.

This is somewhat outside the scope of in-line C, as it affects multiple
concurrent requests... It's doable, but much much easier by just haking
HSH_Lookup in the right place...

- Kristian




More information about the varnish-misc mailing list