misc questions

Poul-Henning Kamp phk at phk.freebsd.dk
Sat Jul 10 12:28:55 CEST 2010


In message <4C384221.6070301 at d6.com>, Chris Hecker writes:

>Yeah, but I couldn't figure out how to test if one had already been set. 
>  "if (obj.ttl)" didn't work.

By the time you get to the VCL code, a TTL will have been set, if nothing
else the default ttl.

You can check for the default ttl, by setting it to a magic value
and testing against that.

>> you cache, the better your hitrate. The question is how much longer
>> and how much better.
>
>Yeah, my use case is a single page getting slashdotted, not general high 
>traffic all the time distributed over all the pages, so I guess it 
>doesn't matter too much.  I have the default set to 600s right now, 
>which makes it easier to test than 120s.

Consider enabling "grace" with a few seconds, to cover any updates to
that page.

>> Well, depends if you have many private pages that varnish decides to
>> "pass" etc.
>
>Hmm, can you explain this, or tell me how I can detect this case? 
>Should I look in the log for Cache-Control with private?

Varnish will pass anything with cookies or Authorization headers.

>This is a crappy 2.8ghz p4 with two cores and 1gb of ram.  Do these 
>numbers look reasonable to people for that machine type?  The cache is 
>file,1G

Absolutely reasonable, 100mbit/s should never be a problem for
varnish.

Try running "varnishhist" and see the responstime difference between
hits and misses...


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.




More information about the varnish-misc mailing list