Re: logging request time

2012-11-08 Thread Vladimir Stavrinov
On Wed, Oct 31, 2012 at 10:05:52PM +0100, Jorge NerĂ­n wrote:

Well, currently I use an indirect method, the ss utility  a quick'n'dirty 
 perl one liner:
 
ss -i -t 'sport = :80' |perl -e 'while () { if (m/send (.*?)([M|K|]bps) 
 /){ ($s,$u)=($1,$2); $s=$s*100 if (Mbps
eq $u); $s=$s*1000 if (Kbps eq $u); $t=$t+$s; $c=$c+1}} print $t 
 total bps, $c clients: , ($t/$c) ,  avg.
bps\n '
 
The output looks like:
 
1352182000 total bps, 539 clients: 2508686.45640074 avg. bps
 
I'm working on a munin plugin with this idea, as I'm testing different tcp 
 congestion avoidance algorithms and playing
with initcwnd  initrwnd and I like to keep track of the changes.


I don't understand what for all of this. It is totally off topic. What
we need is the time of each request to write to ncsa log file similar to
what exists in apache and nginx log. There are lot of others parameters
in this file that are needed all together for using by many kinds of log
analyzers. It should be done not by external tools, but by varnish
itself like other web or proxy servers are doing. And I don't understand
why this simple and necessary thing is not implemented yet.  


-- 

***
##  Vladimir Stavrinov
##  vstavri...@gmail.com
***


___
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Re: Assert error in VRT_r_req_backend_healthy()

2012-11-08 Thread Lasse Karstensen
Simon Lyall:
 I have just upgraded a couple of my caches from version 2.1 to 3.0.3
 ( using centos5 RPMs).
 I notice that I'm getting a lot of crashes (about twice an hour on a
 lightly loaded machine) when previously I had none.
[..]
 Nov  7 20:21:13 harvest varnishd[3290]: Child (5139) died signal=6
 Nov  7 20:21:13 harvest varnishd[3290]: Child (5139) Panic message:
 Assert error in VRT_r_req_backend_healthy(), cache_vrt_var.c line
 539: Condition((sp-director) != NULL) not true. thread =
 (cache-worker) ident =
[..]
 # vcl_deliver Body
[..]
 # Create temp variable header
 if (req.backend.healthy) {
 set resp.http.Backend-Healthy = yes ;
 } else {
 set resp.http.Backend-Healthy = no ;
 }

I believe this is caused by using req.backend.healthy in vcl_deliver.

Suggest you either remove this debug header entirely, or use 
req.backend.healthy 
in vcl_recv to set some other req.http header that can be checked on in 
vcl_deliver.

-- 
Lasse Karstensen
Varnish Software AS
http://www.varnish-software.com/

___
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


Re: Hashing on a particular cookie value

2012-11-08 Thread Paul A. Procacci
 Thanks a lot Paul. Before I read this , I tried the following :

 hash_data(regsub(req.http.Cookie,^.*?mycookie=([^;]*);*.*$ , \1));

Your regex differs than mine.  One negligible difference and one that
I'll focus on.  The negligible difference being the anchors ^ and $.
They aren't necessary.

For reference, my regex was:
regsub(req.http.cookie, .*mycookie=([^;]+);.*,

 ^
 ^

The difference is that I'm looking for a value in my regex, and you
don't care if there is a value in yours.  '+' vs '*'.

Your regex matches:
mycookie=
mycookie=a
mycookie=abc
...

My regex _doesn't_ match:
mycookie=

If you want to hash on an empty cookie, then your regex is what you
want.  Otherwise, perhaps mine is what you want.

You know your application best, and how you want to store your
data is entirely dependant upon you.  ;P

~G'Night

 I guess this should also do the trick ?

 Regards

 Soumendu





This message may contain confidential or privileged information. If you are not 
the intended recipient, please advise us immediately and delete this message. 
See http://www.datapipe.com/legal/email_disclaimer/ for further information on 
confidentiality and the risks of non-secure electronic communication. If you 
cannot access these links, please notify us by reply message and we will send 
the contents to you.

___
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


RE: Hashing on a particular cookie value

2012-11-08 Thread Soumendu Bhattacharya

==
Your regex differs than mine.  One negligible difference and one that I'll
focus on.  The negligible difference being the anchors ^ and $.
They aren't necessary.

For reference, my regex was:
regsub(req.http.cookie, .*mycookie=([^;]+);.*,

 ^
 ^

The difference is that I'm looking for a value in my regex, and you don't
care if there is a value in yours.  '+' vs '*'.

Your regex matches:
mycookie=
mycookie=a
mycookie=abc
...

My regex _doesn't_ match:
mycookie=

If you want to hash on an empty cookie, then your regex is what you want.
Otherwise, perhaps mine is what you want.

===
Thanks - a lot - I will change my regex :)  I certainly don't want to hash
on empty cookie. 

Regards

Soumendu



___
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc