Problems with revision 1643.

2007-07-05 Thread Anup Shukla
Hi All,

A few things are causing trouble in r1463

Varnish always uses uid nobody and gid nogroup.

i did this:
#useradd varnish
#varnishd -u varnish -g varnish 

But, it still complained about group: nogroup not being present.

I added a group nogroup, just to keep varnish happy.

Varnish then complained about my VCL configuration in vcl_fetch()

snip
   if (resp.http.Content-Type ~ text/html) {
  pass;
   }
/snip

Is this something wrong?
The version that i am currently using (1.0.4 20 May 2007) never gave an 
error about resp.http.Content-Type.

Thank you.

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


Re: Varnish Dirty Caching

2007-07-05 Thread Anton Stonor
Poul-Henning Kamp wrote:

 The critical question is how we define backend is down and how
 fast and efficient we can detect it.
 
 Ideas for how to express it in VCL are very welcome.

Maybe naive:

# First, we setup decide how to sniff that a backend is down
#
# options_ping: Send a HTTP OPTIONS (Perlbal does that)
# timeout:  If the backend does not answer within x seconds, it is
#   probably down
# icp:  Abuse the protocol. (Squid + Zope does that)
backend.down_protocol = options_ping | timeout | icp

# What is the timeout limit?
backend.timeout = 30

# How long time should the backend be marked as down before we try
# again?
backend.retry_after = 300


# And then just use it

if(backend.down)



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


Re: Post requests

2007-07-05 Thread Dag-Erling Smørgrav
André Cruz [EMAIL PROTECTED] writes:
 I'm having problems with POST requests. They reach varnish but nothing
 happens and the backend is not contacted.

 I see this in the log:
 11 SessionOpen  c 10.134.145.2 51721

 ...
 11 Debugc Pipe Shut read(read)
 11 Debugc Pipe Shut write(read)

 I found this ticket http://varnish.projects.linpro.no/ticket/47;
 which seemed to refer to my problem but even switching to pipe does
 not solve it.

Pipe Shut comes from the pipe code, so switching *to* pipe won't make
any difference because it already *is* pipe.

This is not an error message, BTW, just an indication that a pipe
session ended.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: logging problems - Pipe Shut

2007-07-05 Thread Gaute Amundsen
 Ah, OK, you won't be able to process log files larger than about 2 GB on
 a 32-bit machine.  I should probably figure out a way to get around
 that.

Ok, now I have set up /var/log/varnish/varnish.log to rotate every hour, and a 
postrotate action on that to pipe through varnishncsa and append 
to /var/log/varnish/varnish.access_log which in turn gets rotated and 
processed by awstats dayly.

That should take care of the 2G limit in varnishncsa at least. 
I was hoping it would help with the logging it self but apparently not..

I have about 20 logfiles by now, all under 100M, and have made various 
observations:

Everything went well during the night. The accesstimes are about a minute past 
the hour, and the last date string in the log corresponds with that.

Then at 09:13 suddenly it's all Pipe Shut read(read) and Pipe Shut 
write(read) again. The situation when I noticed this, about 12:30, this was 
in 'log.1' whith modtime 09:13 and 'log' was still 0 bytes.
I guess that just means warnishlog had stopped responding to SIGHUP.

Wil try to do a restart insted in postrotate to see if runningtime has 
anything to do with it.

That's the logging problem, now for the processing problem:

I made a small script to run varnish(log|ncsa) on every file and get the 
returnstatus. log works fine, and a tail of that diplays sensible output and 
timestamps, but ncsa segfaults on about half of them. 
No pattern discernible..

I tried to make a small python script to feed a log chunk by chunk into ncsa 
on stdin, but I was not able to make that work reliably enough to get any 
hint what precisely is causing the problem. Don't even know if ncsa can work 
like that..
Tried to look for the last output lines from nscalogs in the varnishlog as 
well, but nothing jumps out so far...

Starting to run out of things to try here...
Ideas?

Gaute

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


Re: Mac and regular expressions

2007-07-05 Thread Dag-Erling Smørgrav
Martin Aspeli [EMAIL PROTECTED] writes:
 I think I'm being bitten by a bug related to Mac OS X (10.4) and regular
 expressions.

Looks like MacOS's libc lacks the POSIX regexp API.  Unfortunately,
until we manage to get hold of a MacOS box to test on, there isn't much
we can do to fix the build.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Mac and regular expressions

2007-07-05 Thread Martin Aspeli
Hi,

I think I'm being bitten by a bug related to Mac OS X (10.4) and regular
expressions.

I've build Varnish using MacPorts, and also tried to build manually. To get it
to build manually, I've had to apply this patch:

http://projects.linpro.no/pipermail/varnish-misc/2007-June/000485.html

The result is the same, though.

The default Varnish config works fine, but as soon as I use a regular expression
(e.g. if(req.url ~ \.(css|js)$) { ...} or whatever) in a custom VCL file, I
get this error:

$ /usr/local/sbin/varnishd -a localhost:8080  -f /etc/varnish.conf 
Assert error in mgt_CallCc(), mgt_vcc.c line 214:
  Condition((dlclose(p)) == 0) not true.
  errno = 2 (No such file or directory)
Abort trap

That error is described in http://varnish.projects.linpro.no/ticket/117 and I
added a note there, but I think the underlying issue may be different.

Is there something more I can do to debug this problem? Has anyone else seen it?

Thanks,
Martin

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


Re: Mac and regular expressions

2007-07-05 Thread Martin Aspeli
Buy a Mac Mini? :)

I can help you test if you can give me instructions. My C skills are
perhaps a bit rusty, but I can definitely make it build and try out
things.

Just from a quick Google,
http://developer.apple.com/documentation/Darwin/Reference/Manpages/man3/regex.3.html
seems to suggest that it does have POSIX regex.

Martin

On 7/5/07, Dag-Erling Smørgrav [EMAIL PROTECTED] wrote:
 Martin Aspeli [EMAIL PROTECTED] writes:
  I think I'm being bitten by a bug related to Mac OS X (10.4) and regular
  expressions.

 Looks like MacOS's libc lacks the POSIX regexp API.  Unfortunately,
 until we manage to get hold of a MacOS box to test on, there isn't much
 we can do to fix the build.

 DES
 --
 Dag-Erling Smørgrav
 Senior Software Developer
 Linpro AS - www.linpro.no


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


Re: logging problems - Pipe Shut

2007-07-05 Thread Dag-Erling Smørgrav
Gaute Amundsen [EMAIL PROTECTED] writes:
 I made a small script to run varnish(log|ncsa) on every file and get
 the returnstatus. log works fine, and a tail of that diplays sensible
 output and timestamps, but ncsa segfaults on about half of them.  No
 pattern discernible..

Can you send me one of those?

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Mac and regular expressions

2007-07-05 Thread Dag-Erling Smørgrav
Dag-Erling Smørgrav [EMAIL PROTECTED] writes:
 I'd rather say until the core developers get their hands on a Mac,
 which may happen in a variety of ways.  Linpro is an Apple partner, so
 we may be able to get a good price.

(of course, I'd prefer an XServe or some other 64-bit model, but they
cost real money...)

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Mac and regular expressions

2007-07-05 Thread Dag-Erling Smørgrav
Martin Aspeli [EMAIL PROTECTED] writes:
 Buy a Mac Mini? :)

Sure, what's your credit card number again?  :)

 I can help you test if you can give me instructions.

I don't want code in the repo that I can't test myself, or at least
build.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Mac and regular expressions

2007-07-05 Thread Dag-Erling Smørgrav
Martin Aspeli [EMAIL PROTECTED] writes:
 That's a shame. So what we're saying is that Varnish at this point
 doesn't really support Mac OS X

correct

 and won't unless someone donates a Mac to the core developers?

I'd rather say until the core developers get their hands on a Mac,
which may happen in a variety of ways.  Linpro is an Apple partner, so
we may be able to get a good price.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Away

2007-07-05 Thread Dag-Erling Smørgrav
I'll be away tomorrow and all of next week, with only sporadic Internet
connectivity.  I trust Poul-Henning will take good care of you all while
I'm gone :)

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Regarding url purging

2007-07-05 Thread André Cruz
Hello.

I'm caching pages from different vhosts, say x.com and y.com.

If I want to purge all the data from one of the vhosts how do I do  
it? url.purge x.com.* does not work. I'm a bit confused with the  
syntax since the wiki only talks about paths and not complete URLs.

Thanks for the help,
André


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


Re: Regarding url purging

2007-07-05 Thread Gaute Amundsen
On Thursday 05 July 2007 19:39, André Cruz wrote:
 Hello.

 I'm caching pages from different vhosts, say x.com and y.com.

 If I want to purge all the data from one of the vhosts how do I do
 it? url.purge x.com.* does not work. I'm a bit confused with the
 syntax since the wiki only talks about paths and not complete URLs.

That's not easily done, as far as I have been able to determine.
I've submitted a feature request for it..

As I understand it, you can only use hostname as part of the url when you 
purge by http, but then no wildcards.
You can use full regexps when purging on the console, but then only the path 
is available to match against.

I guess a workaround would be parse the log to make a list of all urls served 
within the expiery limit, do your filtering on that list, and then purge all 
the matching urls one by one by http.

The nsca log contains the full url including host, which i think is somewhat 
unusual, so grepping for that should not be too hard.

Here is the pipe I use to get host as a separate column, that should be a 
start.

/usr/bin/varnishncsa -c -r /var/log/varnish/varnish.log | \
sed -e 's#\(\([A-Z]\+\) \(http://\([^/]*\)\)\(.*\)\)#\4 \2 \5#g' \


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


Q: multiple backends

2007-07-05 Thread Christoph
Hi,

are there any plans to include support for multiple backends in varnish?

It would be great to have either fault-tolerance and/or simple
load-balancing. 

It could be integrated to the proposed backend.down extension. 

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


Re: Regarding url purging

2007-07-05 Thread Gaute Amundsen
On Thursday 05 July 2007 20:30, André Cruz wrote:
 On 2007/07/05, at 19:13, Gaute Amundsen wrote:
  That's not easily done, as far as I have been able to determine.
  I've submitted a feature request for it..

 Where is it so that I can vote for it? :) Do you know if it's
 targeted for 1.1?

http://varnish.projects.linpro.no/ticket/116
1.1? No idea. Don't think there is any voting system either..
Except perhaps bribing DES with a Mac ;-)

  As I understand it, you can only use hostname as part of the url
  when you
  purge by http, but then no wildcards.
  You can use full regexps when purging on the console, but then only
  the path
  is available to match against.

 Eeck.

  I guess a workaround would be parse the log to make a list of all
  urls served
  within the expiery limit, do your filtering on that list, and then
  purge all
  the matching urls one by one by http.

 Thanks for your help but I think I'll wait either for regexp on http
 purging or full urls on console purging, which seem like basic
 functions to have anyway.

Hm, well, varnish is a pretty young project still you know :)
I think the majority of users so far are one site shops, or can reliably 
predict what wil have to be purged when something is updated..

Myself I'd rather have better url rewriting to be honest,
http://varnish.projects.linpro.no/ticket/77
then I could phase out apache from our current varnish-apache-zope setup.

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


Re: logging problems - Pipe Shut

2007-07-05 Thread Gaute Amundsen
That did the trick for the processing :-D

Only the logging itself left then.
With som luck logger restarts on logrotate every hour will keep that stable 
til 1.1 is out :-)

Gaute

On Thursday 05 July 2007 20:20, Gaute Amundsen wrote:
 On Thursday 05 July 2007 17:18, Dag-Erling Smørgrav wrote:
  Dag-Erling Smørgrav [EMAIL PROTECTED] writes:
   Gaute Amundsen [EMAIL PROTECTED] writes:
log.1 works, and log.2 segfaults
  
   They both work fine here, with varnishncsa from trunk (although on a
   64-bit machine)
 
  I just realized - maybe you ran across the bug that was fixed in r1531.

 You mean this one?
 Wil try that then.

 Gaute

 Index: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
 ===
 --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c (revision 1525)
 +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c (revision 1531)
 @@ -156,5 +156,5 @@

   /* trim trailing space */
 - while (str[len - 1] == ' ')
 + while (len  str[len - 1] == ' ')
   --len;

-- 
Programmerer - Pixelhospitalet AS
Tørkoppveien 10, 1570 Dilling
Tlf. 24 12 97 81 - 9074 7344
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc