Re: Weird log entries

2009-04-06 Thread Alecs Henry
So, after a while digging through other stuff I realized what the (null)
entries are.
They are cache misses.
For (apparently) every miss there's an entry on varnishncsa for that miss,
and it's logged as a bunch of nulls.
I haven't figured out what the other entries are though.
I still see some entries (not as many as the null ones) with the date field
set to [00/Jan/1900:00:00:00 +], with all the other information valid
(URL, Referer, BackendName, etc..) except for the object size, which is set
to (null) and ther server response code (also (null)).
There are also entries that the only field set is the server response (200
or 404 -- these have the date field set correctly) and some entries with the
host (or where the backend name should go) set to 127.0.0.1 and the other
fields set correctly.

One thing though, in none of the entries (correct, broken or plain weird)
the object size is set, all I see are -, except for one entry that had it
set (strangely enough, favicon.ico!) and even then, only once.

If anybody else has seen this stuff or know anything that might help
explain, I'd greatly appreciate some help.
I can also send you any information you might deem necessary in order to
figure this stuff out.

This is the varnish package for debian (2.0.3-2_amd64) all with HTTP/1.1
requests.

Thanks!

Alecs


On Mon, Feb 9, 2009 at 5:29 PM, Alecs Henry alecshe...@gmail.com wrote:

 Hi Nick,

 I forgot to say... It's varnish-trunk.
 But I saw it on both varnish 2.0.1 and 2.0.2.

 Alecs


 On Mon, Feb 9, 2009 at 6:20 PM, Nick Loman n...@loman.net wrote:

 Alecs Henry wrote:

  EDITED TO INCLUDE THE ORIGINAL MESSAGE...
 Hi guys,

 I was wondering if any of you has seen the following log entries when
 using varnishncsa:
 127.0.0.1 - - [00/Jan/1900:00:00:00 +] (null) (null) (null) (null)
 - - -

 Those are coupled with:
 127.0.0.1 - - [09/Feb/2009:19:39:46 +] (null) (null) (null) 200
 39678 - -
 I can see an object in the page that has that size (image) -- through
 firebug, but the object didn't load into the browser until I hit reload.

 And there are also many entries like the following:
 127.0.0.1 - - [09/Feb/2009:19:39:52 +] GET
 http://www.example.com/img/mod.gif HTTP/1.1 200 951 
 http://www.example.com/style.css; Mozilla/5.0 (X11; U; Linux x86_64;
 en; rv:1.9.0.5) Gecko/2008121623 Ubuntu/8.10 (intrepid) Firefox/3.0.5

 These entries are from communication with the backend server

 I expected it to show the backend name instead of 127.0.0.1.

 Is there an explanation?

 Thanks!

 Alecs



 I've seen log entries like this for HTTP 1.0 requests (using Varnish 1.2),
 as that version of Varnish did not have support for parsing HTTP 1.0
 headers.

 Cheers,

 Nick.





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


Weird log entries

2009-02-09 Thread Alecs Henry
Hi guys,

I was wondering if any of you has seen the following log entries when using
varnishncsa:
127.0.0.1 - - [00/Jan/1900:00:00:00 +] (null) (null) (null) (null) -
- -

Those are coupled with:
127.0.0.1 - - [09/Feb/2009:19:39:46 +] (null) (null) (null) 200 39678
- -
I can see an object in the page that has that size (image) -- through
firebug, but the object didn't load into the browser until I hit reload.

And there are also many entries like the following:
127.0.0.1 - - [09/Feb/2009:19:39:52 +] GET
http://www.example.com/img/mod.gif HTTP/1.1 200 951 
http://www.example.com/style.css; Mozilla/5.0 (X11; U; Linux x86_64; en;
rv:1.9.0.5) Gecko/2008121623 Ubuntu/8.10 (intrepid) Firefox/3.0.5

These entries are from communication with the backend server

I expected it to show the backend name instead of 127.0.0.1.

Is there an explanation?

Thanks!

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


Re: Weird log entries

2009-02-09 Thread Alecs Henry
Hi Nick,

I forgot to say... It's varnish-trunk.
But I saw it on both varnish 2.0.1 and 2.0.2.

Alecs

On Mon, Feb 9, 2009 at 6:20 PM, Nick Loman n...@loman.net wrote:

 Alecs Henry wrote:

  Those are coupled with:
 127.0.0.1 - - [09/Feb/2009:19:39:46 +] (null) (null) (null) 200
 39678 - -
 I can see an object in the page that has that size (image) -- through
 firebug, but the object didn't load into the browser until I hit reload.


 I've seen log entries like this for HTTP 1.0 requests (using Varnish 1.2),
 as that version of Varnish did not have support for parsing HTTP 1.0
 headers.

 Cheers,

 Nick.




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


What to do when the backend sends no caching information?

2008-12-12 Thread Alecs Henry
Hi All,

In testing varnish in different situations, I came accross a backend that
sends no caching information in its responses, no Expires, cache-control or
anything.
Ok, I thought, I'll just set the TTL on that object (namely an html page) in
VCL.
Well, turns out varnish may be setting the ttl all right (I do it in
vcl_fetch, but frankly there really is no way to see if it is set correctly
or not! or is there?) but the page always gets a PASS, never a HIT. Age: is
set to 0 by varnish.

Thanks for all the help!

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


Backend response

2008-12-12 Thread Alecs Henry
Hi!

Is there a place where I can alter the backend response before it is
inserted into the cache?

Thanks!

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


Re: Varnishncsa

2008-12-12 Thread Alecs Henry
Thanks Dag, I must have missed it!

Alecs

On Fri, Dec 12, 2008 at 7:08 PM, Dag-Erling Smørgrav d...@des.no wrote:

 Alecs Henry alecshe...@gmail.com writes:
  What about cookies? Can varnish log cookie values? Or does it fit in
  the same problem as the first message?

 Varnish can and does log cookies.  See the varnishlog(1) man page.

 DES
 --
 Dag-Erling Smørgrav - d...@des.no

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


Re: Backend response

2008-12-12 Thread Alecs Henry
Hi Per,

I'm looking into changing the headers all right! Where do I do that in VCL?
I wanted to try to set some cache control headers before the object was put
into varnish cache.

Does that even make sense?

Thanks!

Alecs

On Fri, Dec 12, 2008 at 7:20 PM, Per Buer pe...@linpro.no wrote:

 Alecs Henry wrote:
  Hi!
 
  Is there a place where I can alter the backend response before it is
  inserted into the cache?

 You can remove, add and alter headers - but there isn't much you can do
 to the content. Except to ESI, process it, I guess.

 Per.

 --
 http://linpro.no/ | http://redpill.se/


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


Re: What to do when the backend sends no caching information?

2008-12-12 Thread Alecs Henry
Hi Per,

I'm actually using the cookies in the cache (using the information provided
on the website -- set req.hash += req.http.cookie;) and it works just fine!
One thing that the backend does is vary on user-agent, not only
content-encoding (I've removed the UA vary on the response, though).

So looking into varnishlog I can see the pass, even after the hash is shown
correctly.

Any pointers?

THanks!

Alecs

On Fri, Dec 12, 2008 at 7:21 PM, Per Buer pe...@linpro.no wrote:

 Hi,

 Alecs Henry wrote:
 
  Well, turns out varnish may be setting the ttl all right (I do it in
  vcl_fetch, but frankly there really is no way to see if it is set
  correctly or not! or is there?) but the page always gets a PASS, never a
  HIT. Age: is set to 0 by varnish.

 The client probably sends a cookie. When varnish sees a cookie it does a
 pass. Please see the FAQ on notes on how to deal with this.

 Per.

 --
 http://linpro.no/ | http://redpill.se/


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


Re: Varnish Error 503 Service Unavailable

2008-11-11 Thread Alecs Henry
Hi there!

I have the exact same problem, and it comes and goes as it pleases..
I'm testing varnish with different backends (different customers sites in
the same instance) and every once in a while it locks up at the same place
(the X-Forwarded-For header on varnishlog) for any site. Not the others
though, as they are accessible through varnish just fine. And after a while
of working the cache the site that locks up comes back to life.
This is what varnishlog shows just before the 503 error:
Request:
9 SessionOpen  c MY_IP_ADDRESS 56186 VARNISH_SERVER_IP:80
9 ReqStart c MY_IP_ADDRESS 56186 444163595
9 RxRequestc GET
9 RxURLc /
9 RxProtocol   c HTTP/1.1
9 RxHeader c Host: BACKEND_HOSTNAME
9 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en; rv:
1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3
9 RxHeader c Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
9 RxHeader c Accept-Language: q=0.8,en-us;q=0.5,en;q=0.3
9 RxHeader c Accept-Encoding: gzip,deflate
9 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
9 RxHeader c Keep-Alive: 300
9 RxHeader c Connection: keep-alive
9 VCL_call c recv
9 VCL_return   c lookup
9 VCL_call c hash
9 VCL_return   c hash
9 VCL_call c miss
9 VCL_return   c fetch
9 Backend  c 17 BACKEND_NAME BACKEND_NAME
   17 TxRequest- GET
   17 TxURL- /
   17 TxProtocol   - HTTP/1.1
   17 TxHeader - Host: BACKEND_HOSTNAME
   17 TxHeader - User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en; rv:
