Re: Blew away .../var/varnish/HOSTNAME/ -- broke varnishstat, how to recover?

2008-06-02 Thread Michael S. Fischer
On Mon, Jun 2, 2008 at 7:57 AM, Chris Shenton <[EMAIL PROTECTED]>
wrote:

> We have to fill out pounds of paperwork in order to take any outage on
> a public server, no matter how small.  Is there a way to restart
> Varnish without any downtime -- to continue accepting but holding
> connections until restarted, rather like Apache's "apachectl graceful"
> does?  Other ideas?


Can you avoid the problem by putting your Varnish servers behind a load
balancer?  That way, you can preemptively disable the server from taking
traffic on the LB side prior to restarting Varnish, thereby eliminating any
perceivable customer effect.

Also, be careful about using "apachectl graceful" (especially combined with
log rotation), as connections that are currently idle but which may never
receive traffic again will not be terminated.  I consider it too leaky to
use.

Best regards,

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


Varnish/Swap usage and network timeouts

2008-06-02 Thread Erik Steigler

Hello,
I have 2 machines running varnish which handles around 1000 requests per 
second each and sometimes the machines will just stop responding to any 
network communication. A coworker used wireshark to check the connection 
and saw a whole lot of tcp retransmissions. Normally I would suspect 
some sort of network buffer issue but there is nothing in the logs at 
all. This is on FreeBSD  6.3 with a default 64 bit kernel with bge 
network cards. They are both running varnish-trunk revision 2635. 
Attached is the VCL file that is currently running. Varnish is started 
with the following options:
file,/vol/data1/varnish.cache,90% -t 259200 -h classic,59 -p 
lru_interval=3600


The only suspicious things I've found are: Varnish says it is using 372G 
of virtual memory when I told it to use a 58gb file and there is only 
2gb of physical memory in the machine and there is pretty constant 
swapping going on, mostly under 500K but it seems to be pretty constant 
no matter the number of connections and such. The amount of swap space 
in the machine is 4gb and things are using 1.1gb.


Threads don't seem to be a problem, as the highest I've seen it is at 
500 and that was after an extended period of time around 250 or so. So I 
don't think I'm running into thread issues


So I guess I'm asking if anyone has any other suggestions other then 
reinstalling to FreeBSD 7.0 which seems to be the best solution I can 
see. If that is the best solution, what is the optimal FreeBSD 
configuration for Varnish? Lots of swap space? No swap space? Currently 
the mmap-ed file is on an SSD so one alternative I thought of was to 
make the entire SSD part of swap and use the malloc option and get rid 
of any regular disk basked swap.


Thanks for any help,
Erik


backend default {
.host = "xzy.com";
.port = "80";
}

sub vcl_recv {
  if (req.url ~ "\.js|css$") {
if (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
unset req.http.accept-encoding;
}
  } else {
unset req.http.accept-encoding;
  }


  unset req.http.Cookie;
  set   req.grace = 10m;
}

sub vcl_fetch {
  set   obj.http.P3P = "CP='NOI CURa ADMa DEVa TAIa OUR BUS IND UNI COM 
NAV INT', policyref='http://www.okcupid.com/w3c/p3p.xml'";
  set   obj.grace = 10m;
  if (obj.ttl < 259200s) {
set obj.ttl = 259200s;
  }
}

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


Re: Blew away .../var/varnish/HOSTNAME/ -- broke varnishstat, how to recover?

2008-06-02 Thread Chris Shenton

On Jun 2, 2008, at 11:19 AM, Poul-Henning Kamp wrote:
>
> Yes, restarting varnish (completely: ie both manager and child  
> process)
> should recreate it with no side effects.
>
> Varnish doesn't spend long time on startup, so I would just get it
> done and over with.

Just tried it on a QA server and it restarts in about 0.25 seconds,  
and re-creates the directory with the _.vsl file.  Have to see if my  
overlords are OK with that.  Thanks.
>
>
> (In the meantime, if you have enabled the telnet option, you can still
> see the stats through the CLI interface.)

I do have that and can ask it for stats. Thanks for the reminder. 
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Blew away .../var/varnish/HOSTNAME/ -- broke varnishstat, how to recover?

2008-06-02 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Chris Shenton write
s:

>What's the recommended way to re-create this directory?  I'm assuming  
>restarting Varnish will re-create it but want to be sure.

Yes, restarting varnish (completely: ie both manager and child process)
should recreate it with no side effects.

>We have to fill out pounds of paperwork in order to take any outage on  
>a public server, no matter how small.  Is there a way to restart  
>Varnish without any downtime -- to continue accepting but holding  
>connections until restarted, rather like Apache's "apachectl graceful"  
>does?  Other ideas?

Varnish doesn't spend long time on startup, so I would just get it
done and over with.

You are in no rush however, so you can schedule it for whenever
you want.

(In the meantime, if you have enabled the telnet option, you can still
see the stats through the CLI interface.)

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | 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


Blew away .../var/varnish/HOSTNAME/ -- broke varnishstat, how to recover?

2008-06-02 Thread Chris Shenton
We're using varnish for a public site, works beautifully and handled  
getting slashdotted gracefully -- many thanks!

We built it with "zc.buildout" which creates .../parts/varnish/install/ 
var/varnish/FQDN/... and others.  In a recent update, I accidentally  
blew away the .../var/varnish/FQDN directory which contained a few  
files that seem necessary for "varnishstat" and perhaps others to work.

  bin.XXkP5ZYv
  _.c
  _.vsl

$ varnishstat
Cannot open /usr/local/mastersite_buildout/parts/varnish/install/var/ 
varnish/FQDN/_.vsl: No such file or directory

Varnish continues to serve well, so I haven't restarted.

What's the recommended way to re-create this directory?  I'm assuming  
restarting Varnish will re-create it but want to be sure.

We have to fill out pounds of paperwork in order to take any outage on  
a public server, no matter how small.  Is there a way to restart  
Varnish without any downtime -- to continue accepting but holding  
connections until restarted, rather like Apache's "apachectl graceful"  
does?  Other ideas?

Thanks.

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


Re: Conditional caching question

2008-06-02 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, David Pratt writes:

>Hi. In most cases, I want a request to be passed to a backend where it 
>will be handled by server. If frequency is high, however; I want to add 
>the object to varnish cache and have varnish handle it. I am not worried 
>about a mechanism to keeping track of frequency of requests. Question is 
>what is available to me to add an object/path to the varnish cache if it 
>was originally passed? 

That's the problem, we don't have any place to hold statistics for
objects that get "pass" treatment, so we would have no way of knowing
that a particular object was suitable for caching.

You could write a program that extracts that information from the
varnishlog on the fly (sort of like varnishtop), but then we need
a mechanism to get from there to tell varnishd that this or that
object should be cached from now on.

I wouldn't say that your way of using varnish is backwards relative
to the design objectives, but you do come close, since we assumed
caching by default, and pass as exception, rather than the other
way around.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | 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