misc questions

Chris Hecker checker at d6.com
Sat Jul 10 11:49:21 CEST 2010


> No, only as a parameter. You can however, set the ttl of any object
> you want.

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

>> Can I just return pass at the top of recv
> Yes.

Awesome, thanks.  That works perfectly.

> 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.

> 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?

> If you expect high loads, 32 bit may cramp your style.

I'll have to see.  It's such a gigantic improvement over the previous 
situation it's hard to even compare.  Now that I have the "pass;" trick, 
I can compare both cases even more easily.

Here is with pass;, so no caching, hitting the MediaWiki backend:

HTTP/1.1 200   6.67 secs:   68579 bytes ==> /Sandbox/TestSiege
Lifting the server siege...      done.
Transactions:                    190 hits
Availability:                  48.10 %
Elapsed time:                  23.73 secs
Data transferred:              12.43 MB
Response time:                  5.53 secs
Transaction rate:               8.01 trans/sec
Throughput:                     0.52 MB/sec
Concurrency:                   44.31
Successful transactions:         190
Failed transactions:             205
Longest transaction:           11.49
Shortest transaction:           0.29

This is similar to what I was seeing without varnish, so I think the 
pass; is not costing much at all.  CPU is at 99%, and the machine is 
completely unresponsive, with top filled with httpd processes.

And here is varnish in the way:

HTTP/1.1 200   0.06 secs:   68579 bytes ==> /Sandbox/TestSiege
Lifting the server siege...      done.
Transactions:                   1531 hits
Availability:                 100.00 %
Elapsed time:                   9.84 secs
Data transferred:             100.13 MB
Response time:                  0.12 secs
Transaction rate:             155.59 trans/sec
Throughput:                    10.18 MB/sec
Concurrency:                   19.18
Successful transactions:        1531
Failed transactions:               0
Longest transaction:            0.76
Shortest transaction:           0.06

It's a 100mbps link, so varnish is saturating it.  And cpu is at 
something like 2%.  You can't even tell the machine is being sieged.

On a smaller page:

HTTP/1.1 200   3.91 secs:   12189 bytes ==> /Homepage
Lifting the server siege...      done.
Transactions:                    122 hits
Availability:                  17.97 %
Elapsed time:                  16.50 secs
Data transferred:               1.42 MB
Response time:                  4.23 secs
Transaction rate:               7.39 trans/sec
Throughput:                     0.09 MB/sec
Concurrency:                   31.30
Successful transactions:         122
Failed transactions:             557
Longest transaction:            9.32
Shortest transaction:           0.00

HTTP/1.1 200   0.05 secs:   12189 bytes ==> /Homepage
Lifting the server siege...      done.
Transactions:                   3861 hits
Availability:                 100.00 %
Elapsed time:                   7.79 secs
Data transferred:              45.93 MB
Response time:                  0.15 secs
Transaction rate:             495.64 trans/sec
Throughput:                     5.90 MB/sec
Concurrency:                   75.27
Successful transactions:        3951
Failed transactions:               0
Longest transaction:            0.74
Shortest transaction:           0.05

I think this is bound on the siege side, on a faster machine sieging I 
got ~800 txn/sec and 8MBps on this page.

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

Chris


On 2010/07/10 02:04, Poul-Henning Kamp wrote:
> In message<4C38361C.9040105 at d6.com>, Chris Hecker writes:
>>
>> 1.  Is there a way to set the default ttl inside the vcl?
>
> No, only as a parameter.  You can however, set the ttl of any
> object you want.
>
>> 2.  What's the recommended way of "disabling" varnish quickly for
>> testing?  Can I just return pass at the top of recv
>
> Yes.
>
>> 3.  If I've got mediawiki and wordpress (my two backends) purging
>> correctly on edit, what should the ttl be on the content pages?  It
>> seems like I should set it to something high, right?  mediawiki sets it
>> to 18000s, but wp doesn't set it as far as I can tell from the log.
>
> As I mentioned above, you can set the ttl in your VCL file, it all
> depends on your traffic pattern really, but of course the longer
> you cache, the better your hitrate.  The question is how much longer
> and how much better.
>
>> 4.  If I've got varnish working in front of wordpress, I assume I don't
>> need any of the caching plugins or any other hacks like those, right?
>
> Well, depends if you have many private pages that varnish decides to
> "pass" etc.
>
>> PS.  I'm on 32 bit CentOS 5.5 and varnish 2.0.6, and varnish seems to be
>> working fine so far.
>
> If you expect high loads, 32 bit may cramp your style.
>




More information about the varnish-misc mailing list