1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3
   17 TxHeader - Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   17 TxHeader - Accept-Language: q=0.8,en-us;q=0.5,en;q=0.3
   17 TxHeader - Accept-Encoding: gzip,deflate
   17 TxHeader - Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   17 TxHeader - X-Varnish: 444163595
   17 TxHeader - X-Forwarded-For: MY_IP_ADDRESS

=== Long waiting time (sorry, didn't really time it, but it's like 5
minutes)
Response:
   17 BackendClose - BACKEND_NAME
9 VCL_call c error
9 VCL_return   c deliver
9 Length   c 452
9 VCL_call c deliver
9 VCL_return   c deliver
9 TxProtocol   c HTTP/1.1
9 TxStatus c 503
9 TxResponse   c Service Unavailable
9 TxHeader c Server: Varnish
9 TxHeader c Retry-After: 0
9 TxHeader c Content-Type: text/html; charset=utf-8
9 TxHeader c Content-Length: 452
9 TxHeader c Date: Tue, 11 Nov 2008 11:49:00 GMT
9 TxHeader c X-Varnish: 444163595
9 TxHeader c Age: 945
9 TxHeader c Via: 1.1 varnish
9 TxHeader c Connection: close
9 ReqEnd   c 444163595 1226403195.496297359 1226404140.571825743
0.000217438 945.075489759 0.38624
9 SessionClose c error
9 StatSess c MY_IP_ADDRESS 56186 945 1 1 0 0 0 236 452
0 StatAddr - MY_IP_ADDRESS 0 427594 323 1326 0 0 548 435744 9005255
9 SessionOpen  c MY_IP_ADDRESS 44754 VARNISH_SERVER_IP:80
9 ReqStart c MY_IP_ADDRESS 44754 444163596
9 RxRequestc GET
9 RxURLc /favicon.ico
9 RxProtocol   c HTTP/1.1
9 RxHeader c Host: BACKEND_HOSTNAME
9 RxHeader c User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en; rv:
1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3
9 RxHeader c Accept: image/png,image/*;q=0.8,*/*;q=0.5
9 RxHeader c Accept-Language: q=0.8,en-us;q=0.5,en;q=0.3
9 RxHeader c Accept-Encoding: gzip,deflate
9 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
9 RxHeader c Keep-Alive: 300
9 RxHeader c Connection: keep-alive
9 VCL_call c recv
9 VCL_return   c lookup
9 VCL_call c hash
9 VCL_return   c hash
9 VCL_call c miss
9 VCL_return   c fetch
9 Backend  c 14 BACKEND_NAME BACKEND_NAME
   14 TxRequest- GET
   14 TxURL- /favicon.ico
   14 TxProtocol   - HTTP/1.1
   14 TxHeader - Host: BACKEND_HOSTNAME
   14 TxHeader - User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en; rv:
1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3
   14 TxHeader - Accept: image/png,image/*;q=0.8,*/*;q=0.5
   14 TxHeader - Accept-Language: q=0.8,en-us;q=0.5,en;q=0.3
   14 TxHeader - Accept-Encoding: gzip,deflate
   14 TxHeader - Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   14 TxHeader - X-Varnish: 444163596
   14 TxHeader - X-Forwarded-For: MY_IP_ADDRESS

Any one else seeing this? Any one have any idea why this happens?

Cheers

Alecs

On Tue, Nov 11, 2008 at 5:42 AM, Brano [EMAIL PROTECTED] wrote:

 Hi all,

 recently we installed Varnish on our server. Everything works fine,
 but on download we get this error:

 http://www.opensubtitles.org/en/download/file/1951965961

 Varnish Error 503 Service Unavailable

 

Re: Frontend caching to multiple sites

2008-11-05 Thread Alecs Henry
Hi Espen,

Thanks for the answer!

Is there a way to accomplish this using different VCLs?
I ask it because I'm trying to figure out a way to make it automatic. As in
if I have a new customer, I'd just fill out a form (with the customer
details like domain name, backend server, other configuration) and a little
system working under the hood would generate the VCL file, send it to the
varnish server and load it.

If I use one VCL file for everybody, how do I reload this VCL when I need to
change it? Is it necessary to reload varnish? Would it present downtime?

Thanks!!

Alecs



On Wed, Nov 5, 2008 at 5:58 AM, Espen Braastad [EMAIL PROTECTED] wrote:

 Alecs Henry wrote:

 I want to set up varnish as a reverse proxy/cache to multiple customer
 sites.
 As in, I have 10 different customers, each with its own web site (domains)
 with their own necessities, compression, cookie, authentication, etc; each
 customer is a different setup from the other, so I thought OK! Let's use
 a
 different VCL for each customer and all will be fine.

 Bear with me here, I've just started playing with varnish, but it seems
 that
 I can't create a different VCL file for each customer and load it in
 varnish
 (vcl.use ...) as varnish will stop responding for the previous site and
 start responding only to the new one (active configuration). Meaning, the
 content that is served is only the content from the new site, even if
 using
 the correct domain.

 How can I go about setting this up?
 I'm using Varnish 2.0.1, just downloaded and compiled it today.


 Hi,

 You can try something like this in one VCL:

 sub vcl_recv {
  if (req.http.host ~ ^(www\.)site1\.com$){
   # foo
  }

  if (req.http.host ~ ^(www\.)site2\.com$){
   # bar
  }

  if (req.http.host ~ ^(www\.)site3\.com$){
   # baz
  }

  # Unknown host
  error 403;
 }

 --
 mvh
 Espen Braastad,
 +47 21 54 41 37
 [EMAIL PROTECTED]
 Linpro AS - Ledende på Linux



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


TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi guys,

Is there a variable that I can print on the response header that will give
me the cache lookup result such as TCP_HIT or TCP_MISS?

Thanks!!

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


Re: TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi Per,
Thanks for the reply!

The issue here is not how to add the header, that is OK, I can do it just
fine (even added the Foo: bar header just for the fun of it!). The problem
is WHAT variable I can use that contains that information (MISS or HIT).
Is there more documentation on the variables available than what is in
vcl(7)?
Or anywhere else for that matter.

Thanks,

Alecs

On Wed, Nov 5, 2008 at 3:10 PM, Per Buer [EMAIL PROTECTED] wrote:

 Alecs Henry skrev:
  Hi guys,
 
  Is there a variable that I can print on the response header that will
  give me the cache lookup result such as TCP_HIT or TCP_MISS?

 I guess you can add the relevant header in vcl_hit and vcl_miss

 See the FAQ:
 http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader

 Just add a
 sub vcl_hit {
  # add code from faq here
 }



 --
 http://linpro.no/ | http://redpill.se/


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


Re: TCP_HIT header

2008-11-05 Thread Alecs Henry
Hi Per,

Here's what I got:
-
vcl.load test /usr/local/etc/varnish/configs/test.vcl
106 267
*Variable 'obj.http.X-Cache' not accessible in method 'vcl_miss'.*
At: (/usr/local/etc/varnish/configs/test.vcl Line 62 Pos 13)
set obj.http.X-Cache = TCP_MISS from  server.ip;
--
VCL compilation failed
-

It works just fine for vcl_hit though.
Any ideas?

Alecs

On Wed, Nov 5, 2008 at 3:59 PM, Per Buer [EMAIL PROTECTED] wrote:

 Hi.

 As I said. Add two different headers. One you add in vcl_hit and one
 (preferably a different one) in vcl_miss. You need no variables. The
 code in vcl_hit will be run for a hit and vcl_miss will be run for a miss.

 Check out the getting started guide, the FAQ and the VCL-page on Wiki if
 you seek documentation. Thats all there is, at the moment.

 Per.




 Alecs Henry skrev:
  Hi Per,
  Thanks for the reply!
 
  The issue here is not how to add the header, that is OK, I can do it
  just fine (even added the Foo: bar header just for the fun of it!). The
  problem is WHAT variable I can use that contains that information (MISS
  or HIT).
  Is there more documentation on the variables available than what is in
  vcl(7)?
  Or anywhere else for that matter.
 
  Thanks,
 
  Alecs
 
  On Wed, Nov 5, 2008 at 3:10 PM, Per Buer [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  Alecs Henry skrev:
   Hi guys,
  
   Is there a variable that I can print on the response header that
 will
   give me the cache lookup result such as TCP_HIT or TCP_MISS?
 
  I guess you can add the relevant header in vcl_hit and vcl_miss
 
  See the FAQ:
  http://varnish.projects.linpro.no/wiki/FAQ#HowdoIaddaHTTPheader
 
  Just add a
  sub vcl_hit {
   # add code from faq here
  }
 
 
 
  --
  http://linpro.no/ | http://redpill.se/
 
 


 --
 Per Buer - Leder Infrastruktur og Drift - Redpill Linpro
 Telefon: 21 54 41 21 - Mobil: 958 39 117
 http://linpro.no/ | http://redpill.se/


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