Purging contents

2009-01-21 Thread Paras Fadte
Hi,

When purging object from varnish cache from command line it always
tends to show 200 0 as the status code even if the object was not
there in cache ? What could be the reason ?

Thank you.

-Paras
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Paras Fadte
Does  it mean that 200 code doesn't have any relation to the object
being  or not being there  in the cache ? Does it only mean then that
the purge command was successfully executed ?

Thanks .

-Paras

On Wed, Jan 21, 2009 at 4:37 PM, Poul-Henning Kamp p...@phk.freebsd.dk wrote:
 In message 75cf5800901210302m5fc06acbh2334b0d90df7a...@mail.gmail.com, Paras
 Fadte writes:
Hi,

When purging object from varnish cache from command line it always
tends to show 200 0 as the status code even if the object was not
there in cache ? What could be the reason ?

 200 means the purge went well, and 0 that there is no resulting text.

 purges don't happen until the object is looked up.

 --
 Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
 p...@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.

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Poul-Henning Kamp
In message 75cf5800901210319j1a2741bdp171bdffad920b...@mail.gmail.com, Paras 
Fadte writes:

Does  it mean that 200 code doesn't have any relation to the object
being  or not being there  in the cache ? Does it only mean then that
the purge command was successfully executed ?

It only means that the purge was succesfully added to the list of
purges.

The way purges work in varnish is that we have a list of purge
commands which gets checked against the objects on demand, in
other words, when you have a cache hit, the purges that have 
come in since the last time this object was hit will be checked
to make sure we can still deliver it.

We do not start walking, the possibly several million, objects
in the cache every time you use the purge command.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Audun Ytterdal
On Wed, Jan 21, 2009 at 12:38 PM, Poul-Henning Kamp p...@phk.freebsd.dk wrote:
 In message 75cf5800901210319j1a2741bdp171bdffad920b...@mail.gmail.com, Paras
 Fadte writes:

Does  it mean that 200 code doesn't have any relation to the object
being  or not being there  in the cache ? Does it only mean then that
the purge command was successfully executed ?

 It only means that the purge was succesfully added to the list of
 purges.

 The way purges work in varnish is that we have a list of purge
 commands which gets checked against the objects on demand, in
 other words, when you have a cache hit, the purges that have
 come in since the last time this object was hit will be checked
 to make sure we can still deliver it.

 We do not start walking, the possibly several million, objects
 in the cache every time you use the purge command.

Does that mean that vcl_miss in this part of the documentation never
would be run?

http://varnish.projects.linpro.no/wiki/VCLExamplePurging
-- 
Audun Ytterdal
http://audun.ytterdal.net
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Poul-Henning Kamp
In message 8318f61f0901210508i25fb1385w91573182d8cd...@mail.gmail.com, Audun 
Ytterdal writes:
On Wed, Jan 21, 2009 at 12:38 PM, Poul-Henning Kamp p...@phk.freebsd.dk 
wrote:
 In message 75cf5800901210319j1a2741bdp171bdffad920b...@mail.gmail.com, 
 Paras Fadte writes:


Does that mean that vcl_miss in this part of the documentation never
would be run?

http://varnish.projects.linpro.no/wiki/VCLExamplePurging

Well, this is the other way to do purges: look up the single object
you want, and blast it away.

That method does not involve any regular expressions, and consequently
you have to be 100% precise to find the single object you want to
get rid off.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Paras Fadte
Hi Poul,

Can one specify host  when purging using command line ?

Thank you.

-Paras

On Wed, Jan 21, 2009 at 7:45 PM, Poul-Henning Kamp p...@phk.freebsd.dk wrote:
 In message 8318f61f0901210508i25fb1385w91573182d8cd...@mail.gmail.com, Audun
 Ytterdal writes:
On Wed, Jan 21, 2009 at 12:38 PM, Poul-Henning Kamp p...@phk.freebsd.dk 
wrote:
 In message 75cf5800901210319j1a2741bdp171bdffad920b...@mail.gmail.com, 
 Paras Fadte writes:


Does that mean that vcl_miss in this part of the documentation never
would be run?

http://varnish.projects.linpro.no/wiki/VCLExamplePurging

 Well, this is the other way to do purges: look up the single object
 you want, and blast it away.

 That method does not involve any regular expressions, and consequently
 you have to be 100% precise to find the single object you want to
 get rid off.

 --
 Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
 p...@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.

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Am I reading the varnishlog correctly?

2009-01-21 Thread Nathan Lenz
Hello,
I have a weird case of Varnish returning a hit with a Length of 0.  It
happens when I clear my browser cache and then hit refresh.  Varnish returns
a 304 status and my browser shows a blank white page.  Here is a snippet of
the varnishlog output:

   10 RxHeader c If-Modified-Since: Mon, 08 Dec 2008 17:28:41 GMT
   10 RxHeader c Cache-Control: max-age=0
   10 VCL_call c recv
   10 VCL_return   c lookup
   10 VCL_call c hash
   10 VCL_return   c hash
   10 Hit  c 1043648757
   10 VCL_call c hit
   10 VCL_return   c deliver
  * 10 Length   c 0*
   10 VCL_call c deliver
   10 VCL_return   c deliver
   10 TxProtocol   c HTTP/1.1
   10 TxStatus c 304
   10 TxResponse   c Not Modified
   10 TxHeader c Date: Wed, 21 Jan 2009 15:16:20 GMT
   10 TxHeader c Via: 1.1 varnish
   10 TxHeader c X-Varnish: 1043648775
   10 TxHeader c Last-Modified: Mon, 08 Dec 2008 17:28:41 GMT

My default.vcl is pretty much the default, with a few minor changes that I
copied from the wiki.  (Normalizing Accept-Encoding and allowing purge on
Shift-Refresh).

I'm reading this as saying:

1. Browser asks varnish for a new copy, with a max age of 0 from Mon, 08 Dec
2008 17:28:41 GMT or newer.
2. vcl_recv decides to do a lookup.
3. It's found that the item exists in the cache (hit!) but that the file
hasn't been modified since Mon, 08 Dec 2008 17:28:41 GMT.
4. vcl_deliver decides to send a 304 not modified instead of the actual
response.

I wonder why my browser is sending an If-Modified-Since header when it
doesn't really have a copy?  I've been running Varnish on a heavily used
testing server for the past week and I get this from time to time in both
Firefox and Safari but I can't reproduce it consistently.  Anyone experience
anything like this?

-- 
Nathan nathan.l...@gmail.com
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Am I reading the varnishlog correctly?

2009-01-21 Thread Poul-Henning Kamp
In message 3cc6f8100901210758u384af1d4k8091c903614f...@mail.gmail.com, Nathan
 Lenz writes:

I wonder why my browser is sending an If-Modified-Since header when it
doesn't really have a copy?  I've been running Varnish on a heavily used
testing server for the past week and I get this from time to time in both
Firefox and Safari but I can't reproduce it consistently.  Anyone experience
anything like this?

Maybe your browser think it has a valid copy, of length zero ?

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Varnish, Plone and Apache2

2009-01-21 Thread Charlie Farinella
I have one site running Plone with lighttpd and Varnish that I set up as 
documented here:
http://bitubique.com/content/accelerate-plone-varnish

I have now been asked to set up others substituting Apache2 for lighttpd 
by the developers, but haven't been able to find such detailed 
instructions for Apache2.  I believe I just need to find the Apache 
equivalent for this line from lighttpd.conf:

proxy.server = ( /VirtualHostBase/ = (
( host = 127.0.0.1 , port = 6081 ) )
)

To my understanding something has to listen on port 80, send the request 
to Varnish, which then either serves from the cache or sends the request 
on to the Zope (Plone) port.

If anyone knows offhand or has some experience with this I'd like to hear 
from you.  Is Apache a bad choice for this? 

-- 

Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
cfarine...@appropriatesolutions.com
voice: 603.924.6079   fax: 603.924.8668

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Breaking Varnish

2009-01-21 Thread Tim Kientzle
We're evaluating Varnish as a possible replacement for our
installed Squid servers.  Performance-wise, Varnish is very
impressive, and we're pretty pleased with the configuration
flexibility.

But...

Under heavy load, we're seeing a lot of segfaults and
assertion failures.  I've pasted an excerpt below of
two of the issues we've seen using Varnish 2.0.2 on Linux
2.6.21 kernel with the default VCL (using command-line options
to set the listen address and the addresses of the two back-end
servers).

We're going to repeat these tests and see if we can get
more detail, possibly including core dumps.  What other
information would be useful in diagnosing and fixing
these issues?

Cheers,

Tim Kientzle

==

1) Varnish repeatedly died due to SIGSEGV:

child (2816) Started
Child (2816) said Closed fds: 4 7 8 10 11
Child (2816) said Child starts
Child (2816) said managed to mmap 49392648192 bytes of 49392648192
Child (2816) said Ready
Child (2816) died signal=11
Child cleanup complete

2) Varnish repeatedly died due to SIGABRT:

child (3017) Started
Child (3017) said Closed fds: 4 7 8 10 11
Child (3017) said Child starts
Child (3017) said managed to mmap 49392648192 bytes of 49392648192
Child (3017) said Ready
Child (3017) died signal=6
Child (3017) Panic message: Assert error in cnt_lookup(),  
cache_center.c line 625:
   Condition(sp-objhead != NULL) not true. thread = (cache-worker)sp  
= 0x2afee0fb3008 {
   fd = -1, id = 15, xid = 0,
   client = 10.2.8.27:45430,
   step = STP_DONE,
   handling = DELIVER,
   ws = 0x2afee0fb3078 {
 id = sess,
 {s,f,r,e} = {0x2afee0fb37b0,,+587,(nil),+8192},
   },
}, 
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Breaking Varnish

2009-01-21 Thread Iliya Sharov
amd64 or i386 architecture?

Tim Kientzle пишет:
 We're evaluating Varnish as a possible replacement for our
 installed Squid servers.  Performance-wise, Varnish is very
 impressive, and we're pretty pleased with the configuration
 flexibility.

 But...

 Under heavy load, we're seeing a lot of segfaults and
 assertion failures.  I've pasted an excerpt below of
 two of the issues we've seen using Varnish 2.0.2 on Linux
 2.6.21 kernel with the default VCL (using command-line options
 to set the listen address and the addresses of the two back-end
 servers).

 We're going to repeat these tests and see if we can get
 more detail, possibly including core dumps.  What other
 information would be useful in diagnosing and fixing
 these issues?

 Cheers,

 Tim Kientzle

 ==

 1) Varnish repeatedly died due to SIGSEGV:

 child (2816) Started
 Child (2816) said Closed fds: 4 7 8 10 11
 Child (2816) said Child starts
 Child (2816) said managed to mmap 49392648192 bytes of 49392648192
 Child (2816) said Ready
 Child (2816) died signal=11
 Child cleanup complete

 2) Varnish repeatedly died due to SIGABRT:

 child (3017) Started
 Child (3017) said Closed fds: 4 7 8 10 11
 Child (3017) said Child starts
 Child (3017) said managed to mmap 49392648192 bytes of 49392648192
 Child (3017) said Ready
 Child (3017) died signal=6
 Child (3017) Panic message: Assert error in cnt_lookup(),  
 cache_center.c line 625:
Condition(sp-objhead != NULL) not true. thread = (cache-worker)sp  
 = 0x2afee0fb3008 {
fd = -1, id = 15, xid = 0,
client = 10.2.8.27:45430,
step = STP_DONE,
handling = DELIVER,
ws = 0x2afee0fb3078 {
  id = sess,
  {s,f,r,e} = {0x2afee0fb37b0,,+587,(nil),+8192},
},
 }, 
 ___
 varnish-misc mailing list
 varnish-misc@projects.linpro.no
 http://projects.linpro.no/mailman/listinfo/varnish-misc
   

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Breaking Varnish

2009-01-21 Thread Poul-Henning Kamp
In message 6545783f-b1a7-4fda-94d8-8439a2d13...@metaweb.com, Tim Kientzle wri
tes:

Under heavy load, we're seeing a lot of segfaults and
assertion failures.  I've pasted an excerpt below of
two of the issues we've seen using Varnish 2.0.2 on Linux
2.6.21 kernel with the default VCL (using command-line options
to set the listen address and the addresses of the two back-end
servers).

Hi Tim,

Can I get you to take -trunk for a spin ?

At least the second of the problems you pasted I'm pretty sure I
have nailed recently and the first one could easily be the same one
in a different disguise.

Poul-Henning

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: [varnish] Varnish, Plone and Apache2

2009-01-21 Thread Ricardo Newbery

On Jan 21, 2009, at 1:50 PM, Charlie Farinella wrote:

 I have one site running Plone with lighttpd and Varnish that I set  
 up as
 documented here:
 http://bitubique.com/content/accelerate-plone-varnish


IMHO, the vcl generated by the plone.recipe.varnish recipe is superior  
to the one on that page.



 I have now been asked to set up others substituting Apache2 for  
 lighttpd
 by the developers, but haven't been able to find such detailed
 instructions for Apache2.  I believe I just need to find the Apache
 equivalent for this line from lighttpd.conf:

 proxy.server = ( /VirtualHostBase/ = (
( host = 127.0.0.1 , port = 6081 ) )
 )

 To my understanding something has to listen on port 80, send the  
 request
 to Varnish, which then either serves from the cache or sends the  
 request
 on to the Zope (Plone) port.

 If anyone knows offhand or has some experience with this I'd like to  
 hear
 from you.  Is Apache a bad choice for this?


Apache is not necessarily a bad choice.

You will need to use ProxyPass or RewriteRule directives.  The Apache  
setup isn't really that much different than the standard Zope/Apache  
config.  Plone.org has plenty of docs on this:
http://plone.org/documentation/tutorial/plone-apache
http://plone.org/documentation/how-to/plone-with-apache

You might also want to look into the CacheFu product:
http://plone.org/products/cachefu

Ric


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Paras Fadte
Hi Poul,


For applying HTTP purge the VCL code specified on
http://varnish.projects.linpro.no/wiki/VCLExamplePurging shows as
following:




sub vcl_recv {

   if (req.request == PURGE) {
if (!client.ip ~ purge) {
error 405 Not allowed.;
}
lookup;
}


should it have else so that it becomes

sub vcl_recv {

   if (req.request == PURGE) {
if (!client.ip ~ purge) {
error 405 Not allowed.;
}

else {
lookup;
}

}


Also when I telnet to varnish listen port (not the management port) it
seems to close the connection after about 4-5 seconds automatically.
what could be the issue ? Telnetting to management port works fines.


Thanks.

-Paras


On Wed, Jan 21, 2009 at 8:22 PM, Paras Fadte plf...@gmail.com wrote:
 Hi Poul,

 Can one specify host  when purging using command line ?

 Thank you.

 -Paras

 On Wed, Jan 21, 2009 at 7:45 PM, Poul-Henning Kamp p...@phk.freebsd.dk 
 wrote:
 In message 8318f61f0901210508i25fb1385w91573182d8cd...@mail.gmail.com, 
 Audun
 Ytterdal writes:
On Wed, Jan 21, 2009 at 12:38 PM, Poul-Henning Kamp p...@phk.freebsd.dk 
wrote:
 In message 75cf5800901210319j1a2741bdp171bdffad920b...@mail.gmail.com, 
 Paras Fadte writes:


Does that mean that vcl_miss in this part of the documentation never
would be run?

http://varnish.projects.linpro.no/wiki/VCLExamplePurging

 Well, this is the other way to do purges: look up the single object
 you want, and blast it away.

 That method does not involve any regular expressions, and consequently
 you have to be 100% precise to find the single object you want to
 get rid off.

 --
 Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
 p...@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.


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Poul-Henning Kamp
In message 75cf5800901212121k6647747bg31877e8b1d512...@mail.gmail.com, Paras 
Fadte writes:

should it have else so that it becomes

sub vcl_recv {

   if (req.request == PURGE) {
if (!client.ip ~ purge) {
error 405 Not allowed.;
}

else {
lookup;
}

}

That is not necessary, error is a terminating action.

Also when I telnet to varnish listen port (not the management port) it
seems to close the connection after about 4-5 seconds automatically.
what could be the issue ? Telnetting to management port works fines.

That is intentional, if clients don't send a request, we don't want
to waste resources on them.

The timeout is configurable with param sess_timeout.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Purging contents

2009-01-21 Thread Paras Fadte
Thanks Poul.

On Thu, Jan 22, 2009 at 1:05 PM, Poul-Henning Kamp p...@phk.freebsd.dk wrote:
 In message 75cf5800901212121k6647747bg31877e8b1d512...@mail.gmail.com, Paras
 Fadte writes:

should it have else so that it becomes

sub vcl_recv {

   if (req.request == PURGE) {
if (!client.ip ~ purge) {
error 405 Not allowed.;
}

else {
lookup;
}

}

 That is not necessary, error is a terminating action.

Also when I telnet to varnish listen port (not the management port) it
seems to close the connection after about 4-5 seconds automatically.
what could be the issue ? Telnetting to management port works fines.

 That is intentional, if clients don't send a request, we don't want
 to waste resources on them.

 The timeout is configurable with param sess_timeout.


 --
 Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
 p...@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.

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc