Re: Danish characters in vcl_error.

2009-03-27 Thread Audun Ytterdal
You have to html-encode the danish characters..

Like this:

   h1Beklager, en feil har oppstaring;tt paring; en av VGs tjenester/h1



On Fri, Mar 27, 2009 at 2:12 PM, Lars Jørgensen i...@gyldendal.dk wrote:
 Hi,

 I'm doing this:

 sub vcl_error {
     set obj.http.Content-Type = text/html; charset=utf-8;
     synthetic {
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
 html
   body
     h1Vi arbejder på systemet /h1
     body
 /html
 };
     return (deliver);

 And getting this (omitting DOCTYPE for clarity):

 html
  body
    h1Vi arbejder p�7703�7645 systemet /h1
    body
 /html

 What am I doing wrong?


 --
 Lars Jørgensen

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




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


Memory Usage when using malloc

2008-08-15 Thread Audun Ytterdal
I need some help to understand this

I have a 64bit server with 32GB of RAM and 60GB SWAP

And varnish is running with these parameters

/usr/sbin/varnishd -a :80 -f /etc/varnish/nettby.vcl -T 127.0.0.1:82 -t
120 -u varnish -g varnish -p thread_pool_add_delay 100 -p
thread_pool_timeout 600 -p client_http11 on -p lru_interval 3600 -s
malloc,30G -P /var/run/varnish.pid

malloc'ed 30G of memory.. So in theory I should not even need swap.

But

[EMAIL PROTECTED] ~]# free -m
 total   used   free sharedbuffers cached
Mem: 32242  31735507  0  0 92
-/+ buffers/cache:  31642600
Swap:59871  51322   8549


The machine is using 51GB of swap and is swapping in pages frequently

[EMAIL PROTECTED] ~]# vmstat 1
procs ---memory-- ---swap-- -io --system--
-cpu--
 r  b   swpd   free   buff  cache   si   sobibo   in   cs us sy
id wa st
 0  0 52549748 446992780  96284   29   1148   15711  4 
2 92  1  0
 0  0 52549708 530360780  96348  2800   280 0 9654 6935  4 
8 87  1  0
 0  0 52549708 528160780  9642000 0 0 6785 7560  2 
2 96  0  0
 0  0 52549664 526668780  96316  3160   316 0 6570 7350  2 
2 95  1  0
 0  0 52549648 524932780  96396  1040   104 0 6300 7456  2 
1 96  0  0
 0  0 52549644 523372780  96400   28028 0 6013 7099  2 
2 96  0  0
 0  0 52549640 521884788  96424   2802828 5649 7343  2 
2 96  0  0



[EMAIL PROTECTED] ~]# varnishstat -1
client_conn2089633996   362.23 Client connections accepted
client_req 8345199749  1446.62 Client requests received
cache_hit  8289156139  1436.90 Cache hits
cache_hitpass1610 0.00 Cache hits for pass
cache_miss   53623537 9.30 Cache misses
backend_conn 53621117 9.30 Backend connections success
backend_fail 4031 0.00 Backend connections failures
backend_reuse   0 0.00 Backend connections reuses
backend_recycle 0 0.00 Backend connections recycles
backend_unused  0 0.00 Backend connections unused
n_srcaddr7689  .   N struct srcaddr
n_srcaddr_act4164  .   N active struct srcaddr
n_sess_mem  59601  .   N struct sess_mem
n_sess  64719  .   N struct sess
n_object  2025596  .   N struct object
n_objecthead  2025576  .   N struct objecthead
n_smf   0  .   N struct smf
n_smf_frag  0  .   N small free smf
n_smf_large 0  .   N large free smf
n_vbe_conn106  .   N struct vbe_conn
n_bereq96  .   N struct bereq
n_wrk  78  .   N worker threads
n_wrk_create15968 0.00 N worker threads created
n_wrk_failed0 0.00 N worker threads not created
n_wrk_max   19191968933.27 N worker threads limited
n_wrk_queue 0 0.00 N queued work requests
n_wrk_overflow  21012861936.43 N overflowed work requests
n_wrk_drop   31202342 5.41 N dropped work requests
n_backend   1  .   N backends
n_expired31600718  .   N expired objects
n_lru_nuked  20008124  .   N LRU nuked objects
n_lru_saved 0  .   N LRU saved objects
n_lru_moved 779599235  .   N LRU moved objects
n_deathrow  0  .   N objects on deathrow
losthdr   196 0.00 HTTP header overflows
n_objsendfile   0 0.00 Objects sent with sendfile
n_objwrite 6674989721  1157.09 Objects sent with write
n_objoverflow   0 0.00 Objects overflowing workspace
s_sess 2073648637   359.46 Total Sessions
s_req  8345234372  1446.62 Total Requests
s_pipe  0 0.00 Total pipe
s_pass  0 0.00 Total pass
s_fetch  53620083 9.29 Total fetch
s_hdrbytes   2924438007698506943.34 Total header bytes
s_bodybytes  13839780950697   2399088.22 Total body bytes
sess_closed  54123498 9.38 Session Closed
sess_pipeline   0 0.00 Session Pipeline
sess_readahead   42322579 7.34 Session Read Ahead
sess_herd  8270331676  1433.64 Session herd
shm_records  347828089203 60295.05 SHM records
shm_writes14631506809  2536.33 SHM writes
shm_flushes908314 0.16 SHM flushes due to overflow
shm_cont 14245861 2.47 SHM MTX contention
sm_nreq 0 0.00 allocator requests
sm_nobj   

Performance options for trunk

2008-05-30 Thread Audun Ytterdal
I run trunk in front of a site. I have 3 varnishservers, all with 32GB

of ram serving only small pictures, thumbnails and profile pictures. The
cacheset is pretty large (1.5 TB) and changing much over time. And
before you all ask why I don't just server partitioned data from several
apache/nginx/lighttpd servers It's because we're not there yet. The
varnishes all fetch their content from one lighttpd server .

I run into the Thread pileup-problem

I've set threadlimit to 1500 and it usually lies between 80 and 700.
While restarting it hits the 1500 limit and stays there for a few
minutes. Then it gradualy manages to controll traffic and ends up around
80 threads. It usually grows a bit. But not over 700-1000 ish. But
suddenly, under high traffic it goes up to the limit beeing 1500 or 4000
or whatever i set it to. Then it stays there and usualy never recovers
without a restart.
I guess it's because the backend at some point answers slowly. But is
there a way to easier get out of this situation.

Running varnish like this:

(redhat 4.6 32 GB RAM)

/usr/sbin/varnishd -a :80 -f /etc/varnish/nettby.vcl -T 127.0.0.1:82 -t
120 -w 2,2000,30 -u varnish -g varnish -p client_http11 on -p
thread_pools 4 -p thread_pool_max 4000 -p listen_depth 4096 -p
lru_interval 3600 -h classic,59 -s
file,/var/varnish/varnish_storage.bin,30G -P /var/run/varnish.pid

and for testing purposes

(redhat 5.1 32 GB RAM)

varnish  22959 17.1 45.2 20187068 14938024 ?   Sl   May29 160:40
/usr/sbin/varnishd -a :80 -f /etc/varnish/nettby.vcl -T 127.0.0.1:82 -t
120 -u varnish -g varnish -p thread_pools 4 -p thread_pool_max 2000 -p
client_http11 on -p listen_depth 4096 -p lru_interval 3600 -h
classic,59 -s malloc,60G -P /var/run/varnish.pid

Each varnish handles about 3000 req/s before it caves in.

Any suggestions?

Are the parameters sane?

--
Audun



*
Denne fotnoten bekrefter at denne e-postmeldingen ble
skannet av MailSweeper og funnet fri for virus.
*
This footnote confirms that this email message has been 
swept by MailSweeper for the presence of computer viruses.
*

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


default.vcl

2008-03-26 Thread Audun Ytterdal
According to trunk/varnish-cache/bin/varnishd/mgt_vcc.c (line 80 to 160) 
this is the default.vcl running if you have just defined a default 
backend and nothing else:

Is the fix only to adjust the default.vcl and the man page to reflect 
this? (I could make a document-patch :-)

( #*# are my comments)

sub vcl_recv {
 if (req.request != \GET\ 
   req.request != \HEAD\ 
   req.request != \PUT\ 
   req.request != \POST\ 
   req.request != \TRACE\ 
   req.request != \OPTIONS\ 
   req.request != \DELETE\) {
 /* Non-RFC2616 or CONNECT which is weird. */
 pipe;

#*# This probably prevents squid like PURGE commands as mentioned in the 
#*# man page

 }
 if (req.http.Expect) {
 /* Expect is just too hard at present. */
 pipe;
 }
 if (req.request != \GET\  req.request != \HEAD\) {
 /* We only deal with GET and HEAD by default */
 pass;

#*# This one does pipe in default.vcl and pass here

 }
 if (req.http.Authenticate || req.http.Cookie) {
 /* Not cacheable by default */
 pass;
 }
 lookup;

}

sub vcl_pipe {
 pipe;
}

sub vcl_pass {
 pass;
}

sub vcl_hash {
 set req.hash += req.url;
 if (req.http.host) {
 set req.hash += req.http.host;
 } else {
 set req.hash += server.ip;
 }
 hash;

#*# Is set.req.hash += obj.http.Vary done internaly in varnish?

}

sub vcl_hit {
 if (!obj.cacheable) {
 pass;
 }
 deliver;
}

sub vcl_miss {
 fetch;
}

sub vcl_fetch {
 if (!obj.valid) {
 error obj.status;
 }
 if (!obj.cacheable) {
 pass;
 }
 if (obj.http.Set-Cookie) {
 pass;
 }
 set obj.prefetch =  -30s;

#*# This is new. Will it do it for all objects. Even the rare just
#*# requested once. They would be in the cache forever?

 insert;
}
sub vcl_deliver {
 deliver;
}
sub vcl_discard {
 discard;
}
sub vcl_prefetch {
 fetch;
}
sub vcl_timeout {
 discard;
};




*
Denne fotnoten bekrefter at denne e-postmeldingen ble
skannet av MailSweeper og funnet fri for virus.
*
This footnote confirms that this email message has been 
swept by MailSweeper for the presence of computer viruses.
*

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


Re: default.vcl

2008-03-26 Thread Audun Ytterdal
Audun Ytterdal wrote:
 According to trunk/varnish-cache/bin/varnishd/mgt_vcc.c (line 80 to 160)
 this is the default.vcl running if you have just defined a default
 backend and nothing else:
 
 Is the fix only to adjust the default.vcl and the man page to reflect
 this? (I could make a document-patch :-)

http://varnish.projects.linpro.no/ticket/135

--
Audun

*
Denne fotnoten bekrefter at denne e-postmeldingen ble
skannet av MailSweeper og funnet fri for virus.
*
This footnote confirms that this email message has been 
swept by MailSweeper for the presence of computer viruses.
*

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


Re: Debugging of Child dies under heavy load and empty cache

2008-02-21 Thread Audun Ytterdal

 spassert(sp-vcl == 0)

Well, not really, forgot to == 0..

 I got a ton of these
 
 start child pid 30356
 Child said (2, 30356): Child starts
 Child said (2, 30356): managed to mmap 32212254720 bytes of 32212254720
 Child said (2, 30356): Ready
 Child said (2, 30356): panic in SES_Delete() at cache_session.c:340
 Child said (2, 30356): assertion failed: sp-vcl
 Child said (2, 30356): sp = 0x327cf5ec08 {
 Child said (2, 30356):   fd = -1, id = 1134, xid = 0,
 Child said (2, 30356):   client = 81.166.235.84:13142,
 Child said (2, 30356):   step = STP_DONE,
 Child said (2, 30356): },
 Cache child died pid=30356 status=0x6
 Clean child
 Child cleaned

So these are the correct ones.

Here is what really happends

start child pid 29643
Child said (2, 29643): Child starts
Child said (2, 29643): managed to mmap 32212254720 bytes of 32212254720
Child said (2, 29643): Ready
Child said (2, 29643): panic in SES_Delete() at cache_session.c:340
Child said (2, 29643): assertion failed: sp-vcl == 0
Child said (2, 29643): sp = 0x3304307808 {
Child said (2, 29643):   fd = -1, id = 1926, xid = 790060728,
Child said (2, 29643):   client = 84.202.232.251:10359,
Child said (2, 29643):   step = STP_LOOKUP,
Child said (2, 29643): },
Manager got SIGINT
Clean child
Child stopping
unlink ./vcl.OaGbHZXp.o

*
Denne fotnoten bekrefter at denne e-postmeldingen ble
skannet av MailSweeper og funnet fri for virus.
*
This footnote confirms that this email message has been 
swept by MailSweeper for the presence of computer viruses.
*

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