From vedad at kigo.net Thu Mar 1 08:42:29 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 09:42:29 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <4F4E2521.7040606@kigo.net> References: <4F4E2521.7040606@kigo.net> Message-ID: <4F4F3675.6030301@kigo.net> Hi, Le 29/02/2012 14:16, Vedad KAJTAZ, Kigo Inc. a ?crit : > Hi, > > I'm totally new to Varnish, so I might be missing something obvious. > > I have an issue with the following setup, where vcl_fetch() doesn't seem > to be invoked (most of the time) for a particular file (evidence by > syslog). > I've done a new test session with varnishlog output as requested by "perbu" on the General discussion forum: The vcl file is unchanged: http://pastebin.com/ZqM7A5LP Syslog output (note that vcl_fetch() unconditionally calls std.syslog): http://pastebin.com/dAp5HDiG Varnishlog: http://pastebin.com/KkwHpyTD Backend log: http://pastebin.com/Bd60xSmY Chrome inspector log; http://pastebin.com/J03ctk5Z Result: URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png is fetched from backend by varnish and received by client, but is neither logged by syslog (hence, vcl_fetch was never invoked) nor by varnishlog. Thanks, Regards, -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From perbu at varnish-software.com Thu Mar 1 08:48:06 2012 From: perbu at varnish-software.com (Per Buer) Date: Thu, 1 Mar 2012 09:48:06 +0100 Subject: invalidating a page using ruby In-Reply-To: References: Message-ID: Hi, On Wed, Feb 29, 2012 at 11:27 PM, S Ahmed wrote: > How would you go about invalidating a cache with ruby? You either use HTTP PURGE against Varnish or issue a ban. See the tutorial for details. Also, from what I understand varnish doesn't support clustering. What if > you grow past a single server, do you somehow use a hashing algorithm to > choose which server will have the cached page? (if yes, then at what layer > will this hashing be done?) > You can either use Varnish as a load balancer (it is rather good at load balancing) use the hash director or any other load balancer that supports "URL target" hashing. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Thu Mar 1 09:55:51 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Thu, 1 Mar 2012 10:55:51 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <4F4F3675.6030301@kigo.net> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> Message-ID: <20120301095551.GU12685@nerd.dk> On Thu, Mar 01, 2012 at 09:42:29AM +0100, Vedad KAJTAZ, Kigo Inc. wrote: > > Varnishlog: > http://pastebin.com/KkwHpyTD > > URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png > is fetched from backend by varnish and received by client, but is > neither logged by syslog (hence, vcl_fetch was never invoked) nor by > varnishlog. I don't see this URL in the varnishlog. Are you sure the client is not fetching directly from the backend? -- Andreas From vedad at kigo.net Thu Mar 1 10:09:25 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 11:09:25 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <20120301095551.GU12685@nerd.dk> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> Message-ID: <4F4F4AD5.3090502@kigo.net> Hi, Le 01/03/2012 10:55, Andreas Plesner Jacobsen a ?crit : > On Thu, Mar 01, 2012 at 09:42:29AM +0100, Vedad KAJTAZ, Kigo Inc. wrote: >> >> Varnishlog: >> http://pastebin.com/KkwHpyTD >> >> URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png >> is fetched from backend by varnish and received by client, but is >> neither logged by syslog (hence, vcl_fetch was never invoked) nor by >> varnishlog. > > I don't see this URL in the varnishlog. Are you sure the client is not fetching > directly from the backend? > Yes, I am sure, and that's the point. The backend log shows proxy (varnish) IP as source: 87.98.213.163 - - [01/Mar/2012:09:25:53 +0100] "GET /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png HTTP/1.1" 200 196534 "http://marais-apartments.com/le_marais.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.39 Safari/535.19" The client's IP is 82.226.115.148. As stated in original message, there is no proxy or whatsoever between client, varnish and backend. Thanks, -- Vedad KAJTAZ Head of Software Development T: +33 1 42 74 56 70 | E: vedad at kigo.net kigo.net | Vacation Rental Software & Websites -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From apj at mutt.dk Thu Mar 1 10:19:32 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Thu, 1 Mar 2012 11:19:32 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <4F4F4AD5.3090502@kigo.net> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> Message-ID: <20120301101932.GV12685@nerd.dk> On Thu, Mar 01, 2012 at 11:09:25AM +0100, Vedad KAJTAZ, Kigo Inc. wrote: > > >>Varnishlog: > >>http://pastebin.com/KkwHpyTD > >> > >>URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png > >>is fetched from backend by varnish and received by client, but is > >>neither logged by syslog (hence, vcl_fetch was never invoked) nor by > >>varnishlog. > > > >I don't see this URL in the varnishlog. Are you sure the client is not fetching > >directly from the backend? > > > > Yes, I am sure, and that's the point. The backend log shows proxy > (varnish) IP as source: > > 87.98.213.163 - - [01/Mar/2012:09:25:53 +0100] "GET /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png > HTTP/1.1" 200 196534 "http://marais-apartments.com/le_marais.html" > "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like > Gecko) Chrome/18.0.1025.39 Safari/535.19" > > The client's IP is 82.226.115.148. As stated in original message, > there is no proxy or whatsoever between client, varnish and backend. I would look at two things: * varnishlog -O - varnishlog may not think it's a complete request * X-Varnish received at the backend. Does this match the sequence in varnishlog? If not, you're hitting a different varnishd than the one you're logging. -- Andreas From vedad at kigo.net Thu Mar 1 10:29:46 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 11:29:46 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <20120301101932.GV12685@nerd.dk> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> <20120301101932.GV12685@nerd.dk> Message-ID: <4F4F4F9A.2050909@kigo.net> Le 01/03/2012 11:19, Andreas Plesner Jacobsen a ?crit : > On Thu, Mar 01, 2012 at 11:09:25AM +0100, Vedad KAJTAZ, Kigo Inc. wrote: >> >>>> Varnishlog: >>>> http://pastebin.com/KkwHpyTD >>>> >>>> URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png >>>> is fetched from backend by varnish and received by client, but is >>>> neither logged by syslog (hence, vcl_fetch was never invoked) nor by >>>> varnishlog. >>> >>> I don't see this URL in the varnishlog. Are you sure the client is not fetching >>> directly from the backend? >>> >> >> Yes, I am sure, and that's the point. The backend log shows proxy >> (varnish) IP as source: >> >> 87.98.213.163 - - [01/Mar/2012:09:25:53 +0100] "GET /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png >> HTTP/1.1" 200 196534 "http://marais-apartments.com/le_marais.html" >> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like >> Gecko) Chrome/18.0.1025.39 Safari/535.19" >> >> The client's IP is 82.226.115.148. As stated in original message, >> there is no proxy or whatsoever between client, varnish and backend. > > I would look at two things: > > * varnishlog -O - varnishlog may not think it's a complete request > * X-Varnish received at the backend. Does this match the sequence in > varnishlog? If not, you're hitting a different varnishd than the one you're > logging. > There is no other varnish running. This is the full list of process from the freebsd jail: [root at kigoproxy squid]$ ps ax PID TT STAT TIME COMMAND 9799 ?? SsJ 0:01.13 /usr/sbin/syslogd -ss 10083 ?? IsJ 0:00.13 sendmail: Queue runner at 00:30:00 for /var/spool/clientmqueue (sendmail) 10090 ?? IsJ 0:01.08 /usr/sbin/cron -j 20 -J 20 -s 62308 ?? SsJ 0:09.64 varnishd: Varnish-Mgr kigoproxy.osilex.net (varnishd) 62309 ?? IJ 1:33.42 varnishd: Varnish-Chld kigoproxy.osilex.net (varnishd) 10129 10 IJ 0:00.01 /usr/local/bin/bash -l 16891 10 I+J 0:00.09 vim /etc/rc.conf 10192 11 IJ 0:00.02 /usr/local/bin/bash -l 16822 11 I+J 0:00.16 vim varnishd 16846 12 IJ 0:00.01 /usr/local/bin/bash -l 58918 12 I+J 0:00.03 vim default.vcl 17142 17 IJ 0:00.01 /usr/local/bin/bash -l 61229 17 I+J 0:00.77 vim kigo_simple.vcl 17174 18 I+J 0:00.07 /usr/local/bin/bash -l 17586 19 I+J 0:00.10 /usr/local/bin/bash -l 17730 20 I+J 0:00.02 /usr/local/bin/bash -l 58018 21 IJ 0:00.01 /usr/local/bin/bash -l 90489 21 I+J 0:00.01 tail -f /var/log/messages 59715 23 I+J 0:00.02 /usr/local/bin/bash -l 20976 24 SJ 0:00.01 /usr/local/bin/bash -l 96922 24 R+J 0:00.00 ps ax Unfortunately, the back-end is a production server, and I won't be able to log X-varnish headers. I'll try snooping on the traffic instead. I'll get back to the list quickly with new tests. -- Vedad KAJTAZ Head of Software Development T: +33 1 42 74 56 70 | E: vedad at kigo.net kigo.net | Vacation Rental Software & Websites -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From straightflush at gmail.com Thu Mar 1 12:00:42 2012 From: straightflush at gmail.com (AD) Date: Thu, 1 Mar 2012 07:00:42 -0500 Subject: invalidating a page using ruby In-Reply-To: References: Message-ID: just call "varnishadm" with the ban command you need from ruby under the system() call system("varnishadm -T somehost:6082 ban.url /images") On Thu, Mar 1, 2012 at 3:48 AM, Per Buer wrote: > Hi, > > On Wed, Feb 29, 2012 at 11:27 PM, S Ahmed wrote: > >> How would you go about invalidating a cache with ruby? > > > You either use HTTP PURGE against Varnish or issue a ban. See the tutorial > for details. > > Also, from what I understand varnish doesn't support clustering. What if >> you grow past a single server, do you somehow use a hashing algorithm to >> choose which server will have the cached page? (if yes, then at what layer >> will this hashing be done?) >> > > You can either use Varnish as a load balancer (it is rather good at load > balancing) use the hash director or any other load balancer that supports > "URL target" hashing. > > -- > Per Buer, CEO > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | Video | > Twitter > > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vedad at kigo.net Thu Mar 1 12:50:42 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 13:50:42 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <20120301101932.GV12685@nerd.dk> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> <20120301101932.GV12685@nerd.dk> Message-ID: <4F4F70A2.9000907@kigo.net> Le 01/03/2012 11:19, Andreas Plesner Jacobsen a ?crit : > On Thu, Mar 01, 2012 at 11:09:25AM +0100, Vedad KAJTAZ, Kigo Inc. wrote: >> >>>> Varnishlog: >>>> http://pastebin.com/KkwHpyTD >>>> >>>> URL /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png >>>> is fetched from backend by varnish and received by client, but is >>>> neither logged by syslog (hence, vcl_fetch was never invoked) nor by >>>> varnishlog. >>> >>> I don't see this URL in the varnishlog. Are you sure the client is not fetching >>> directly from the backend? >>> >> >> Yes, I am sure, and that's the point. The backend log shows proxy >> (varnish) IP as source: >> >> 87.98.213.163 - - [01/Mar/2012:09:25:53 +0100] "GET /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png >> HTTP/1.1" 200 196534 "http://marais-apartments.com/le_marais.html" >> "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like >> Gecko) Chrome/18.0.1025.39 Safari/535.19" >> >> The client's IP is 82.226.115.148. As stated in original message, >> there is no proxy or whatsoever between client, varnish and backend. > > I would look at two things: > > * varnishlog -O - varnishlog may not think it's a complete request > * X-Varnish received at the backend. Does this match the sequence in > varnishlog? If not, you're hitting a different varnishd than the one you're > logging. > I've done another test. This time, the "faulty" url that doesn't appear in varnishlog and is not logged by vcl_recv is: /img/4aa49f0874eb11168795c4f9a904c62d2b33d4cc947b3207a9d43e7c4a6e963d.png Excerpt from tcpdump session (could not paste everything, the file is over 2Mb): http://pastebin.com/d1RWqVeK One can see client requesting /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png within a kept-alive request (lines 63-74). Varnish forwards the request (lines 75-86) without invoking vcl_fetch, and altering only the "Accept-Language" header. Client -> Varnish: GET /img/4aa49f0874eb11168795c4f9a904c62d2b33d4cc947b3207a9d43e7c4a6e963d.png HTTP/1.1 Host: marais-apartments.com Connection: keep-alive Cache-Control: no-cache Pragma: no-cache User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.39 Safari/535.19 Accept: */* Referer: http://marais-apartments.com/le_marais.html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,fr-FR;q=0.6,fr;q= Varnish -> Backend: GET /img/4aa49f0874eb11168795c4f9a904c62d2b33d4cc947b3207a9d43e7c4a6e963d.png HTTP/1.1 Host: marais-apartments.com Connection: keep-alive Cache-Control: no-cache Pragma: no-cache User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.39 Safari/535.19 Accept: */* Referer: http://marais-apartments.com/le_marais.html Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,fr-FR Hope this helps, -- Vedad KAJTAZ Head of Software Development T: +33 1 42 74 56 70 | E: vedad at kigo.net kigo.net | Vacation Rental Software & Websites -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From vedad at kigo.net Thu Mar 1 13:00:38 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 14:00:38 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <4F4F70A2.9000907@kigo.net> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> <20120301101932.GV12685@nerd.dk> <4F4F70A2.9000907@kigo.net> Message-ID: <4F4F72F6.4030002@kigo.net> Le 01/03/2012 13:50, Vedad KAJTAZ, Kigo Inc. a ?crit : > > > Varnish forwards the request (lines 75-86) without invoking vcl_fetch, > and altering only the "Accept-Language" header. > Please ignore this, tcpdump truncated the packet output. Here comes an other example. Faulty url: /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png Tcpdump: http://pastebin.com/wwvnk4g4 It appears that the request is (immediately) forwarded to backend, without any headers alteration (and still without vcl_fetch being invoked). -- Vedad KAJTAZ Head of Software Development T: +33 1 42 74 56 70 | E: vedad at kigo.net kigo.net | Vacation Rental Software & Websites -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From apj at mutt.dk Thu Mar 1 13:46:40 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Thu, 1 Mar 2012 14:46:40 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <4F4F72F6.4030002@kigo.net> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> <20120301101932.GV12685@nerd.dk> <4F4F70A2.9000907@kigo.net> <4F4F72F6.4030002@kigo.net> Message-ID: <20120301134640.GX12685@nerd.dk> On Thu, Mar 01, 2012 at 02:00:38PM +0100, Vedad KAJTAZ, Kigo Inc. wrote: > > > >Varnish forwards the request (lines 75-86) without invoking vcl_fetch, > >and altering only the "Accept-Language" header. > > Please ignore this, tcpdump truncated the packet output. Here comes > an other example. > > Faulty url: /img/cfbc7c98bf8f0a9081a5178b26582ab4090571844992f9fefa30a1fa20fa3668.png > > Tcpdump: > http://pastebin.com/wwvnk4g4 > > It appears that the request is (immediately) forwarded to backend, > without any headers alteration (and still without vcl_fetch being > invoked). pipe'd keepalive session: https://www.varnish-cache.org/trac/wiki/VCLExamplePipe -- Andreas From vedad at kigo.net Thu Mar 1 14:07:00 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Thu, 01 Mar 2012 15:07:00 +0100 Subject: File served without vcl_fetch() being invoked. In-Reply-To: <20120301134640.GX12685@nerd.dk> References: <4F4E2521.7040606@kigo.net> <4F4F3675.6030301@kigo.net> <20120301095551.GU12685@nerd.dk> <4F4F4AD5.3090502@kigo.net> <20120301101932.GV12685@nerd.dk> <4F4F70A2.9000907@kigo.net> <4F4F72F6.4030002@kigo.net> <20120301134640.GX12685@nerd.dk> Message-ID: <4F4F8284.30802@kigo.net> Le 01/03/2012 14:46, Andreas Plesner Jacobsen a ?crit : > On Thu, Mar 01, 2012 at 02:00:38PM +0100, Vedad KAJTAZ, Kigo Inc. wrote: >>> >> It appears that the request is (immediately) forwarded to backend, >> without any headers alteration (and still without vcl_fetch being >> invoked). > > pipe'd keepalive session: > https://www.varnish-cache.org/trac/wiki/VCLExamplePipe > Damn, I've read this already, but just realized my vcl was pipe-ing instead of pass-ing POST requests... Thanks a lot, sorry for the noise. -- Vedad KAJTAZ Head of Software Development T: +33 1 42 74 56 70 | E: vedad at kigo.net kigo.net | Vacation Rental Software & Websites -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4906 bytes Desc: Signature cryptographique S/MIME URL: From dredd422 at gmail.com Fri Mar 2 18:51:42 2012 From: dredd422 at gmail.com (Daniel Sell) Date: Fri, 2 Mar 2012 10:51:42 -0800 Subject: invalidating a page using ruby In-Reply-To: References: Message-ID: Attached is the ruby code I used before. On Thu, Mar 1, 2012 at 4:00 AM, AD wrote: > just call "varnishadm" with the ban command you need from ruby under the > system() call > > system("varnishadm -T somehost:6082 ban.url /images") > > > > On Thu, Mar 1, 2012 at 3:48 AM, Per Buer wrote: > >> Hi, >> >> On Wed, Feb 29, 2012 at 11:27 PM, S Ahmed wrote: >> >>> How would you go about invalidating a cache with ruby? >> >> >> You either use HTTP PURGE against Varnish or issue a ban. See the >> tutorial for details. >> >> Also, from what I understand varnish doesn't support clustering. What if >>> you grow past a single server, do you somehow use a hashing algorithm to >>> choose which server will have the cached page? (if yes, then at what layer >>> will this hashing be done?) >>> >> >> You can either use Varnish as a load balancer (it is rather good at load >> balancing) use the hash director or any other load balancer that supports >> "URL target" hashing. >> >> -- >> Per Buer, CEO >> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer >> *Varnish makes websites fly!* >> Whitepapers | Video | >> Twitter >> >> >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >> > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: purge.rb Type: application/octet-stream Size: 333 bytes Desc: not available URL: From sfoutrel at gmail.com Sat Mar 3 15:36:00 2012 From: sfoutrel at gmail.com (=?ISO-8859-1?Q?S=E9bastien_FOUTREL?=) Date: Sat, 3 Mar 2012 16:36:00 +0100 Subject: varnishlog 2.1.5 record limit In-Reply-To: <22F96A574165AA4482FF290947347774208544DE@AUPDC00-MBX01P.au.ad.westfield.com> References: <22F96A574165AA4482FF290947347774208544DE@AUPDC00-MBX01P.au.ad.westfield.com> Message-ID: Hello, read your email and it seems to me you pointed the solution yourself :) The answer in trac tells that the "limit" of 255 bytes is a default in varnish but can be overlapped by a parameter. My 3 cents. Hope it'll help. Sebastien FOUTREL 2012/2/23 Thiago Figueiro : > I'm using varnishlog (2.1.5) to help diagnose a production issue. ?Specifically, I want to see the Cookie header from the client request: > > ? 76 RxHeader ? ? c Cookie: __utmc=54987508; 90374957_clogin=l=1329292359&v=1&e=1329294317271; s_cc=true > ; s_sq=%5B%5BB%5D%5D; session_start_time=1329292261764; __utmz=54987508.1329292460.1.1.utmcsr=(direct)|ut > mccn=(direct)|utmcmd=(none); CoreID6=30738140851313292923591&ci=90 > > > All Cookies I investigated are suspiciously 250 bytes long. > > It seems that varnishlog truncates headers when writing to the binary log. > > Yep, it does truncate it... Google fu: > > https://www.varnish-cache.org/trac/ticket/528 > > I am now in a situation where I can't determine what happened because I don't have enough information. ?I can't replicate the issue because I don't know who the customer was. > > What would be the down-side of saving entire headers by default? ?Any chances of re-opening that case as a change request? > > > Thanks > > ____________________________ > Thiago Figueir? > Technical Operations Manager > Digital Business > P +61 (0)2 9358 7123 > F +61 (0)2 9028 8500 > > > > ______________________________________________________ > ? ?CONFIDENTIALITY NOTICE > This electronic mail message, including any and/or all attachments, is for the sole use of the intended recipient(s), and may contain confidential and/or privileged information, pertaining to business conducted under the direction and supervision of the sending organization. All electronic mail messages, which may have been established as expressed views and/or opinions (stated either within the electronic mail message or any of its attachments), are left to the sole responsibility of that of the sender, and are not necessarily attributed to the sending organization. Unauthorized interception, review, use, disclosure or distribution of any such information contained within this electronic mail message and/or its attachment(s), is (are) strictly prohibited. If you are not the intended recipient, please contact the sender by replying to this electronic mail message, along with the destruction all copies of the original electronic mail message (along with any attachments). > ______________________________________________________ > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From rtshilston at gmail.com Sun Mar 4 22:35:54 2012 From: rtshilston at gmail.com (Rob S) Date: Sun, 4 Mar 2012 22:35:54 +0000 Subject: HTTP Range support on 3.0.2 Message-ID: Hi, I'm running varnish 3.0.2-1.el5 (x86_64) and just starting to try out the range support feature. ?However, it doesn't appear to be working for me, and I'm hoping someone can point me in the right direction. param.show shows: http_range_support ? ? ? ? on [bool] Directly loading from the backend, I see expected responses: curl -v -i -r 0-10 -H 'Host: testhost' -s "http://backendip/audio/file.mp3?4" 2>&1 ?|head -n 20 * About to connect() to backendip port 80 (#0) * ? Trying backendip... connected * Connected to backendip (backendip) port 80 (#0) > GET file.mp3?4 HTTP/1.1 > Range: bytes=0-10 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 > Accept: */* > Host: testhost > < HTTP/1.1 206 Partial Content < Date: Sun, 04 Mar 2012 22:27:51 GMT < Server: Apache/2.2.3 (CentOS) < Cache-Control: public, max-age=3600, must-revalidate, no-transform < Expires: Sun, 04 Mar 2012 23:27:51 +0000 < X-Internal-TTL: 3600 < X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform < X-Cache-Policy: manual < Accept-Ranges: bytes < Content-Range: bytes 0-10/1489040 < Content-Length: 11 Loading via Varnish, I see: curl -v -i -r 0-10 -H 'Host: testhost' -s "http://varniship/file.mp3?4" 2>&1 ?|head -n 20 * About to connect() to varniship port 80 (#0) * ? Trying varniship... connected * Connected to varniship (varniship) port 80 (#0) > GET /file.mp3?4 HTTP/1.1 > Range: bytes=0-10 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 > Accept: */* > Host: testhost > < HTTP/1.1 206 Partial Content < Server: Apache/2.2.3 (CentOS) < Cache-Control: public, max-age=3600, must-revalidate, no-transform < Expires: Sun, 04 Mar 2012 23:30:05 +0000 < X-Internal-TTL: 3600 < X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform < X-Cache-Policy: manual < Accept-Ranges: bytes < Content-Range: bytes 0-1489039/1489040 < Content-Type: audio/mp3 < Content-Length: 1489040 This is running using the default VCL supplied with the RPM (to ensure that the non-compliance with Range wasn't something we've added in our config). ?Finally, here's the varnishlog: ? 13 BackendOpen ?b default 127.0.0.1 36383 127.0.0.1 80 ? 13 TxRequest ? ?b GET ? 13 TxURL ? ? ? ?b /file.mp3?4 ? 13 TxProtocol ? b HTTP/1.1 ? 13 TxHeader ? ? b User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 ? 13 TxHeader ? ? b Accept: */* ? 13 TxHeader ? ? b Host: testhost ? 13 TxHeader ? ? b X-Forwarded-For: 192.168.33.10 ? 13 TxHeader ? ? b X-Varnish: 960993454 ? 13 TxHeader ? ? b Accept-Encoding: gzip ? 13 RxProtocol ? b HTTP/1.1 ? 13 RxStatus ? ? b 206 ? 13 RxResponse ? b Partial Content ? 13 RxHeader ? ? b Date: Sun, 04 Mar 2012 22:32:38 GMT ? 13 RxHeader ? ? b Server: Apache/2.2.3 (CentOS) ? 13 RxHeader ? ? b Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 13 RxHeader ? ? b Expires: Sun, 04 Mar 2012 23:32:39 +0000 ? 13 RxHeader ? ? b X-Internal-TTL: 3600 ? 13 RxHeader ? ? b X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 13 RxHeader ? ? b X-Cache-Policy: manual ? 13 RxHeader ? ? b Accept-Ranges: bytes ? 13 RxHeader ? ? b Content-Range: bytes 0-1489039/1489040 ? 13 RxHeader ? ? b Content-Length: 1489040 ? 13 RxHeader ? ? b Connection: close ? 13 RxHeader ? ? b Content-Type: audio/mp3 ? 13 Fetch_Body ? b 4(length) cls 0 mklen 1 ? 13 Length ? ? ? b 1489040 ? 13 BackendClose b default ? ?0 Debug ? ? ? ?- "lurker: 0x2aaaaac07100 604801 0" ? 10 SessionOpen ?c 192.168.33.10 63825 varniship:80 ? 10 ReqStart ? ? c 192.168.33.10 63825 960993454 ? 10 RxRequest ? ?c GET ? 10 RxURL ? ? ? ?c /file.mp3?4 ? 10 RxProtocol ? c HTTP/1.1 ? 10 RxHeader ? ? c Range: bytes=0-10 ? 10 RxHeader ? ? c User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 ? 10 RxHeader ? ? c Accept: */* ? 10 RxHeader ? ? c Host: testhost ? 10 VCL_call ? ? c recv lookup ? 10 VCL_call ? ? c hash ? 10 Hash ? ? ? ? c /file.mp3?4 ? 10 Hash ? ? ? ? c testhost ? 10 VCL_return ? c hash ? 10 VCL_call ? ? c miss fetch ? 10 Backend ? ? ?c 13 default default ? 10 TTL ? ? ? ? ?c 960993454 RFC -1 -1 -1 1330900359 0 1330900358 0 0 ? 10 VCL_call ? ? c fetch ? 10 TTL ? ? ? ? ?c 960993454 VCL 121 -1 -1 1330900358 -1 ? 10 VCL_return ? c hit_for_pass ? 10 ObjProtocol ?c HTTP/1.1 ? 10 ObjResponse ?c Partial Content ? 10 ObjHeader ? ?c Date: Sun, 04 Mar 2012 22:32:38 GMT ? 10 ObjHeader ? ?c Server: Apache/2.2.3 (CentOS) ? 10 ObjHeader ? ?c Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 10 ObjHeader ? ?c Expires: Sun, 04 Mar 2012 23:32:39 +0000 ? 10 ObjHeader ? ?c X-Internal-TTL: 3600 ? 10 ObjHeader ? ?c X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 10 ObjHeader ? ?c X-Cache-Policy: manual ? 10 ObjHeader ? ?c Accept-Ranges: bytes ? 10 ObjHeader ? ?c Content-Range: bytes 0-1489039/1489040 ? 10 ObjHeader ? ?c Content-Length: 1489040 ? 10 ObjHeader ? ?c Content-Type: audio/mp3 ? 10 SessionClose c remote closed ? 10 VCL_call ? ? c deliver deliver ? 10 TxProtocol ? c HTTP/1.1 ? 10 TxStatus ? ? c 206 ? 10 TxResponse ? c Partial Content ? 10 TxHeader ? ? c Server: Apache/2.2.3 (CentOS) ? 10 TxHeader ? ? c Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 10 TxHeader ? ? c Expires: Sun, 04 Mar 2012 23:32:39 +0000 ? 10 TxHeader ? ? c X-Internal-TTL: 3600 ? 10 TxHeader ? ? c X-External-Cache-Control: public, max-age=3600, must-revalidate, no-transform ? 10 TxHeader ? ? c X-Cache-Policy: manual ? 10 TxHeader ? ? c Accept-Ranges: bytes ? 10 TxHeader ? ? c Content-Range: bytes 0-1489039/1489040 ? 10 TxHeader ? ? c Content-Type: audio/mp3 ? 10 TxHeader ? ? c Content-Length: 1489040 ? 10 TxHeader ? ? c Accept-Ranges: bytes ? 10 TxHeader ? ? c Date: Sun, 04 Mar 2012 22:32:39 GMT ? 10 TxHeader ? ? c X-Varnish: 960993454 ? 10 TxHeader ? ? c Age: 0 ? 10 TxHeader ? ? c Via: 1.1 varnish ? 10 TxHeader ? ? c Connection: keep-alive ? 10 Debug ? ? ? ?c Write error, retval = 62284, len = 1489581, errno = Success ? 10 ReqEnd ? ? ? c 960993454 1330900358.186229944 1330900359.564546108 0.000057936 0.864976168 0.513339996 ? 10 StatSess ? ? c 192.168.33.10 63825 1 1 1 0 0 1 541 1489040 I'd be grateful if anyone who is successfully using Range can indicate where to proceed with our debug. Thanks, Rob From TFigueiro at au.westfield.com Tue Mar 6 02:49:12 2012 From: TFigueiro at au.westfield.com (Thiago Figueiro) Date: Tue, 6 Mar 2012 02:49:12 +0000 Subject: Condition(w->wlp < w->wle) not true Message-ID: <22F96A574165AA4482FF29094734777420868E2E@AUPDC00-MBX01P.au.ad.westfield.com> Is someone able to confirm this Varnish 2.1.5 panic is due to insufficient workspace memory? I recently increased shm_reclen and sess_workspace, following Kristian's advice on https://www.varnish-cache.org/trac/ticket/1055. Thank you Current values: VARNISH_VCL_CONF=/etc/varnish/default.vcl #VARNISH_LISTEN_ADDRESS= #VARNISH_LISTEN_PORT=80 VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1 VARNISH_ADMIN_LISTEN_PORT=6082 VARNISH_MIN_THREADS=150 VARNISH_MAX_THREADS=3000 VARNISH_THREAD_TIMEOUT=120 VARNISH_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin VARNISH_STORAGE_SIZE=35G VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}" VARNISH_TTL=120 # DAEMON_OPTS is used by the init script. If you add or remove options, make # sure you update this section, too. # Primes (10% of n_object): -h 91193, 319993, 500009, 999331, 1686049, 2097593 DAEMON_OPTS="-f ${VARNISH_VCL_CONF} \ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \ -t ${VARNISH_TTL} \ -p thread_pools=6 \ -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \ -u varnish -g varnish \ -h classic,91193 \ -s ${VARNISH_STORAGE} \ -p listen_depth=4096 \ -p session_linger=50/100/150 \ -p sess_workspace=131072 \ -p shm_reclen=16384 \ -p lru_interval=60" Error in syslog: 2012-03-05T21:06:15.656486+11:00 aubdc-rp01 varnishd[7365]: Child (22302) Panic message: Assert error in WSLR(), shmlog.c line 236:#012 Condition(w->wlp < w->wle) not true.#012thread = (cache-worker)#012ident = Linux,2.6.32-220.4.2.el6.x86_64,x86_64,-sfile,-hclassic,epoll#012Backtrace:#012 0x425058: /usr/sbin/varnishd() [0x425058]#012 0x43a6d5: /usr/sbin/varnishd(WSLR+0x1c5) [0x43a6d5]#012 0x422299: /usr/sbin/varnishd() [0x422299]#012 0x4224bd: /usr/sbin/varnishd(http_DissectRequest+0xed) [0x4224bd]#012 0x414710: /usr/sbin/varnishd(CNT_Session+0x660) [0x414710]#012 0x426808: /usr/sbin/varnishd() [0x426808]#012 0x426bdb: /usr/sbin/varnishd() [0x426bdb]#012 0x7f51a1f3b7f1: /lib64/libpthread.so.0(+0x77f1) [0x7f51a1f3b7f1]#012 0x7f51a17db92d: /lib64/libc.so.6(clone+0x6d) [0x7f51a17db92d]#012sp = 0x7f4819171008 {#012 fd = 41, id = 41, xid = 179601385,#012 client = 208.80.194.30 51469,#012 step = STP_START,#012 handling = deliver,#012 restarts = 0, esis = 0#012 ws = 0x7f4819171080 { #012 id = "sess",#012 {s,f,r,e} = {0x7f4819171cd8,+15232,(nil),+131072},#012 },#012 http[req] = {#012 ws = 0x7f4819171080[sess]#012 "GET",#012 "/gateway/",#012 "HTTP/1.0",#012 "Host: westfield.com",#012 "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705; ImageShack Toolbar 3.0.6)",#012 },#012 worker = 0x7f47495edbd0 {#012 ws = 0x7f47495edd50 { #012 id = "wrk",#012 {s,f,r,e} = {0x7f47495cbb70,0x7f47495cbb70,(nil),+131072},#012 },#012 },#012 vcl = {#012 srcname = {#012 "input",#012 "Default",#012 "/etc/varnish/backend_centre_refresh.vcl",#012 "/etc/varnish/backend_corporate.vcl",#012 "/etc/varnish/backend_centre_rails.vcl",#012 "/etc/varnish/backend_acacia.vcl",#012 "/etc/varnish/backend_contentstore.vcl",#012 "/etc/varnish/backend_stratfordcity.vcl",#012 "/etc/varnish/backend_redirects.vcl",#012 "/etc/varnish/select_backend.vcl",#012 "/etc/varnish/canonical_we ____________________________ Thiago Figueir? Technical Operations Manager Digital Business P +61 (0)2 9358 7123 F +61 (0)2 9028 8500 ______________________________________________________ CONFIDENTIALITY NOTICE This electronic mail message, including any and/or all attachments, is for the sole use of the intended recipient(s), and may contain confidential and/or privileged information, pertaining to business conducted under the direction and supervision of the sending organization. All electronic mail messages, which may have been established as expressed views and/or opinions (stated either within the electronic mail message or any of its attachments), are left to the sole responsibility of that of the sender, and are not necessarily attributed to the sending organization. Unauthorized interception, review, use, disclosure or distribution of any such information contained within this electronic mail message and/or its attachment(s), is (are) strictly prohibited. If you are not the intended recipient, please contact the sender by replying to this electronic mail message, along with the destruction all copies of the original electronic mail message (along with any attachments). ______________________________________________________ From parsimail2001 at yahoo.se Tue Mar 6 04:37:11 2012 From: parsimail2001 at yahoo.se (Your Friend) Date: Tue, 6 Mar 2012 04:37:11 +0000 (GMT) Subject: statusnet Message-ID: <1331008631.72026.YahooMailNeo@web171603.mail.ir2.yahoo.com> Hi everyone! I'm wondering if there is anyone who already has written a working modified vcl file for a website running statusnet application. We are planning to run statusnet on debian using nginx and varnish 2.1. We are going to use google ads, google analytic and https for logins. facebook and twitter plugins for our statusnet site will be off! Kind regards, Ali -------------- next part -------------- An HTML attachment was scrubbed... URL: From shirin.hossain at gmail.com Tue Mar 6 06:13:33 2012 From: shirin.hossain at gmail.com (Shirin Hossain) Date: Tue, 6 Mar 2012 06:13:33 +0000 (UTC) Subject: Invitation to connect on LinkedIn Message-ID: <943344452.14591080.1331014413517.JavaMail.app@ela4-bed81.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Shirin Shirin Hossain MD at Bridge International company Bangladesh Confirm that you know Shirin Hossain: https://www.linkedin.com/e/-9jv3q4-gzgjm6di-54/isd/6180058131/eb4Keu3Z/?hs=false&tok=2NduQ1doylvB81 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-9jv3q4-gzgjm6di-54/uUwiAqzf418olGWw58mjSTvkm1HgTG3IrG82TCkxhF79SC/goo/varnish-misc%40varnish-cache%2Eorg/20061/I2147990997_1/?hs=false&tok=252yFFTqSlvB81 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From TFigueiro at au.westfield.com Tue Mar 6 07:12:27 2012 From: TFigueiro at au.westfield.com (Thiago Figueiro) Date: Tue, 6 Mar 2012 07:12:27 +0000 Subject: Invitation to connect on LinkedIn In-Reply-To: <943344452.14591080.1331014413517.JavaMail.app@ela4-bed81.prod> References: <943344452.14591080.1331014413517.JavaMail.app@ela4-bed81.prod> Message-ID: <22F96A574165AA4482FF2909473477742086913F@AUPDC00-MBX01P.au.ad.westfield.com> Someone must be looking for a new job :-) I have unsubscribed the list from linked-in; hopefully we won't be getting these again. ______________________________________________________ CONFIDENTIALITY NOTICE This electronic mail message, including any and/or all attachments, is for the sole use of the intended recipient(s), and may contain confidential and/or privileged information, pertaining to business conducted under the direction and supervision of the sending organization. All electronic mail messages, which may have been established as expressed views and/or opinions (stated either within the electronic mail message or any of its attachments), are left to the sole responsibility of that of the sender, and are not necessarily attributed to the sending organization. Unauthorized interception, review, use, disclosure or distribution of any such information contained within this electronic mail message and/or its attachment(s), is (are) strictly prohibited. If you are not the intended recipient, please contact the sender by replying to this electronic mail message, along with the destruction all copies of the original electronic mail message (along with any attachments). ______________________________________________________ From gasper.furman at delo.si Wed Mar 7 14:24:40 2012 From: gasper.furman at delo.si (=?windows-1252?Q?Ga=9Aper_Furman?=) Date: Wed, 07 Mar 2012 15:24:40 +0100 Subject: Multiple sites runing on multiple backends Message-ID: <4F576FA8.40201@delo.si> Hi! I would like to have one varnish server for multiple sites running on multiple backends. For example: Domains: domain0.com, domain1.com .. domain9.com running on backends: backendA, backendB. Domains: domain10.com, domain11.com .. domain19.com running on backends: backendC, backendD. Is there any better way than: if (req.http.host ~ "(?i)domain0.com|(?i)domain1.com|(?i)domain2.com|(?i)domain3.com|(?i)domain4.com|(?i)domain5.com|(?i)domain6.com|(?i)domain7.com|(?i)domain8.com|(?i)domain9.com") { set req.backend = backendAB_director } else.... For example something like acl lists would be very helpful: XXX domainsAB { "(?i)domain0.com"; "(?i)domain1.com"; "(?i)domain2.com"; "(?i)domain3.com"; "(?i)domain4.com"; "(?i)domain5.com"; "(?i)domain6.com"; "(?i)domain7.com"; "(?i)domain8.com"; "(?i)domain9.com"; } if (req.http.host ~ domainsAB) { set req.backend = backendAB_director } Thanks, Regards, -- Ga?per Furman Spletni razvoj Web Development Delo, d. d. Dunajska 5, 1000 Ljubljana T: +386 1 47 37 946 E: gasper.furman at delo.si -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si.jpg Type: image/jpeg Size: 4535 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si3.jpg Type: image/jpeg Size: 4051 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si2.jpg Type: image/jpeg Size: 5520 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si4.jpg Type: image/jpeg Size: 2639 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si5.jpg Type: image/jpeg Size: 1963 bytes Desc: not available URL: From george at zygmund.net Wed Mar 7 14:48:23 2012 From: george at zygmund.net (George) Date: Wed, 07 Mar 2012 14:48:23 +0000 Subject: Correct way to raise immediate error in VCL Message-ID: <4F577537.1020605@zygmund.net> 3.0 Docs state that from vcl_recv "The vcl_recv subroutine may terminate with calling return() on one of the following keywords:" ... error code [reason]. This implies a syntax of return( error 404 "Not Found" ); - which I believe is incorrect and didn't work when I tried it. There are a number of examples of throwing errors - usually something like error 404 "Not Found" that I know work . However, I can find no definitive statement that this method causes an IMMEDIATE return from vcl_recv. The reason I need clarification is that I am tracking an issue that seems to indicate that processing continues after an error is called and am seeing urls appearing in the backend server logs that indicate subsequent pipe commands may have been honored despite the error call. Could someone clarify - is calling error 404 "Not Found"; sufficient to cause all further processing to cease and a subroutine return to be implicitly carried out - or is something more specific required like.. (VCL Snippit) #block unauthorized access to this site if (!client.ip ~ authorized) { error 404 "Not Found."; return (error); } From r at roze.lv Wed Mar 7 20:59:31 2012 From: r at roze.lv (Reinis Rozitis) Date: Wed, 7 Mar 2012 22:59:31 +0200 Subject: Multiple sites runing on multiple backends In-Reply-To: <4F576FA8.40201@delo.si> References: <4F576FA8.40201@delo.si> Message-ID: <84E88BEA530C4F77920B104DA3F822AC@NeiRoze> > I would like to have one varnish server for multiple sites running on > multiple backends. You could try the DNS director ( http://kristianlyng.wordpress.com/2010/08/02/varnish-backend-selection-through-dns/ ). With the prefix/suffix feature you should be able to store the backend configuration for each of your domains in your dns server. rr From pprocacci at datapipe.com Thu Mar 8 06:37:16 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Thu, 8 Mar 2012 00:37:16 -0600 Subject: Correct way to raise immediate error in VCL In-Reply-To: <4F577537.1020605@zygmund.net> References: <4F577537.1020605@zygmund.net> Message-ID: <20120308063716.GK90116@nat.myhome> I don't know the answer to your question as I'm still using the latest varnish 2.x in production, but you can see exactly what your vcl produces by `varnish -C -f /path/to/vcl_file`. Hope that helps. ~Paul On Wed, Mar 07, 2012 at 02:48:23PM +0000, George wrote: > 3.0 Docs state that from vcl_recv "The vcl_recv subroutine may terminate > with calling return() on one of the following keywords:" ... error code > [reason]. This implies a syntax of return( error 404 "Not Found" ); - > which I believe is incorrect and didn't work when I tried it. There are > a number of examples of throwing errors - usually something like error > 404 "Not Found" that I know work . > > However, I can find no definitive statement that this method causes an > IMMEDIATE return from vcl_recv. The reason I need clarification is that > I am tracking an issue that seems to indicate that processing continues > after an error is called and am seeing urls appearing in the backend > server logs that indicate subsequent pipe commands may have been honored > despite the error call. > > Could someone clarify - is calling error 404 "Not Found"; sufficient to > cause all further processing to cease and a subroutine return to be > implicitly carried out - or is something more specific required like.. > > (VCL Snippit) > > #block unauthorized access to this site > if (!client.ip ~ authorized) { > error 404 "Not Found."; > return (error); > } > > > > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc ________________________________ 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. From r at roze.lv Thu Mar 8 14:44:19 2012 From: r at roze.lv (Reinis Rozitis) Date: Thu, 8 Mar 2012 16:44:19 +0200 Subject: Chrome -Hit send timeout Message-ID: <1A91744C617D4D7F91AC286B7460589F@NeiRoze> Hello, I have a pretty weird problem with Chrome (and only chrome since FF/IE/Opera work fine) randomly not loading image files from varnish - out of 100 pictures (in one site) usually 2-3 are broken until next refresh and it affects only varnish 3.x but 2.1.5 works fine. I tracked down from varnish logs that according to varnishncsa that particular requests while being 200 OK doesnt have content-length: 10.30.0.69 - - [08/Mar/2012:16:11:25 +0200] "GET http://10.0.0.2/gallery/41d1403557279cf75b0bb6e36fe0a4e1/02/309/262/v1/l_251309262.jpg HTTP/1.1" 200 - "http://10.0.0.1/pic_test.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11" But in the the full log I hit send timeout (while according to CLI 'send_timeout 600 [seconds]') also it happens instantly: 2738 Debug c Hit send timeout, wrote = 77976/108304; retrying 2738 Debug c Write error, retval = -1, len = 30328, errno = Resource temporarily unavailable --------------------------------------------- 2738 ReqStart c 10.30.0.69 51752 2104587141 2738 RxRequest c GET 2738 RxURL c /gallery/41d1403557279cf75b0bb6e36fe0a4e1/02/309/262/v1/l_251309262.jpg 2738 RxProtocol c HTTP/1.1 2738 RxHeader c Host: 10.0.0.2 2738 RxHeader c Connection: keep-alive 2738 RxHeader c User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11 2738 RxHeader c Accept: */* 2738 RxHeader c Referer: http://10.0.0.1/pic_test.php 2738 RxHeader c Accept-Encoding: gzip,deflate,sdch 2738 RxHeader c Accept-Language: en-US,en;q=0.8 2738 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 2738 VCL_call c recv lookup 2738 VCL_call c hash 2738 Hash c /sgallery/41d1403557279cf75b0bb6e36fe0a4e1/02/309/262/v1/l_251309262.jpg 2738 VCL_return c hash 2738 VCL_call c miss fetch 2738 Backend c 2689 c02 c02[1](10.0.0.208,,80) 2738 VCL_call c fetch 2738 TTL c 2104587141 VCL 315360000 30 -1 1331215886 -0 2738 VCL_return c deliver 2738 VCL_call c deliver deliver 2738 TxProtocol c HTTP/1.1 2738 TxStatus c 200 2738 TxResponse c OK 2738 TxHeader c Date: Thu, 08 Mar 2012 14:11:25 GMT 2738 TxHeader c Content-Type: image/jpeg 2738 TxHeader c Last-Modified: Thu, 08 Mar 2012 14:11:23 GMT 2738 TxHeader c Expires: Thu, 31 Dec 2037 23:55:55 GMT 2738 TxHeader c Cache-Control: max-age=315360000 2738 TxHeader c Content-Length: 108009 2738 TxHeader c Date: Thu, 08 Mar 2012 14:11:25 GMT 2738 TxHeader c Age: 0 2738 TxHeader c Connection: keep-alive 2738 Debug c Hit send timeout, wrote = 77976/108304; retrying 2738 Debug c Write error, retval = -1, len = 30328, errno = Resource temporarily unavailable 2738 ReqEnd c 2104587141 1331215885.872925997 1331215885.875815868 4.831786394 0.002806425 0.000083447 2738 StatSess c 10.30.0.69 51752 5 1 2 0 0 2 590 225326 Any ideas? rr From r at roze.lv Thu Mar 8 19:13:43 2012 From: r at roze.lv (Reinis Rozitis) Date: Thu, 8 Mar 2012 21:13:43 +0200 Subject: Chrome -Hit send timeout In-Reply-To: <1A91744C617D4D7F91AC286B7460589F@NeiRoze> References: <1A91744C617D4D7F91AC286B7460589F@NeiRoze> Message-ID: > 2738 Debug c Hit send timeout, wrote = 77976/108304; retrying > 2738 Debug c Write error, retval = -1, len = 30328, errno = > Resource temporarily unavailable Seems that the problem is with keep-alive / sessions (varnish trying to send to allready closed connection by the browser?) - doing full reload (ctrl+reload) with Chrome every second request fails (on the same url). If I add set resp.http.Connection="close"; in vcl_deliver the problem goes away. rr From gc at ants.eu Fri Mar 9 09:35:48 2012 From: gc at ants.eu (Gianni Carabelli) Date: Fri, 09 Mar 2012 10:35:48 +0100 Subject: Going crazy to mitigate slow read Message-ID: <4F59CEF4.5040207@ants.eu> Hi all. I've got few servers with varnish + apache on loopback. Modsecurity mitigate the problem on the only apache side, but fails with apache + varnish. I'm using mod_rpaf to get the right ip address, but probably something goes wrong. I would like to get another approach and try to block the attack completely in varnish. In apache, some directive say: "if there are enough connection from this ip in READ/WRITE state, reject incoming connections from that ip" Is there a way to do so in varnish? Thanks JohnnyRun From damon at huddler-inc.com Fri Mar 9 17:09:26 2012 From: damon at huddler-inc.com (Damon Snyder) Date: Fri, 9 Mar 2012 09:09:26 -0800 Subject: Going crazy to mitigate slow read In-Reply-To: <4F59CEF4.5040207@ants.eu> References: <4F59CEF4.5040207@ants.eu> Message-ID: Another way of doing this in nginx in front of varnish. See the limit_* directives in nginx http://wiki.nginx.org/HttpLimitZoneModule#limit_zone. It depends on your application, but typically, if you have an abusive client(s), you end up serving a lot of the requests from varnish so your apache processes never sees the bulk of the requests. Additionally, your apache threads are a more finite resource, so you want to keep them from all being occupied by the flood of requests if you can. Hope this helps, Damon On Fri, Mar 9, 2012 at 1:35 AM, Gianni Carabelli wrote: > Hi all. > I've got few servers with varnish + apache on loopback. > Modsecurity mitigate the problem on the only apache side, but fails with > apache + varnish. > I'm using mod_rpaf to get the right ip address, but probably something > goes wrong. > > I would like to get another approach and try to block the attack > completely in varnish. > In apache, some directive say: "if there are enough connection from this > ip in READ/WRITE state, reject incoming connections from that ip" > Is there a way to do so in varnish? > > Thanks > > JohnnyRun > > ______________________________**_________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From TFigueiro at au.westfield.com Fri Mar 9 22:33:09 2012 From: TFigueiro at au.westfield.com (Thiago Figueiro) Date: Fri, 9 Mar 2012 22:33:09 +0000 Subject: Using varnish to increase the cache time of slow pages Message-ID: <22F96A574165AA4482FF2909473477742086DC4D@AUPDC00-MBX01P.au.ad.westfield.com> I wrote a blog post describing quick-win modification I made to our Varnish configuration last week. It lets us keep the default page cache-time low so content is fresh but specifically increases the TTL for pages which are slow to generate. The code is for Varnish 2.1.5 but I'm sure it can be easily adapted to 3.x so I thought I'd share it with the list. http://microrants.blogspot.com.au/2012/03/using-varnish-to-increase-cache-time-of.html Cheers. Thiago. ______________________________________________________ CONFIDENTIALITY NOTICE This electronic mail message, including any and/or all attachments, is for the sole use of the intended recipient(s), and may contain confidential and/or privileged information, pertaining to business conducted under the direction and supervision of the sending organization. All electronic mail messages, which may have been established as expressed views and/or opinions (stated either within the electronic mail message or any of its attachments), are left to the sole responsibility of that of the sender, and are not necessarily attributed to the sending organization. Unauthorized interception, review, use, disclosure or distribution of any such information contained within this electronic mail message and/or its attachment(s), is (are) strictly prohibited. If you are not the intended recipient, please contact the sender by replying to this electronic mail message, along with the destruction all copies of the original electronic mail message (along with any attachments). ______________________________________________________ From weber at zackbummfertig.de Sun Mar 11 13:50:52 2012 From: weber at zackbummfertig.de (Marko Weber) Date: Sun, 11 Mar 2012 14:50:52 +0100 Subject: before i start to install varnish, a question ... Message-ID: <6e8722d79ae366e06521f6dc8cc52a64@zackbummfertig.de> i will not be able to cache php sites or? mean dynamic content pages. or is varnish accelerate them on a other way? thanks for hints marko From thomas.woinke at gmail.com Sun Mar 11 14:26:54 2012 From: thomas.woinke at gmail.com (Thomas Woinke) Date: Sun, 11 Mar 2012 15:26:54 +0100 Subject: before i start to install varnish, a question ... In-Reply-To: <6e8722d79ae366e06521f6dc8cc52a64@zackbummfertig.de> References: <6e8722d79ae366e06521f6dc8cc52a64@zackbummfertig.de> Message-ID: Hi, On Sun, Mar 11, 2012 at 2:50 PM, Marko Weber wrote: > > i will not be able to cache php sites or? mean dynamic content pages. That depends. > or is varnish accelerate them on a other way? What way would that be? > > thanks for hints I suggest you check out the VCL-Reference. Make sure you understand what the default VCL does. There are also some useful VCL-Examples: https://www.varnish-cache.org/trac/wiki/VCLExamples What you will be able to cache totally depends on the application you are using. /thomas From shib4u at gmail.com Sun Mar 11 16:19:44 2012 From: shib4u at gmail.com (Shibashish) Date: Sun, 11 Mar 2012 21:49:44 +0530 Subject: before i start to install varnish, a question ... In-Reply-To: References: <6e8722d79ae366e06521f6dc8cc52a64@zackbummfertig.de> Message-ID: On Sun, Mar 11, 2012 at 7:56 PM, Thomas Woinke wrote: > Hi, > > On Sun, Mar 11, 2012 at 2:50 PM, Marko Weber > wrote: > > > > i will not be able to cache php sites or? mean dynamic content pages. > That depends. > > > or is varnish accelerate them on a other way? > What way would that be? > > > > > thanks for hints > I suggest you check out the VCL-Reference. Make sure you understand > what the default VCL does. There are also some useful VCL-Examples: > https://www.varnish-cache.org/trac/wiki/VCLExamples > > What you will be able to cache totally depends on the application you are > using. > > /thomas > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > To test out, setup your website on 2 different IP, one with varnish and one without. Test and tune the vcl according to your application/website. After you are satisfied with your test, move your website to varnish. ShiB. while ( ! ( succeed = try() ) ); -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sun Mar 11 22:13:48 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 11 Mar 2012 22:13:48 +0000 Subject: Using varnish to increase the cache time of slow pages In-Reply-To: <22F96A574165AA4482FF2909473477742086DC4D@AUPDC00-MBX01P.au.ad.westfield.com> References: <22F96A574165AA4482FF2909473477742086DC4D@AUPDC00-MBX01P.au.ad.westfield.com> Message-ID: On 9 March 2012 22:33, Thiago Figueiro wrote: > I wrote a blog post describing quick-win modification I made to our Varnish configuration last week. ?It lets us keep the default page cache-time low so content is fresh but specifically increases the TTL for pages which are slow to generate. > > The code is for Varnish 2.1.5 but I'm sure it can be easily adapted to 3.x so I thought I'd share it with the list. > > http://microrants.blogspot.com.au/2012/03/using-varnish-to-increase-cache-time-of.html Thanks for posting this. I like the idea of tuning a TTL coarsely based on the time it took you to generate that resource. However, I have a couple of quibbles with this *implementation*: 1) Every bit of logic you embed into VCL is something you have to work at if you move to another HTTP cache. The wonderful thing about HTTP is it's a *standard* - and it includes its own method(s) for communicating the TTL of a particular resource. By embedding this logic in Varnish, you make it so that any other cache you try to use later either has to support the same capabilities as Varnish, or makes you do what I'm about to suggest: make the *back-end* decide how long the resource can be cached. By doing *that* (i.e. making the origin server output standards-compliant caching headers, possibly based on how long it took to produce the content) you not only enable Varnish to do The Right Thing, but *every* HTTP-speaking cache/proxy/etc you might use down the line. Basically (and I totally accept this is a bigger challenge than just munging the TTL in VCL!), fixing your back-end's code so it outputs the right caching headers, possibly using the same methodology, is a more significant win. IMHO :-) 2) From a more concrete PoV, I'm not sure this code copes well with content the back-end explicitly marks as non-cachable (i.e. ttl=0). There may be good reasons for a back-end to do this (possibly not in /your/ app, but you are presenting it as having wider applicability than just your situation, hence maybe caveats should be made more visible) which are irrespective of the time it took to generate the content. Anyway, thanks for introducing the concept! Sorry if this looks a bit negative - it's not really meant to come over as such :-) Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From jewel.nuruddin at eastbeam.co.jp Mon Mar 12 01:41:02 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Mon, 12 Mar 2012 10:41:02 +0900 Subject: Backend server health check(hit even server is down) Message-ID: Hello I use varnish 3.0.2 and I have tow backend web server by round-robin. I found that my current configuration hit the backend if the backend server is down. I want varnish will not look for backend if the backed is down. Can some one please help me. My current configuration is bellow. backend web01 { .host = "10.70.18.10"; .port = "8080"; } backend web02 { .host = "10.70.18.11"; .port = "8080"; } director web round-robin { { .backend = web01; } { .backend = web02; } } sub vcl_recv { set req.backend = web; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From straightflush at gmail.com Mon Mar 12 01:52:10 2012 From: straightflush at gmail.com (AD) Date: Sun, 11 Mar 2012 21:52:10 -0400 Subject: Backend server health check(hit even server is down) In-Reply-To: References: Message-ID: Looks like you are missing healthchecks backend server1 { .host = "server1.example.com"; .probe = { .url = "/"; .interval = 5s; .timeout = 1 s; .window = 5; .threshold = 3; } } On Sun, Mar 11, 2012 at 9:41 PM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hello > I use varnish 3.0.2 and I have tow backend web server by round-robin. > I found that my current configuration hit the backend if the backend > server is down. > I want varnish will not look for backend if the backed is down. > Can some one please help me. > > My current configuration is bellow. > > backend web01 { > .host = "10.70.18.10"; > .port = "8080"; > } > > backend web02 { > .host = "10.70.18.11"; > .port = "8080"; > } > > director web round-robin { > { > .backend = web01; > } > { > .backend = web02; > } > } > > sub vcl_recv { > set req.backend = web; > } > > > > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Mon Mar 12 01:53:45 2012 From: roberto.fernandezcrisial at gmail.com (=?utf-8?B?Um9iZXJ0byBPLiBGZXJuw6FuZGV6IENyaXNpYWw=?=) Date: Mon, 12 Mar 2012 01:53:45 +0000 Subject: Backend server health check(hit even server is down) In-Reply-To: References: Message-ID: <900031116-1331517229-cardhu_decombobulator_blackberry.rim.net-560809311-@b26.c27.bise6.blackberry> Jewel, you should try a backend probe: https://www.varnish-cache.org/trac/wiki/LoadBalancing - Roberto (@rofc) -----Original Message----- From: Jewel Nuruddin Sender: varnish-misc-bounces at varnish-cache.org Date: Mon, 12 Mar 2012 10:41:02 To: Subject: Backend server health check(hit even server is down) _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From TFigueiro at au.westfield.com Mon Mar 12 22:21:50 2012 From: TFigueiro at au.westfield.com (Thiago Figueiro) Date: Mon, 12 Mar 2012 22:21:50 +0000 Subject: Using varnish to increase the cache time of slow pages In-Reply-To: References: <22F96A574165AA4482FF2909473477742086DC4D@AUPDC00-MBX01P.au.ad.westfield.com> Message-ID: <22F96A574165AA4482FF2909473477742088431B@AUPDC00-MBX01P.au.ad.westfield.com> Hi, Jonathan. Thanks for the feedback! > However, I have a couple of quibbles with this *implementation*: > > 1) Every bit of logic you embed into VCL is something you have to work at It's fair to note that other web framework engines seem to use the X-Runtime header for this purpose. But yes, I agree, you might have to implement that in your backend. > munging the TTL in VCL!), fixing your back-end's code so it outputs the > right caching headers, possibly using the same methodology, is a more > significant win. IMHO :-) Ah! No need to put salt in our sores. :) What typically happens is that new features are prioritised over improving performance. I think this is a sad reality in many companies. What little effort goes into performance ends-up being "spread" across the application. If you have editors complaining about content freshness you can now target these specific pages. > 2) From a more concrete PoV, I'm not sure this code copes well with > content the back-end explicitly marks as non-cachable (i.e. ttl=0). We have specific code in our VCL for this and assumed everyone else does. I should have mentioned that when this excerpt runs we have already 'passed' content which is not cacheable. > Anyway, thanks for introducing the concept! Sorry if this looks a bit > negative - it's not really meant to come over as such :-) Not negative at all, they were all good points and I appreciate you taking the time to ping back. Cheers ______________________________________________________ CONFIDENTIALITY NOTICE This electronic mail message, including any and/or all attachments, is for the sole use of the intended recipient(s), and may contain confidential and/or privileged information, pertaining to business conducted under the direction and supervision of the sending organization. All electronic mail messages, which may have been established as expressed views and/or opinions (stated either within the electronic mail message or any of its attachments), are left to the sole responsibility of that of the sender, and are not necessarily attributed to the sending organization. Unauthorized interception, review, use, disclosure or distribution of any such information contained within this electronic mail message and/or its attachment(s), is (are) strictly prohibited. If you are not the intended recipient, please contact the sender by replying to this electronic mail message, along with the destruction all copies of the original electronic mail message (along with any attachments). ______________________________________________________ From ruben at varnish-software.com Thu Mar 15 12:37:24 2012 From: ruben at varnish-software.com (=?UTF-8?Q?Rub=C3=A9n_Romero?=) Date: Thu, 15 Mar 2012 13:37:24 +0100 Subject: =?UTF-8?Q?VUG5_Reminder_=2D_Thursday_22nd_of_March=2C_2012_=40_La_D?= =?UTF-8?Q?=C3=A9fense?= Message-ID: Bonjour everyone, If you are in Paris, France next Thursday and want to know more about Varnish, please join the Varnish User Group Meeting. Details and Registration (free) is here: https://www.varnish-cache.org/vug5 For those of you that have registered(and those that will): See you in Paris next week! Cordialement, -- Rub?n Romero, Global Sales Executive & Community Cheerleader Phone: +47 21 98 92 62 / Mobile: +47 959 64 088 / Skype: ruben_varnish / GTalk: *Varnish makes websites fly!* Whitepapers | Video | Twitter | LinkedIn -------------- next part -------------- An HTML attachment was scrubbed... URL: From savetheinternet at omegasdg.com Thu Mar 15 15:15:38 2012 From: savetheinternet at omegasdg.com (Michael Save) Date: Fri, 16 Mar 2012 02:15:38 +1100 Subject: UNIX sockets Message-ID: Hi, Is it possible to use UNIX domain sockets instead of TCP/IP for backend connections? I use nginx as a backend which is able to listen on UNIX sockets as well as TCP. If there is a way to do this already, please point me in the same direction. If not, is this something varnish plans to add in the future? Thanks, Michael From cyberroadie at gmail.com Thu Mar 15 16:35:25 2012 From: cyberroadie at gmail.com (Olivier Van Acker) Date: Thu, 15 Mar 2012 16:35:25 +0000 Subject: UNIX sockets In-Reply-To: References: Message-ID: You can only use unix domain sockets for localhost On 15 March 2012 15:15, Michael Save wrote: > Hi, > > Is it possible to use UNIX domain sockets instead of TCP/IP for > backend connections? I use nginx as a backend which is able to listen > on UNIX sockets as well as TCP. > > If there is a way to do this already, please point me in the same > direction. If not, is this something varnish plans to add in the > future? > > Thanks, > Michael > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From savetheinternet at omegasdg.com Thu Mar 15 16:44:52 2012 From: savetheinternet at omegasdg.com (Michael Save) Date: Fri, 16 Mar 2012 03:44:52 +1100 Subject: UNIX sockets In-Reply-To: References: Message-ID: My backend is on the same host. On Fri, Mar 16, 2012 at 3:35 AM, Olivier Van Acker wrote: > You can only use unix domain sockets for localhost > > On 15 March 2012 15:15, Michael Save wrote: >> >> Hi, >> >> Is it possible to use UNIX domain sockets instead of TCP/IP for >> backend connections? I use nginx as a backend which is able to listen >> on UNIX sockets as well as TCP. >> >> If there is a way to do this already, please point me in the same >> direction. If not, is this something varnish plans to add in the >> future? >> >> Thanks, >> Michael >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > From michal.paal at digmia.com Fri Mar 16 00:04:37 2012 From: michal.paal at digmia.com (Michal Paal) Date: Fri, 16 Mar 2012 01:04:37 +0100 Subject: Handling multiple beresp.http.set-cookie headers References: <41B34C71-8F4D-4367-A14B-F36FC0E2EE22@digmia.com> Message-ID: > Hi, > > I'm trying to solve this problem for about a week. Situation is that I need to check in VCL, if backend response has cookie with "Logged_in:Y". Backend is also often setting more cookies, and there is only little chance that we can make developers change application, because it is too complex. From my observation and debugging, if I configure this in vcl_fetch: > > if (beresp.http.Set-Cookie ~ "Logged_in:Y") { > return (hit_for_pass); > } > > The problem is that "beresp.http.Set-Cookie" is filled only with first Set-Cookie header from backend. If there are other Set-Cookie headers, I cannot match anything in them. > > So, my question is can I somehow match or access all Set-Cookie headers? > > I've also tryed consolidating Set-Cookie headers using vmod_std.collect, but this violates RFC and doesn't work for clients. > > I would be very thankful for any ideas. > > Have a nice day! > > > > Michal Paal > > http://www.digmia.com > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5023 bytes Desc: not available URL: From perbu at varnish-software.com Fri Mar 16 09:01:21 2012 From: perbu at varnish-software.com (Per Buer) Date: Fri, 16 Mar 2012 10:01:21 +0100 Subject: Handling multiple beresp.http.set-cookie headers In-Reply-To: References: <41B34C71-8F4D-4367-A14B-F36FC0E2EE22@digmia.com> Message-ID: HI Michal, On Fri, Mar 16, 2012 at 1:04 AM, Michal Paal wrote: > > > The problem is that "beresp.http.Set-Cookie" is filled only with first > Set-Cookie header from backend. If there are other Set-Cookie headers, I > cannot match anything in them. > https://github.com/varnish/libvmod-header Per. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugues.alary at gmail.com Fri Mar 16 22:42:33 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Fri, 16 Mar 2012 15:42:33 -0700 Subject: Communication between Varnish and the Backend Message-ID: Hi everybody, I'm configuring varnish to be used with my web application. I need my backend to be able to give instructions to Varnish depending on the page requested. For example, some of my pages contain ESI includes, some don't. I want my application to tell varnish wether or not do the esi processing. This approach allows me to keep my VCL configuration file abstracted from the application. I can then redistribute the VCL to other users and let their application control the cache. So far my solution is to instruct varnish via HTTP headers. In my current example I set a header X-Application-DoEsi to 1 or 0. When varnish receives the response from the backend, it looks for the value of X-Application-DoEsi and does or not the ESI processing. - I was wondering if communicating with varnish via HTTP header is a good solution? - How bad can it be performance wise? - Should I be worried about security (interception/modification of the communication between Varnish and the backend), even if no credential will never be sent through HTTP headers? (Also, currently Varnish and the backend are on the same machine, but chances are that they will in the future not live on the same host). In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? Thank you for your help! -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From kelvin1111111 at gmail.com Sun Mar 18 08:46:21 2012 From: kelvin1111111 at gmail.com (Kelvin Loke) Date: Sun, 18 Mar 2012 16:46:21 +0800 Subject: Analyse ReqEnd in Varnishlog Message-ID: We recently found out that a specific request occasionally have slowness, looking at the varnishlog it tells that backend is not the root cause of this problem. This request is not set to be cached in Varnish, thus pass to backend directly. This is what varnishlog shown me: 319 ReqEnd c 1168207229 1332059091.889164209 1332059091.921136379 3.414758205 0.031944752 0.000027418 I have read through https://www.varnish-cache.org/trac/wiki/Varnishlog but couldn't understand well on the meaning of the fourth number (3.414758205). I am hoping to find out what has actually caused 3.414758205 seconds delay in this case. I am using Varnish 3.0.2, below is the related varnishlog output if you are interested to find out more: ===================================================== 3603 TxRequest - GET 3603 TxURL - /player-tote-backend/s/order/placeOrderWP?serial=-1954678523&data=%7B%22list%22%3A%5B%7B%22selNum%22%3A2%2C%22win%22%3A1%2C%22place%22%3A1%2C%22price%22%3A0.76%2C%22lwin%22%3A11%2C%22lplace%22%3A3%2C%22row%22%3A1%7D%5D%2C%22type%22%3A%22BET%22%2C%22cardId 3603 TxProtocol - HTTP/1.1 3603 TxHeader - x-requested-with: XMLHttpRequest 3603 TxHeader - Accept-Language: en-sg 3603 TxHeader - Referer: http://hosthidden.net/player-tote/tote/main/7293 3603 TxHeader - Accept: application/json, text/javascript, */*; q=0.01 3603 TxHeader - Content-Type: application/x-www-form-urlencoded;charset=utf-8 3603 TxHeader - Accept-Encoding: gzip, deflate 3603 TxHeader - User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; MALC) 3603 TxHeader - Host: hosthidden.net 3603 TxHeader - Cookie: __utma=1.1015690728.1332058884.1332058884.1332058884.1; __utmb=1.3.10.1332058884; __utmz=1.1332058884.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); JSESSIONID=4e6117aadd6cb6652f0c9c32ff79; sto-id-RACING_LOGIN_Varnish_GRP04=IDBABAKM; __utmc=1; 3603 TxHeader - X-Forwarded-For: 119.74.200.110 , 220.255.2.25, 172.16.16.236 3603 TxHeader - X-Cookie.ViewMode: dollar 3603 TxHeader - X-Cookie.Lang: en_US 3603 TxHeader - X-Varnish: 1168207229 319 ReqStart c 172.16.16.236 16818 1168207229 319 RxRequest c GET 319 RxURL c /player-tote-backend/s/order/placeOrderWP?serial=-1954678523&data=%7B%22list%22%3A%5B%7B%22selNum%22%3A2%2C%22win%22%3A1%2C%22place%22%3A1%2C%22price%22%3A0.76%2C%22lwin%22%3A11%2C%22lplace%22%3A3%2C%22row%22%3A1%7D%5D%2C%22type%22%3A%22BET%22%2C%22cardId 319 RxProtocol c HTTP/1.1 319 RxHeader c x-requested-with: XMLHttpRequest 319 RxHeader c Accept-Language: en-sg 319 RxHeader c Referer: http://hosthidden.net/player-tote/tote/main/7293 319 RxHeader c Accept: application/json, text/javascript, */*; q=0.01 319 RxHeader c Content-Type: application/x-www-form-urlencoded;charset=utf-8 319 RxHeader c Accept-Encoding: gzip, deflate 319 RxHeader c User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; MALC) 319 RxHeader c Host: hosthidden.net 319 RxHeader c Connection: Keep-Alive 319 RxHeader c Cookie: __utma=1.1015690728.1332058884.1332058884.1332058884.1; __utmb=1.3.10.1332058884; __utmz=1.1332058884.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); JSESSIONID=4e6117aadd6cb6652f0c9c32ff79; sto-id-RACING_LOGIN_Varnish_GRP04=IDBABAKM; __utmc=1; 319 RxHeader c X-Forwarded-For: 119.74.200.110 , 220.255.2.25 319 VCL_call c recv pass 319 VCL_call c hash 319 Hash c /player-tote-backend/s/order/placeOrderWP?serial=-1954678523&data=%7B%22list%22%3A%5B%7B%22selNum%22%3A2%2C%22win%22%3A1%2C%22place%22%3A1%2C%22price%22%3A0.76%2C%22lwin%22%3A11%2C%22lplace%22%3A3%2C%22row%22%3A1%7D%5D%2C%22type%22%3A%22BET%22%2C%22cardI 319 Hash c dollar 319 Hash c en_US 319 VCL_return c hash 319 VCL_call c pass pass 319 Backend c 3603 member member31 319 TTL c 1168207229 RFC 0 -1 -1 1332059092 0 1332059091 869893200 0 319 VCL_call c fetch 319 TTL c 1168207229 VCL 86400 -1 -1 1332059092 -0 319 VCL_return c deliver 319 ObjProtocol c HTTP/1.1 319 ObjResponse c OK 319 ObjHeader c Server: GlassFish Server Open Source Edition 3.1.2 319 ObjHeader c i: 191 319 ObjHeader c spero-elapse-time: 30.233ms 319 ObjHeader c Pragma: no-cache 319 ObjHeader c Cache-Control: no-cache 319 ObjHeader c Expires: Mon, 26 Jul 1997 05:00:00 GMT 319 ObjHeader c X-Last-Serial: 1118320844 319 ObjHeader c Content-Type: text/javascript;charset=UTF-8 319 ObjHeader c Content-Language: en-SG 319 ObjHeader c Content-Length: 171 319 ObjHeader c Date: Sun, 18 Mar 2012 08:24:51 GMT 319 VCL_call c deliver deliver 319 TxProtocol c HTTP/1.1 319 TxStatus c 200 319 TxResponse c OK 319 TxHeader c Server: GlassFish Server Open Source Edition 3.1.2 319 TxHeader c i: 191 319 TxHeader c spero-elapse-time: 30.233ms 319 TxHeader c Pragma: no-cache 319 TxHeader c Cache-Control: no-cache 319 TxHeader c Expires: Mon, 26 Jul 1997 05:00:00 GMT 319 TxHeader c X-Last-Serial: 1118320844 319 TxHeader c Content-Type: text/javascript;charset=UTF-8 319 TxHeader c Content-Language: en-SG 319 TxHeader c Content-Length: 171 319 TxHeader c Accept-Ranges: bytes 319 TxHeader c Date: Sun, 18 Mar 2012 08:24:51 GMT 319 TxHeader c X-Varnish: 1168207229 319 TxHeader c Age: 0 319 TxHeader c Via: 1.1 varnish 319 TxHeader c Connection: keep-alive 319 Length c 171 319 ReqEnd c 1168207229 1332059091.889164209 1332059091.921136379 3.414758205 0.031944752 0.000027418 ===================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Mon Mar 19 07:36:07 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Mon, 19 Mar 2012 16:36:07 +0900 Subject: Varnish client IP address not display Message-ID: Hello My varnish is run on 10.70.18.22 server and my web server run back end 10.70.18.30 When client browse through varnish in my web server it always show varnish IP(10.70.18.22) But I want my web server should display client IP address. I use the following configuration sub vcl_fetch { remove obj.http.X-Varnish-IP; set obj.http.X-Varnish-IP = server.ip; } It did not work for me. Can some one please help me what should I do. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gasper.furman at delo.si Mon Mar 19 07:46:24 2012 From: gasper.furman at delo.si (=?windows-1252?Q?Ga=9Aper_Furman?=) Date: Mon, 19 Mar 2012 08:46:24 +0100 Subject: Varnish client IP address not display In-Reply-To: References: Message-ID: <4F66E450.9030006@delo.si> Hello in vcl_recv add something like this: sub vcl_recv { remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; } Best regards, Ga?per On 03/19/2012 08:36 AM, Jewel Nuruddin wrote: > Hello > My varnish is run on 10.70.18.22 server and my web server run back > end 10.70.18.30 > When client browse through varnish in my web server it always show > varnish IP(10.70.18.22) > But I want my web server should display client IP address. > I use the following configuration > sub vcl_fetch { > > remove obj.http.X-Varnish-IP; > set obj.http.X-Varnish-IP = server.ip; > > } > It did not work for me. > Can some one please help me what should I do. > > Thanks > Jewel > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc -- Ga?per Furman Spletni razvoj Web Development Delo, d. d. Dunajska 5, 1000 Ljubljana T: +386 1 47 37 946 E: gasper.furman at delo.si -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si.jpg Type: image/jpeg Size: 4535 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si3.jpg Type: image/jpeg Size: 4051 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si2.jpg Type: image/jpeg Size: 5520 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si4.jpg Type: image/jpeg Size: 2639 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mail_logotipi_si5.jpg Type: image/jpeg Size: 1963 bytes Desc: not available URL: From jewel.nuruddin at eastbeam.co.jp Mon Mar 19 07:52:18 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Mon, 19 Mar 2012 16:52:18 +0900 Subject: Varnish client IP address not display In-Reply-To: References: Message-ID: Sorry I the configuration is bellow, please ignore my previous configuration. sub vcl_recv { remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; } But still it did not work for me !!! On Mon, Mar 19, 2012 at 4:36 PM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hello > My varnish is run on 10.70.18.22 server and my web server run back end > 10.70.18.30 > When client browse through varnish in my web server it always show varnish > IP(10.70.18.22) > But I want my web server should display client IP address. > I use the following configuration > > sub vcl_fetch { > > remove obj.http.X-Varnish-IP; > set obj.http.X-Varnish-IP = server.ip; > > } > > It did not work for me. > Can some one please help me what should I do. > > Thanks > Jewel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From varnish at mm.quex.org Mon Mar 19 08:00:29 2012 From: varnish at mm.quex.org (Michael Alger) Date: Mon, 19 Mar 2012 16:00:29 +0800 Subject: Varnish client IP address not display In-Reply-To: References: Message-ID: <20120319080029.GA19957@grum.quex.org> > On Mon, Mar 19, 2012 at 4:36 PM, Jewel Nuruddin wrote: > > My varnish is run on 10.70.18.22 server and my web server run > > back end 10.70.18.30 > > When client browse through varnish in my web server it always > > show varnish IP(10.70.18.22) > > But I want my web server should display client IP address. > > I use the following configuration > Sorry I the configuration is bellow, please ignore my previous > configuration. > > sub vcl_recv { > remove req.http.X-Forwarded-For; > set req.http.X-Forwarded-For = client.ip; > > } > > But still it did not work for me !!! The above code adds a new header "X-Forwarded-For" which will contain the IP address of the client, as seen by Varnish. You can modify the backend server to utilise this header rather than the address of the connection itself, if you wish to display/store/etc. the client's IP address. This is fairly easy if you're displaying this information in your own server-side code (PHP, ASP, etc.). It may be more difficult or impossible if you're relying on server-provided environment variables and built-in functionality. Any information derived from the connection properties will of course include your Varnish server's IP address, since that's the system which is connecting to the backend. From stewsnooze at gmail.com Mon Mar 19 08:02:31 2012 From: stewsnooze at gmail.com (Stewart Robinson) Date: Mon, 19 Mar 2012 08:02:31 +0000 Subject: Varnish client IP address not display In-Reply-To: References: Message-ID: <1566545273393188183@unknownmsgid> Jewel, What header are you checking on the back end? You should be reading the x-forwarded-for header rather than some form of remote_addr. Stewart Robinson @stewsnooze FullFatThings.com On 19 Mar 2012, at 07:53, Jewel Nuruddin wrote: Sorry I the configuration is bellow, please ignore my previous configuration. sub vcl_recv { remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; } But still it did not work for me !!! On Mon, Mar 19, 2012 at 4:36 PM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hello > My varnish is run on 10.70.18.22 server and my web server run back end > 10.70.18.30 > When client browse through varnish in my web server it always show varnish > IP(10.70.18.22) > But I want my web server should display client IP address. > I use the following configuration > > sub vcl_fetch { > > remove obj.http.X-Varnish-IP; > set obj.http.X-Varnish-IP = server.ip; > > } > > It did not work for me. > Can some one please help me what should I do. > > Thanks > Jewel > _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc -------------- next part -------------- An HTML attachment was scrubbed... URL: From geoff at uplex.de Mon Mar 19 08:17:34 2012 From: geoff at uplex.de (Geoff Simmons) Date: Mon, 19 Mar 2012 09:17:34 +0100 Subject: Varnish client IP address not display In-Reply-To: <20120319080029.GA19957@grum.quex.org> References: <20120319080029.GA19957@grum.quex.org> Message-ID: <4F66EB9E.7040806@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 3/19/12 9:00 AM, Michael Alger wrote: >> On Mon, Mar 19, 2012 at 4:36 PM, Jewel Nuruddin wrote: >>> My varnish is run on 10.70.18.22 server and my web server run >>> back end 10.70.18.30 When client browse through varnish in my >>> web server it always show varnish IP(10.70.18.22) But I want my >>> web server should display client IP address. I use the >>> following configuration >> Sorry I the configuration is bellow, please ignore my previous >> configuration. >> >> sub vcl_recv { remove req.http.X-Forwarded-For; set >> req.http.X-Forwarded-For = client.ip; >> >> } >> >> But still it did not work for me !!! > > The above code adds a new header "X-Forwarded-For" which will > contain the IP address of the client, as seen by Varnish. You can > modify the backend server to utilise this header rather than the > address of the connection itself, if you wish to > display/store/etc. the client's IP address. This is fairly easy if > you're displaying this information in your own server-side code > (PHP, ASP, etc.). Should add to this that in vcl_recv(), we don't know if the request will be seen by a backend at all -- it depends on whether or not Varnish decides to deliver a cached object. If backends generate responses that include a client IP obtained from X-Forwarded-For, and those responses are cached, then when Varnish returns the cached object, it will have whatever client IP was included when the backend generated it. That very likely *won't* be the IP of the client who sent the current request. If you want Varnish to return responses that include the current client IP every time, then it is almost certainly impossible to have Varnish cache those responses. There might be some sort of trick here, perhaps some kind of black magic with ESI, but I doubt it. Is this is a problem you could solve some other way? Having the current client IP in every response and caching with Varnish are two goals that are in conflict with one another. Best, Geoff - -- UPLEX Systemoptimierung Schwanenwik 24 22087 Hamburg http://uplex.de/ Mob: +49-176-63690917 -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCAAGBQJPZuudAAoJEOUwvh9pJNUReZoP/jTCsZB1HNE3s9nv5ybtrTOR 2KWLmGlkF5ZoO7GAVfy+20FwP2RoeBphAl6k8N2Wve3a5bP5ZgUZT3dtlHUh1u9l LGuW2qBtU76yNnHpGWbQXifTN26DZ6e24MuWkr+mpMbPe0kAFSxEukvmVSBZGwgW IVbsIW025AnkNL3DHUvE3NcBYnw/zuGuvBWF2NyT7a+hC/jJfE9KUv2GVGRKhK8o UtTl8TiyWZsKIWLGGJuWg4pNMKxLoGyXiHuY4FAs32u96m14yrvIc27/IB1N6rJw x7Od8oNYPYrUp9sI5o/KIVqAM7kg1kqlAy7/HdZ647JyXMODQqf4HxjURa+1NpJl STNrLh9VTgNBIMHiGBpyq54tBm1Hr43qh/JN9T8OegkuCbf1Jpmb2nwP+S4mt6hu CH3qbWm6HDdX20c5s9n9Pq+m2NCz7pKkWv0QJmtVHigriiZBaQEcTRynAboctbGD DcgJkkCvVfNYpSPJvHQndkHUj7vXoilN7wUXUQm3mB111RpqeiZ5BaocgeJ+iXHf FScApUGhYDxI/FbCkSj9tHo5RSpydorNqwkQREFLgzre1pUBBt4Xu6vg5eEdQt1l ialnhCXYZeS0zxq+3QFQvs3mpKJZ60HFZEcjBqPPzKcAqxhKe1y057PjHoyY+GFp FEQBlT1LfpQVu9pTutcU =nJcZ -----END PGP SIGNATURE----- From geoff at uplex.de Mon Mar 19 08:28:58 2012 From: geoff at uplex.de (Geoff Simmons) Date: Mon, 19 Mar 2012 09:28:58 +0100 Subject: Varnish client IP address not display In-Reply-To: <4F66EB9E.7040806@uplex.de> References: <20120319080029.GA19957@grum.quex.org> <4F66EB9E.7040806@uplex.de> Message-ID: <4F66EE4A.8000509@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 I said: > If you want Varnish to return responses that include the current > client IP every time, then it is almost certainly impossible to > have Varnish cache those responses. There might be some sort of > trick here, perhaps some kind of black magic with ESI, but I doubt > it. ... but on second thought, maybe it's not that much black magic after all. The "main" object, which can be cached, can contain an ESI include for a fragment that points to an application that just prints out whatever it finds in X-Fowarded-For. Then you'd have to make sure that the included fragment is never cached -- return(pass) for the URL. (Can you do that with ESI?) But still, without knowing what the problem to be solved is, I wonder if this solution is overkill. Geoff - -- UPLEX Systemoptimierung Schwanenwik 24 22087 Hamburg http://uplex.de/ Mob: +49-176-63690917 -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCAAGBQJPZu5JAAoJEOUwvh9pJNURVPkP/1O2drGSkV2oT+uMO9YtXh4w 9nz9/tYZfJMEktXhAjAga4IwYUH/a8/6LECLEvTLLQEe+Y9r6hil7ephGxdaiVwh l8qQYPTdKD5OdN5KY3ZbGVTLP9o/6h+aSaOumiEezr3fdB4vOjDVAOqY46SedppU jiQYcEAyM+LmVZmF4bfCYk3jKpYaeFu/OdOHNoqk1zSvYtzC3klSjUTTzBaP6aOn wUi6Dj/nzc7+092/2+78+3LZIVdG61bNSt+qgcyneopSge1HLiDUCeMoYUsKmnkj f6RXHOLwaEMGDscfgG3sfIhEaRNElZkVbnklpAVOQ/KLqq1wSXd69yoRvsn7yw9+ 6m3j4rT2QfFl7T43o5BRuqtOhFZfpJKCwf2q969sUBtg6vAYM6YoLyblqdyFVuLa eJkImVK95E9Zqz+WX/6Zthx9Cdp+B0+6XU28HQuoGr2IB88aQZ/RHLwNdHJA1iI2 kMQb8k8Ns6tYFeZEAzRRHtJtxL1mh+2DEhRDTh/amZ4dFOvcqhcTVpirfhI48t4X hY/Do/LUW8bSNen96k4JozrwpQvkY03LkzpPnfwDb3cXKohJb3ug2YZ10KXNUnDh bPh7CA2WiSXy5kdCUr73EvfWo2XDXMlEHfJu2I1Zh5xG01A2vVTub4Lpkvn/gmSo z+ggkDmtHMGhbav1yh4v =kvU5 -----END PGP SIGNATURE----- From info at massivescale.net Mon Mar 19 11:39:36 2012 From: info at massivescale.net (MassiveScale.net) Date: Mon, 19 Mar 2012 12:39:36 +0100 Subject: Varnish client IP address not display In-Reply-To: <1566545273393188183@unknownmsgid> References: <1566545273393188183@unknownmsgid> Message-ID: <4F671AF8.3060201@massivescale.net> On 03/19/2012 09:02 AM, Stewart Robinson wrote: > Jewel, > What header are you checking on the back end? > You should be reading the x-forwarded-for header rather than some form > of remote_addr. Alternatively, if your backend server is Apache, you could use mod_rpaf http://stderr.net/apache/rpaf/ -- Andrzej Godziuk http://MassiveScale.net/ From contact at jpluscplusm.com Mon Mar 19 13:25:22 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 19 Mar 2012 13:25:22 +0000 Subject: VUG5 Paris BOF Message-ID: Hi all - I'm heading along to VUG5 this week - really looking forward to meeting a lot of you and seeing how you're using and abusing our favourite tool :-) When I signed up, I don't recall ticking the "BOF" checkbox - could anyone let me know if it's too late to get in on that action? Either way, are people (like me) who are attending *just* the user day (Thursday) perhaps looking for more Varnish chat on the Friday or the weekend? I'm there 'til Sunday, and would love to get the most out of a high concentration of Varnish-literate folk! All the best, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From hugues.alary at gmail.com Mon Mar 19 19:50:23 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Mon, 19 Mar 2012 12:50:23 -0700 Subject: Communication between Varnish and the Backend In-Reply-To: References: Message-ID: Happy Monday everybody, Nobody, got some good advices for me? :) Thanks, -Hugues On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: > Hi everybody, > > I'm configuring varnish to be used with my web application. > > I need my backend to be able to give instructions to Varnish depending on > the page requested. For example, some of my pages contain ESI includes, > some don't. > > I want my application to tell varnish wether or not do the esi > processing. This approach allows me to keep my VCL configuration file > abstracted from the application. I can then redistribute the VCL to other > users and let their application control the cache. > > So far my solution is to instruct varnish via HTTP headers. > > In my current example I set a header X-Application-DoEsi to 1 or 0. When > varnish receives the response from the backend, it looks for the value > of X-Application-DoEsi and does or not the ESI processing. > > - I was wondering if communicating with varnish via HTTP header is a > good solution? > - How bad can it be performance wise? > - Should I be worried about security (interception/modification of the > communication between Varnish and the backend), even if no credential will > never be sent through HTTP headers? (Also, currently Varnish and the > backend are on the same machine, but chances are that they will in the > future not live on the same host). > > In the future, I plan on instructing varnish not to cache certain pages > containing user defined query strings. I want the user to be able to > specify these un-cachable urls query strings directly in the application. > The application will then send the un-cachable query strings in a header > X-Application-QueryStringNoCache: "querystring1,querystring2,...". > > Is that a bad idea? > > Thank you for your help! > > -- > Hugues ALARY > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeroen.ooms at stat.ucla.edu Tue Mar 20 00:11:57 2012 From: jeroen.ooms at stat.ucla.edu (Jeroen Ooms) Date: Mon, 19 Mar 2012 17:11:57 -0700 Subject: using the max-age request header Message-ID: How do I configure my VLC to let Varnish respect the 'Cache-Control max-age' request header? Someone on SO suggested the following: if (req.http.Cache-Control ~ '\bmax-age=\b`) { if (std.duration(regsub(req.http.Cache-Control, ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { return (pass); } } However, what I don't like about this is that vcl_pass does not actually update the cache with the new entry. How can I configure it so that when max age < obj.age, a fresh copy will be fetched and inserted into cache? From perbu at varnish-software.com Tue Mar 20 06:25:05 2012 From: perbu at varnish-software.com (Per Buer) Date: Tue, 20 Mar 2012 07:25:05 +0100 Subject: Communication between Varnish and the Backend In-Reply-To: References: Message-ID: On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: (..) > > - I was wondering if communicating with varnish via HTTP header is a > good solution? > > Yes. > > - How bad can it be performance wise? > > Negligible. > > - Should I be worried about security (interception/modification of the > communication between Varnish and the backend), even if no credential will > never be sent through HTTP headers? (Also, currently Varnish and the > backend are on the same machine, but chances are that they will in the > future not live on the same host). > > It's more or less impossible to turn Varnish into an open proxy so I wouldn't worry about that. > > > In the future, I plan on instructing varnish not to cache certain pages > containing user defined query strings. I want the user to be able to > specify these un-cachable urls query strings directly in the application. > The application will then send the un-cachable query strings in a header > X-Application-QueryStringNoCache: "querystring1,querystring2,...". > > Is that a bad idea? > No. If it works for you then go for it. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From mib at electronic-minds.de Tue Mar 20 09:24:02 2012 From: mib at electronic-minds.de (Michael Borejdo) Date: Tue, 20 Mar 2012 09:24:02 +0000 Subject: Stale-While-Revalidate or Similar Message-ID: Hello List, Is there support for something like "stale-while-revalidate" coming to Varnish? I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. Or is there any other way with using vcl trickery to accomplish this? (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) [1] [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html Thanks Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From graham.lyons at bbc.co.uk Tue Mar 20 09:50:54 2012 From: graham.lyons at bbc.co.uk (Graham Lyons) Date: Tue, 20 Mar 2012 09:50:54 +0000 Subject: Stale-While-Revalidate or Similar In-Reply-To: References: Message-ID: <9303601D-DC59-45DA-BCCB-6B0D3621557E@bbc.co.uk> Hi Michael, There is a similar feature to this available in Varnish: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. Graham. On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: > Send varnish-misc mailing list submissions to > varnish-misc at varnish-cache.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > or, via email, send a message with subject or body 'help' to > varnish-misc-request at varnish-cache.org > > You can reach the person managing the list at > varnish-misc-owner at varnish-cache.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of varnish-misc digest..." > > > Today's Topics: > > 1. Re: Varnish client IP address not display (MassiveScale.net) > 2. VUG5 Paris BOF (Jonathan Matthews) > 3. Re: Communication between Varnish and the Backend (Hugues Alary) > 4. using the max-age request header (Jeroen Ooms) > 5. Re: Communication between Varnish and the Backend (Per Buer) > 6. Stale-While-Revalidate or Similar (Michael Borejdo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 19 Mar 2012 12:39:36 +0100 > From: "MassiveScale.net" > To: varnish-misc at varnish-cache.org > Subject: Re: Varnish client IP address not display > Message-ID: <4F671AF8.3060201 at massivescale.net> > Content-Type: text/plain; charset=ISO-8859-1 > > On 03/19/2012 09:02 AM, Stewart Robinson wrote: >> Jewel, >> What header are you checking on the back end? >> You should be reading the x-forwarded-for header rather than some form >> of remote_addr. > > Alternatively, if your backend server is Apache, you could use mod_rpaf > http://stderr.net/apache/rpaf/ > > -- > Andrzej Godziuk > http://MassiveScale.net/ > > > > ------------------------------ > > Message: 2 > Date: Mon, 19 Mar 2012 13:25:22 +0000 > From: Jonathan Matthews > To: varnish-misc at varnish-cache.org > Subject: VUG5 Paris BOF > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > Hi all - > > I'm heading along to VUG5 this week - really looking forward to > meeting a lot of you and seeing how you're using and abusing our > favourite tool :-) > > When I signed up, I don't recall ticking the "BOF" checkbox - could > anyone let me know if it's too late to get in on that action? > > Either way, are people (like me) who are attending *just* the user day > (Thursday) perhaps looking for more Varnish chat on the Friday or the > weekend? I'm there 'til Sunday, and would love to get the most out of > a high concentration of Varnish-literate folk! > > All the best, > Jonathan > -- > Jonathan Matthews > London, Oxford, UK > http://www.jpluscplusm.com/contact.html > > > > ------------------------------ > > Message: 3 > Date: Mon, 19 Mar 2012 12:50:23 -0700 > From: Hugues Alary > To: varnish-misc at varnish-cache.org > Subject: Re: Communication between Varnish and the Backend > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Happy Monday everybody, > > Nobody, got some good advices for me? :) > > Thanks, > -Hugues > > On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: > >> Hi everybody, >> >> I'm configuring varnish to be used with my web application. >> >> I need my backend to be able to give instructions to Varnish depending on >> the page requested. For example, some of my pages contain ESI includes, >> some don't. >> >> I want my application to tell varnish wether or not do the esi >> processing. This approach allows me to keep my VCL configuration file >> abstracted from the application. I can then redistribute the VCL to other >> users and let their application control the cache. >> >> So far my solution is to instruct varnish via HTTP headers. >> >> In my current example I set a header X-Application-DoEsi to 1 or 0. When >> varnish receives the response from the backend, it looks for the value >> of X-Application-DoEsi and does or not the ESI processing. >> >> - I was wondering if communicating with varnish via HTTP header is a >> good solution? >> - How bad can it be performance wise? >> - Should I be worried about security (interception/modification of the >> communication between Varnish and the backend), even if no credential will >> never be sent through HTTP headers? (Also, currently Varnish and the >> backend are on the same machine, but chances are that they will in the >> future not live on the same host). >> >> In the future, I plan on instructing varnish not to cache certain pages >> containing user defined query strings. I want the user to be able to >> specify these un-cachable urls query strings directly in the application. >> The application will then send the un-cachable query strings in a header >> X-Application-QueryStringNoCache: "querystring1,querystring2,...". >> >> Is that a bad idea? >> >> Thank you for your help! >> >> -- >> Hugues ALARY >> > > > > -- > Hugues ALARY > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 4 > Date: Mon, 19 Mar 2012 17:11:57 -0700 > From: Jeroen Ooms > To: varnish-misc at varnish-cache.org > Subject: using the max-age request header > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > How do I configure my VLC to let Varnish respect the 'Cache-Control > max-age' request header? Someone on SO suggested the following: > > if (req.http.Cache-Control ~ '\bmax-age=\b`) { > if (std.duration(regsub(req.http.Cache-Control, > ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { > return (pass); > } > } > > However, what I don't like about this is that vcl_pass does not > actually update the cache with the new entry. How can I configure it > so that when max age < obj.age, a fresh copy will be fetched and > inserted into cache? > > > > ------------------------------ > > Message: 5 > Date: Tue, 20 Mar 2012 07:25:05 +0100 > From: Per Buer > To: Hugues Alary > Cc: varnish-misc at varnish-cache.org > Subject: Re: Communication between Varnish and the Backend > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: > (..) > >> >> - I was wondering if communicating with varnish via HTTP header is a >> good solution? >> >> Yes. > >> >> - How bad can it be performance wise? >> >> Negligible. > > >> >> - Should I be worried about security (interception/modification of the >> communication between Varnish and the backend), even if no credential will >> never be sent through HTTP headers? (Also, currently Varnish and the >> backend are on the same machine, but chances are that they will in the >> future not live on the same host). >> >> > It's more or less impossible to turn Varnish into an open proxy so I > wouldn't worry about that. > > >> >> >> In the future, I plan on instructing varnish not to cache certain pages >> containing user defined query strings. I want the user to be able to >> specify these un-cachable urls query strings directly in the application. >> The application will then send the un-cachable query strings in a header >> X-Application-QueryStringNoCache: "querystring1,querystring2,...". >> >> Is that a bad idea? >> > > No. If it works for you then go for it. > > > -- > Per Buer, CEO > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | > Video | > Twitter > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Tue, 20 Mar 2012 09:24:02 +0000 > From: Michael Borejdo > To: "varnish-misc at varnish-cache.org" > Subject: Stale-While-Revalidate or Similar > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > Hello List, > > Is there support for something like "stale-while-revalidate" coming to Varnish? > I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. > Or is there any other way with using vcl trickery to accomplish this? > (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) [1] > > [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html > > Thanks > > Michael > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > End of varnish-misc Digest, Vol 72, Issue 21 > ******************************************** http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mib at electronic-minds.de Tue Mar 20 10:06:04 2012 From: mib at electronic-minds.de (Michael Borejdo) Date: Tue, 20 Mar 2012 10:06:04 +0000 Subject: Stale-While-Revalidate or Similar In-Reply-To: <9303601D-DC59-45DA-BCCB-6B0D3621557E@bbc.co.uk> References: <9303601D-DC59-45DA-BCCB-6B0D3621557E@bbc.co.uk> Message-ID: Hi there, >There is a similar feature to this available in Varnish: >https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Unfortunately my servers are healthy (they do not send 5XX or the like), but are just slow as hell sometimes. Or how is "health" "measured" by varnish? I think this solution will not work for me, since my backend seems to be healthy. What I basically want to accomplish is to prevent "the poor sod" from waiting for a request. Stale content is acceptable, waiting isn't. Thanks Michael --------------------------------------------------------------- Von: varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] Im Auftrag von Graham Lyons Gesendet: Dienstag, 20. M?rz 2012 10:51 An: varnish-misc at varnish-cache.org Betreff: Re: Stale-While-Revalidate or Similar Hi Michael, There is a similar feature to this available in Varnish: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. Graham. On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: Send varnish-misc mailing list submissions to varnish-misc at varnish-cache.org To subscribe or unsubscribe via the World Wide Web, visit https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc or, via email, send a message with subject or body 'help' to varnish-misc-request at varnish-cache.org You can reach the person managing the list at varnish-misc-owner at varnish-cache.org When replying, please edit your Subject line so it is more specific than "Re: Contents of varnish-misc digest..." Today's Topics: ??1. Re: Varnish client IP address not display (MassiveScale.net) ??2. VUG5 Paris BOF (Jonathan Matthews) ??3. Re: Communication between Varnish and the Backend (Hugues Alary) ??4. using the max-age request header (Jeroen Ooms) ??5. Re: Communication between Varnish and the Backend (Per Buer) ??6. Stale-While-Revalidate or Similar (Michael Borejdo) ---------------------------------------------------------------------- Message: 1 Date: Mon, 19 Mar 2012 12:39:36 +0100 From: "MassiveScale.net" To: varnish-misc at varnish-cache.org Subject: Re: Varnish client IP address not display Message-ID: <4F671AF8.3060201 at massivescale.net> Content-Type: text/plain; charset=ISO-8859-1 On 03/19/2012 09:02 AM, Stewart Robinson wrote: Jewel, What header are you checking on the back end? You should be reading the x-forwarded-for header rather than some form of remote_addr. Alternatively, if your backend server is Apache, you could use mod_rpaf http://stderr.net/apache/rpaf/ -- Andrzej Godziuk http://MassiveScale.net/ ------------------------------ Message: 2 Date: Mon, 19 Mar 2012 13:25:22 +0000 From: Jonathan Matthews To: varnish-misc at varnish-cache.org Subject: VUG5 Paris BOF Message-ID: Content-Type: text/plain; charset=UTF-8 Hi all - I'm heading along to VUG5 this week - really looking forward to meeting a lot of you and seeing how you're using and abusing our favourite tool :-) When I signed up, I don't recall ticking the "BOF" checkbox - could anyone let me know if it's too late to get in on that action? Either way, are people (like me) who are attending *just* the user day (Thursday) perhaps looking for more Varnish chat on the Friday or the weekend? I'm there 'til Sunday, and would love to get the most out of a high concentration of Varnish-literate folk! All the best, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html ------------------------------ Message: 3 Date: Mon, 19 Mar 2012 12:50:23 -0700 From: Hugues Alary To: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" Happy Monday everybody, Nobody, got some good advices for me? :) Thanks, -Hugues On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: Hi everybody, I'm configuring varnish to be used with my web application. I need my backend to be able to give instructions to Varnish depending on the page requested. For example, some of my pages contain ESI includes, some don't. I want my application to tell varnish wether or not do the esi processing. This approach allows me to keep my VCL configuration file abstracted from the application. I can then redistribute the VCL to other users and let their application control the cache. So far my solution is to instruct varnish via HTTP headers. In my current example I set a header X-Application-DoEsi to 1 or 0. When varnish receives the response from the backend, it looks for the value of X-Application-DoEsi and does or not the ESI processing. ??- I was wondering if communicating with varnish via HTTP header is a ??good solution? ??- How bad can it be performance wise? ??- Should I be worried about security (interception/modification of the ??communication between Varnish and the backend), even if no credential will ??never be sent through HTTP headers? (Also, currently Varnish and the ??backend are on the same machine, but chances are that they will in the ??future not live on the same host). In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? Thank you for your help! -- Hugues ALARY -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Mon, 19 Mar 2012 17:11:57 -0700 From: Jeroen Ooms To: varnish-misc at varnish-cache.org Subject: using the max-age request header Message-ID: Content-Type: text/plain; charset=ISO-8859-1 How do I configure my VLC to let Varnish respect the 'Cache-Control max-age' request header? Someone on SO suggested the following: if (req.http.Cache-Control ~ '\bmax-age=\b`) { ???if (std.duration(regsub(req.http.Cache-Control, ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { ???????return (pass); ???} } However, what I don't like about this is that vcl_pass does not actually update the cache with the new entry. How can I configure it so that when max age < obj.age, a fresh copy will be fetched and inserted into cache? ------------------------------ Message: 5 Date: Tue, 20 Mar 2012 07:25:05 +0100 From: Per Buer To: Hugues Alary Cc: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: (..) ??- I was wondering if communicating with varnish via HTTP header is a ??good solution? Yes. ??- How bad can it be performance wise? Negligible. ??- Should I be worried about security (interception/modification of the ??communication between Varnish and the backend), even if no credential will ??never be sent through HTTP headers? (Also, currently Varnish and the ??backend are on the same machine, but chances are that they will in the ??future not live on the same host). It's more or less impossible to turn Varnish into an open proxy so I wouldn't worry about that. In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? No. If it works for you then go for it. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 6 Date: Tue, 20 Mar 2012 09:24:02 +0000 From: Michael Borejdo To: "varnish-misc at varnish-cache.org" Subject: Stale-While-Revalidate or Similar Message-ID: Content-Type: text/plain; charset="us-ascii" Hello List, Is there support for something like "stale-while-revalidate" coming to Varnish? I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. Or is there any other way with using vcl trickery to accomplish this? (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) ?[1] [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html Thanks Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc End of varnish-misc Digest, Vol 72, Issue 21 ******************************************** ? http://www.bbc.co.uk This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. From graham.lyons at bbc.co.uk Tue Mar 20 10:16:32 2012 From: graham.lyons at bbc.co.uk (Graham Lyons) Date: Tue, 20 Mar 2012 10:16:32 +0000 Subject: Stale-While-Revalidate or Similar In-Reply-To: References: Message-ID: <91B1AABC-E35E-491E-A7DC-10BDC3638D3F@bbc.co.uk> Yeah, you want grace mode: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html#grace-mode As it says on that page, "it serves stale content to avoid request pile-up." On 20 Mar 2012, at 10:06, varnish-misc-request at varnish-cache.org wrote: > Send varnish-misc mailing list submissions to > varnish-misc at varnish-cache.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > or, via email, send a message with subject or body 'help' to > varnish-misc-request at varnish-cache.org > > You can reach the person managing the list at > varnish-misc-owner at varnish-cache.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of varnish-misc digest..." > > > Today's Topics: > > 1. Re: Stale-While-Revalidate or Similar (Graham Lyons) > 2. Re: Stale-While-Revalidate or Similar (Michael Borejdo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 20 Mar 2012 09:50:54 +0000 > From: Graham Lyons > To: varnish-misc at varnish-cache.org > Subject: Re: Stale-While-Revalidate or Similar > Message-ID: <9303601D-DC59-45DA-BCCB-6B0D3621557E at bbc.co.uk> > Content-Type: text/plain; charset="us-ascii" > > Hi Michael, > > There is a similar feature to this available in Varnish: > https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html > > Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. > > Graham. > > On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: > >> Send varnish-misc mailing list submissions to >> varnish-misc at varnish-cache.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >> or, via email, send a message with subject or body 'help' to >> varnish-misc-request at varnish-cache.org >> >> You can reach the person managing the list at >> varnish-misc-owner at varnish-cache.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of varnish-misc digest..." >> >> >> Today's Topics: >> >> 1. Re: Varnish client IP address not display (MassiveScale.net) >> 2. VUG5 Paris BOF (Jonathan Matthews) >> 3. Re: Communication between Varnish and the Backend (Hugues Alary) >> 4. using the max-age request header (Jeroen Ooms) >> 5. Re: Communication between Varnish and the Backend (Per Buer) >> 6. Stale-While-Revalidate or Similar (Michael Borejdo) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 19 Mar 2012 12:39:36 +0100 >> From: "MassiveScale.net" >> To: varnish-misc at varnish-cache.org >> Subject: Re: Varnish client IP address not display >> Message-ID: <4F671AF8.3060201 at massivescale.net> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> On 03/19/2012 09:02 AM, Stewart Robinson wrote: >>> Jewel, >>> What header are you checking on the back end? >>> You should be reading the x-forwarded-for header rather than some form >>> of remote_addr. >> >> Alternatively, if your backend server is Apache, you could use mod_rpaf >> http://stderr.net/apache/rpaf/ >> >> -- >> Andrzej Godziuk >> http://MassiveScale.net/ >> >> >> >> ------------------------------ >> >> Message: 2 >> Date: Mon, 19 Mar 2012 13:25:22 +0000 >> From: Jonathan Matthews >> To: varnish-misc at varnish-cache.org >> Subject: VUG5 Paris BOF >> Message-ID: >> >> Content-Type: text/plain; charset=UTF-8 >> >> Hi all - >> >> I'm heading along to VUG5 this week - really looking forward to >> meeting a lot of you and seeing how you're using and abusing our >> favourite tool :-) >> >> When I signed up, I don't recall ticking the "BOF" checkbox - could >> anyone let me know if it's too late to get in on that action? >> >> Either way, are people (like me) who are attending *just* the user day >> (Thursday) perhaps looking for more Varnish chat on the Friday or the >> weekend? I'm there 'til Sunday, and would love to get the most out of >> a high concentration of Varnish-literate folk! >> >> All the best, >> Jonathan >> -- >> Jonathan Matthews >> London, Oxford, UK >> http://www.jpluscplusm.com/contact.html >> >> >> >> ------------------------------ >> >> Message: 3 >> Date: Mon, 19 Mar 2012 12:50:23 -0700 >> From: Hugues Alary >> To: varnish-misc at varnish-cache.org >> Subject: Re: Communication between Varnish and the Backend >> Message-ID: >> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Happy Monday everybody, >> >> Nobody, got some good advices for me? :) >> >> Thanks, >> -Hugues >> >> On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: >> >>> Hi everybody, >>> >>> I'm configuring varnish to be used with my web application. >>> >>> I need my backend to be able to give instructions to Varnish depending on >>> the page requested. For example, some of my pages contain ESI includes, >>> some don't. >>> >>> I want my application to tell varnish wether or not do the esi >>> processing. This approach allows me to keep my VCL configuration file >>> abstracted from the application. I can then redistribute the VCL to other >>> users and let their application control the cache. >>> >>> So far my solution is to instruct varnish via HTTP headers. >>> >>> In my current example I set a header X-Application-DoEsi to 1 or 0. When >>> varnish receives the response from the backend, it looks for the value >>> of X-Application-DoEsi and does or not the ESI processing. >>> >>> - I was wondering if communicating with varnish via HTTP header is a >>> good solution? >>> - How bad can it be performance wise? >>> - Should I be worried about security (interception/modification of the >>> communication between Varnish and the backend), even if no credential will >>> never be sent through HTTP headers? (Also, currently Varnish and the >>> backend are on the same machine, but chances are that they will in the >>> future not live on the same host). >>> >>> In the future, I plan on instructing varnish not to cache certain pages >>> containing user defined query strings. I want the user to be able to >>> specify these un-cachable urls query strings directly in the application. >>> The application will then send the un-cachable query strings in a header >>> X-Application-QueryStringNoCache: "querystring1,querystring2,...". >>> >>> Is that a bad idea? >>> >>> Thank you for your help! >>> >>> -- >>> Hugues ALARY >>> >> >> >> >> -- >> Hugues ALARY >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 4 >> Date: Mon, 19 Mar 2012 17:11:57 -0700 >> From: Jeroen Ooms >> To: varnish-misc at varnish-cache.org >> Subject: using the max-age request header >> Message-ID: >> >> Content-Type: text/plain; charset=ISO-8859-1 >> >> How do I configure my VLC to let Varnish respect the 'Cache-Control >> max-age' request header? Someone on SO suggested the following: >> >> if (req.http.Cache-Control ~ '\bmax-age=\b`) { >> if (std.duration(regsub(req.http.Cache-Control, >> ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { >> return (pass); >> } >> } >> >> However, what I don't like about this is that vcl_pass does not >> actually update the cache with the new entry. How can I configure it >> so that when max age < obj.age, a fresh copy will be fetched and >> inserted into cache? >> >> >> >> ------------------------------ >> >> Message: 5 >> Date: Tue, 20 Mar 2012 07:25:05 +0100 >> From: Per Buer >> To: Hugues Alary >> Cc: varnish-misc at varnish-cache.org >> Subject: Re: Communication between Varnish and the Backend >> Message-ID: >> >> Content-Type: text/plain; charset="iso-8859-1" >> >> On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: >> (..) >> >>> >>> - I was wondering if communicating with varnish via HTTP header is a >>> good solution? >>> >>> Yes. >> >>> >>> - How bad can it be performance wise? >>> >>> Negligible. >> >> >>> >>> - Should I be worried about security (interception/modification of the >>> communication between Varnish and the backend), even if no credential will >>> never be sent through HTTP headers? (Also, currently Varnish and the >>> backend are on the same machine, but chances are that they will in the >>> future not live on the same host). >>> >>> >> It's more or less impossible to turn Varnish into an open proxy so I >> wouldn't worry about that. >> >> >>> >>> >>> In the future, I plan on instructing varnish not to cache certain pages >>> containing user defined query strings. I want the user to be able to >>> specify these un-cachable urls query strings directly in the application. >>> The application will then send the un-cachable query strings in a header >>> X-Application-QueryStringNoCache: "querystring1,querystring2,...". >>> >>> Is that a bad idea? >>> >> >> No. If it works for you then go for it. >> >> >> -- >> Per Buer, CEO >> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer >> *Varnish makes websites fly!* >> Whitepapers | >> Video | >> Twitter >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> Message: 6 >> Date: Tue, 20 Mar 2012 09:24:02 +0000 >> From: Michael Borejdo >> To: "varnish-misc at varnish-cache.org" >> Subject: Stale-While-Revalidate or Similar >> Message-ID: >> >> >> Content-Type: text/plain; charset="us-ascii" >> >> Hello List, >> >> Is there support for something like "stale-while-revalidate" coming to Varnish? >> I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. >> Or is there any other way with using vcl trickery to accomplish this? >> (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) [1] >> >> [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html >> >> Thanks >> >> Michael >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> ------------------------------ >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >> >> End of varnish-misc Digest, Vol 72, Issue 21 >> ******************************************** > > > http://www.bbc.co.uk/ > This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. > If you have received it in error, please delete it from your system. > Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. > Please note that the BBC monitors e-mails sent or received. > Further communication will signify your consent to this. > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 2 > Date: Tue, 20 Mar 2012 10:06:04 +0000 > From: Michael Borejdo > To: "varnish-misc at varnish-cache.org" > Subject: Re: Stale-While-Revalidate or Similar > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi there, > >> There is a similar feature to this available in Varnish: >> https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html > > Unfortunately my servers are healthy (they do not send 5XX or the like), but are just slow as hell sometimes. > Or how is "health" "measured" by varnish? > > I think this solution will not work for me, since my backend seems to be healthy. > What I basically want to accomplish is to prevent "the poor sod" from waiting for a request. Stale content is acceptable, waiting isn't. > > Thanks > > Michael > > --------------------------------------------------------------- > Von: varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] Im Auftrag von Graham Lyons > Gesendet: Dienstag, 20. M?rz 2012 10:51 > An: varnish-misc at varnish-cache.org > Betreff: Re: Stale-While-Revalidate or Similar > > Hi Michael, > > There is a similar feature to this available in Varnish: > https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html > > Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. > > Graham. > > On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: > > > Send varnish-misc mailing list submissions to > varnish-misc at varnish-cache.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > or, via email, send a message with subject or body 'help' to > varnish-misc-request at varnish-cache.org > > You can reach the person managing the list at > varnish-misc-owner at varnish-cache.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of varnish-misc digest..." > > > Today's Topics: > > ??1. Re: Varnish client IP address not display (MassiveScale.net) > ??2. VUG5 Paris BOF (Jonathan Matthews) > ??3. Re: Communication between Varnish and the Backend (Hugues Alary) > ??4. using the max-age request header (Jeroen Ooms) > ??5. Re: Communication between Varnish and the Backend (Per Buer) > ??6. Stale-While-Revalidate or Similar (Michael Borejdo) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 19 Mar 2012 12:39:36 +0100 > From: "MassiveScale.net" > To: varnish-misc at varnish-cache.org > Subject: Re: Varnish client IP address not display > Message-ID: <4F671AF8.3060201 at massivescale.net> > Content-Type: text/plain; charset=ISO-8859-1 > > On 03/19/2012 09:02 AM, Stewart Robinson wrote: > > Jewel, > What header are you checking on the back end? > You should be reading the x-forwarded-for header rather than some form > of remote_addr. > > Alternatively, if your backend server is Apache, you could use mod_rpaf > http://stderr.net/apache/rpaf/ > > -- > Andrzej Godziuk > http://MassiveScale.net/ > > > > ------------------------------ > > Message: 2 > Date: Mon, 19 Mar 2012 13:25:22 +0000 > From: Jonathan Matthews > To: varnish-misc at varnish-cache.org > Subject: VUG5 Paris BOF > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > Hi all - > > I'm heading along to VUG5 this week - really looking forward to > meeting a lot of you and seeing how you're using and abusing our > favourite tool :-) > > When I signed up, I don't recall ticking the "BOF" checkbox - could > anyone let me know if it's too late to get in on that action? > > Either way, are people (like me) who are attending *just* the user day > (Thursday) perhaps looking for more Varnish chat on the Friday or the > weekend? I'm there 'til Sunday, and would love to get the most out of > a high concentration of Varnish-literate folk! > > All the best, > Jonathan > -- > Jonathan Matthews > London, Oxford, UK > http://www.jpluscplusm.com/contact.html > > > > ------------------------------ > > Message: 3 > Date: Mon, 19 Mar 2012 12:50:23 -0700 > From: Hugues Alary > To: varnish-misc at varnish-cache.org > Subject: Re: Communication between Varnish and the Backend > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Happy Monday everybody, > > Nobody, got some good advices for me? :) > > Thanks, > -Hugues > > On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: > > > Hi everybody, > > I'm configuring varnish to be used with my web application. > > I need my backend to be able to give instructions to Varnish depending on > the page requested. For example, some of my pages contain ESI includes, > some don't. > > I want my application to tell varnish wether or not do the esi > processing. This approach allows me to keep my VCL configuration file > abstracted from the application. I can then redistribute the VCL to other > users and let their application control the cache. > > So far my solution is to instruct varnish via HTTP headers. > > In my current example I set a header X-Application-DoEsi to 1 or 0. When > varnish receives the response from the backend, it looks for the value > of X-Application-DoEsi and does or not the ESI processing. > > ??- I was wondering if communicating with varnish via HTTP header is a > ??good solution? > ??- How bad can it be performance wise? > ??- Should I be worried about security (interception/modification of the > ??communication between Varnish and the backend), even if no credential will > ??never be sent through HTTP headers? (Also, currently Varnish and the > ??backend are on the same machine, but chances are that they will in the > ??future not live on the same host). > > In the future, I plan on instructing varnish not to cache certain pages > containing user defined query strings. I want the user to be able to > specify these un-cachable urls query strings directly in the application. > The application will then send the un-cachable query strings in a header > X-Application-QueryStringNoCache: "querystring1,querystring2,...". > > Is that a bad idea? > > Thank you for your help! > > -- > Hugues ALARY > > > > > -- > Hugues ALARY > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 4 > Date: Mon, 19 Mar 2012 17:11:57 -0700 > From: Jeroen Ooms > To: varnish-misc at varnish-cache.org > Subject: using the max-age request header > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > How do I configure my VLC to let Varnish respect the 'Cache-Control > max-age' request header? Someone on SO suggested the following: > > if (req.http.Cache-Control ~ '\bmax-age=\b`) { > ???if (std.duration(regsub(req.http.Cache-Control, > ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { > ???????return (pass); > ???} > } > > However, what I don't like about this is that vcl_pass does not > actually update the cache with the new entry. How can I configure it > so that when max age < obj.age, a fresh copy will be fetched and > inserted into cache? > > > > ------------------------------ > > Message: 5 > Date: Tue, 20 Mar 2012 07:25:05 +0100 > From: Per Buer > To: Hugues Alary > Cc: varnish-misc at varnish-cache.org > Subject: Re: Communication between Varnish and the Backend > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: > (..) > > > > ??- I was wondering if communicating with varnish via HTTP header is a > ??good solution? > > Yes. > > > > ??- How bad can it be performance wise? > > Negligible. > > > > > ??- Should I be worried about security (interception/modification of the > ??communication between Varnish and the backend), even if no credential will > ??never be sent through HTTP headers? (Also, currently Varnish and the > ??backend are on the same machine, but chances are that they will in the > ??future not live on the same host). > > > It's more or less impossible to turn Varnish into an open proxy so I > wouldn't worry about that. > > > > > > In the future, I plan on instructing varnish not to cache certain pages > containing user defined query strings. I want the user to be able to > specify these un-cachable urls query strings directly in the application. > The application will then send the un-cachable query strings in a header > X-Application-QueryStringNoCache: "querystring1,querystring2,...". > > Is that a bad idea? > > > No. If it works for you then go for it. > > > -- > Per Buer, CEO > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | > Video | > Twitter > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 6 > Date: Tue, 20 Mar 2012 09:24:02 +0000 > From: Michael Borejdo > To: "varnish-misc at varnish-cache.org" > Subject: Stale-While-Revalidate or Similar > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > Hello List, > > Is there support for something like "stale-while-revalidate" coming to Varnish? > I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. > Or is there any other way with using vcl trickery to accomplish this? > (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) ?[1] > > [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html > > Thanks > > Michael > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > End of varnish-misc Digest, Vol 72, Issue 21 > ******************************************** > > ? > > http://www.bbc.co.uk > This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. > If you have received it in error, please delete it from your system. > Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. > Please note that the BBC monitors e-mails sent or received. > Further communication will signify your consent to this. > > > > ------------------------------ > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > End of varnish-misc Digest, Vol 72, Issue 22 > ******************************************** http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mib at electronic-minds.de Tue Mar 20 10:21:12 2012 From: mib at electronic-minds.de (Michael Borejdo) Date: Tue, 20 Mar 2012 10:21:12 +0000 Subject: Stale-While-Revalidate or Similar In-Reply-To: <91B1AABC-E35E-491E-A7DC-10BDC3638D3F@bbc.co.uk> References: <91B1AABC-E35E-491E-A7DC-10BDC3638D3F@bbc.co.uk> Message-ID: Hey graham, thanks for your reply, > Yeah, you want grace mode: > https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html#grace-mode As far as I tried, grace mode does serve stale content to 9999 / 10000 users, but one still has to refresh the cache and wait for the backend servers. Doing this async, does not seem to be supported by grace-mode, as far as I understood. Correct me, if I'm wrong. Greetings Michael Von: varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] Im Auftrag von Graham Lyons Gesendet: Dienstag, 20. M?rz 2012 11:17 An: varnish-misc at varnish-cache.org Betreff: Re: Stale-While-Revalidate or Similar Yeah, you want grace mode: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html#grace-mode As it says on that page, "it serves stale content to avoid request pile-up." On 20 Mar 2012, at 10:06, varnish-misc-request at varnish-cache.org wrote: Send varnish-misc mailing list submissions to varnish-misc at varnish-cache.org To subscribe or unsubscribe via the World Wide Web, visit https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc or, via email, send a message with subject or body 'help' to varnish-misc-request at varnish-cache.org You can reach the person managing the list at varnish-misc-owner at varnish-cache.org When replying, please edit your Subject line so it is more specific than "Re: Contents of varnish-misc digest..." Today's Topics: ??1. Re: Stale-While-Revalidate or Similar (Graham Lyons) ??2. Re: Stale-While-Revalidate or Similar (Michael Borejdo) ---------------------------------------------------------------------- Message: 1 Date: Tue, 20 Mar 2012 09:50:54 +0000 From: Graham Lyons To: varnish-misc at varnish-cache.org Subject: Re: Stale-While-Revalidate or Similar Message-ID: <9303601D-DC59-45DA-BCCB-6B0D3621557E at bbc.co.uk> Content-Type: text/plain; charset="us-ascii" Hi Michael, There is a similar feature to this available in Varnish: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. Graham. On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: Send varnish-misc mailing list submissions to varnish-misc at varnish-cache.org To subscribe or unsubscribe via the World Wide Web, visit https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc or, via email, send a message with subject or body 'help' to varnish-misc-request at varnish-cache.org You can reach the person managing the list at varnish-misc-owner at varnish-cache.org When replying, please edit your Subject line so it is more specific than "Re: Contents of varnish-misc digest..." Today's Topics: ?1. Re: Varnish client IP address not display (MassiveScale.net) ?2. VUG5 Paris BOF (Jonathan Matthews) ?3. Re: Communication between Varnish and the Backend (Hugues Alary) ?4. using the max-age request header (Jeroen Ooms) ?5. Re: Communication between Varnish and the Backend (Per Buer) ?6. Stale-While-Revalidate or Similar (Michael Borejdo) ---------------------------------------------------------------------- Message: 1 Date: Mon, 19 Mar 2012 12:39:36 +0100 From: "MassiveScale.net" To: varnish-misc at varnish-cache.org Subject: Re: Varnish client IP address not display Message-ID: <4F671AF8.3060201 at massivescale.net> Content-Type: text/plain; charset=ISO-8859-1 On 03/19/2012 09:02 AM, Stewart Robinson wrote: Jewel, What header are you checking on the back end? You should be reading the x-forwarded-for header rather than some form of remote_addr. Alternatively, if your backend server is Apache, you could use mod_rpaf http://stderr.net/apache/rpaf/ -- Andrzej Godziuk http://MassiveScale.net/ ------------------------------ Message: 2 Date: Mon, 19 Mar 2012 13:25:22 +0000 From: Jonathan Matthews To: varnish-misc at varnish-cache.org Subject: VUG5 Paris BOF Message-ID: Content-Type: text/plain; charset=UTF-8 Hi all - I'm heading along to VUG5 this week - really looking forward to meeting a lot of you and seeing how you're using and abusing our favourite tool :-) When I signed up, I don't recall ticking the "BOF" checkbox - could anyone let me know if it's too late to get in on that action? Either way, are people (like me) who are attending *just* the user day (Thursday) perhaps looking for more Varnish chat on the Friday or the weekend? I'm there 'til Sunday, and would love to get the most out of a high concentration of Varnish-literate folk! All the best, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html ------------------------------ Message: 3 Date: Mon, 19 Mar 2012 12:50:23 -0700 From: Hugues Alary To: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" Happy Monday everybody, Nobody, got some good advices for me? :) Thanks, -Hugues On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: Hi everybody, I'm configuring varnish to be used with my web application. I need my backend to be able to give instructions to Varnish depending on the page requested. For example, some of my pages contain ESI includes, some don't. I want my application to tell varnish wether or not do the esi processing. This approach allows me to keep my VCL configuration file abstracted from the application. I can then redistribute the VCL to other users and let their application control the cache. So far my solution is to instruct varnish via HTTP headers. In my current example I set a header X-Application-DoEsi to 1 or 0. When varnish receives the response from the backend, it looks for the value of X-Application-DoEsi and does or not the ESI processing. ?- I was wondering if communicating with varnish via HTTP header is a ?good solution? ?- How bad can it be performance wise? ?- Should I be worried about security (interception/modification of the ?communication between Varnish and the backend), even if no credential will ?never be sent through HTTP headers? (Also, currently Varnish and the ?backend are on the same machine, but chances are that they will in the ?future not live on the same host). In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? Thank you for your help! -- Hugues ALARY -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Mon, 19 Mar 2012 17:11:57 -0700 From: Jeroen Ooms To: varnish-misc at varnish-cache.org Subject: using the max-age request header Message-ID: Content-Type: text/plain; charset=ISO-8859-1 How do I configure my VLC to let Varnish respect the 'Cache-Control max-age' request header? Someone on SO suggested the following: if (req.http.Cache-Control ~ '\bmax-age=\b`) { ??if (std.duration(regsub(req.http.Cache-Control, ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { ??????return (pass); ??} } However, what I don't like about this is that vcl_pass does not actually update the cache with the new entry. How can I configure it so that when max age < obj.age, a fresh copy will be fetched and inserted into cache? ------------------------------ Message: 5 Date: Tue, 20 Mar 2012 07:25:05 +0100 From: Per Buer To: Hugues Alary Cc: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: (..) ?- I was wondering if communicating with varnish via HTTP header is a ?good solution? Yes. ?- How bad can it be performance wise? Negligible. ?- Should I be worried about security (interception/modification of the ?communication between Varnish and the backend), even if no credential will ?never be sent through HTTP headers? (Also, currently Varnish and the ?backend are on the same machine, but chances are that they will in the ?future not live on the same host). It's more or less impossible to turn Varnish into an open proxy so I wouldn't worry about that. In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? No. If it works for you then go for it. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 6 Date: Tue, 20 Mar 2012 09:24:02 +0000 From: Michael Borejdo To: "varnish-misc at varnish-cache.org" Subject: Stale-While-Revalidate or Similar Message-ID: Content-Type: text/plain; charset="us-ascii" Hello List, Is there support for something like "stale-while-revalidate" coming to Varnish? I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. Or is there any other way with using vcl trickery to accomplish this? (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) ?[1] [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html Thanks Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc End of varnish-misc Digest, Vol 72, Issue 21 ******************************************** http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 20 Mar 2012 10:06:04 +0000 From: Michael Borejdo To: "varnish-misc at varnish-cache.org" Subject: Re: Stale-While-Revalidate or Similar Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi there, There is a similar feature to this available in Varnish: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Unfortunately my servers are healthy (they do not send 5XX or the like), but are just slow as hell sometimes. Or how is "health" "measured" by varnish? I think this solution will not work for me, since my backend seems to be healthy. What I basically want to accomplish is to prevent "the poor sod" from waiting for a request. Stale content is acceptable, waiting isn't. Thanks Michael --------------------------------------------------------------- Von: varnish-misc-bounces at varnish-cache.org [mailto:varnish-misc-bounces at varnish-cache.org] Im Auftrag von Graham Lyons Gesendet: Dienstag, 20. M?rz 2012 10:51 An: varnish-misc at varnish-cache.org Betreff: Re: Stale-While-Revalidate or Similar Hi Michael, There is a similar feature to this available in Varnish: https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html Grace and saint modes correspond roughly, respectively to stale-while-revalidate and stale-if-error proposed in RFC5861. Graham. On 20 Mar 2012, at 09:24, varnish-misc-request at varnish-cache.org wrote: Send varnish-misc mailing list submissions to varnish-misc at varnish-cache.org To subscribe or unsubscribe via the World Wide Web, visit https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc or, via email, send a message with subject or body 'help' to varnish-misc-request at varnish-cache.org You can reach the person managing the list at varnish-misc-owner at varnish-cache.org When replying, please edit your Subject line so it is more specific than "Re: Contents of varnish-misc digest..." Today's Topics: ??1. Re: Varnish client IP address not display (MassiveScale.net) ??2. VUG5 Paris BOF (Jonathan Matthews) ??3. Re: Communication between Varnish and the Backend (Hugues Alary) ??4. using the max-age request header (Jeroen Ooms) ??5. Re: Communication between Varnish and the Backend (Per Buer) ??6. Stale-While-Revalidate or Similar (Michael Borejdo) ---------------------------------------------------------------------- Message: 1 Date: Mon, 19 Mar 2012 12:39:36 +0100 From: "MassiveScale.net" To: varnish-misc at varnish-cache.org Subject: Re: Varnish client IP address not display Message-ID: <4F671AF8.3060201 at massivescale.net> Content-Type: text/plain; charset=ISO-8859-1 On 03/19/2012 09:02 AM, Stewart Robinson wrote: Jewel, What header are you checking on the back end? You should be reading the x-forwarded-for header rather than some form of remote_addr. Alternatively, if your backend server is Apache, you could use mod_rpaf http://stderr.net/apache/rpaf/ -- Andrzej Godziuk http://MassiveScale.net/ ------------------------------ Message: 2 Date: Mon, 19 Mar 2012 13:25:22 +0000 From: Jonathan Matthews To: varnish-misc at varnish-cache.org Subject: VUG5 Paris BOF Message-ID: Content-Type: text/plain; charset=UTF-8 Hi all - I'm heading along to VUG5 this week - really looking forward to meeting a lot of you and seeing how you're using and abusing our favourite tool :-) When I signed up, I don't recall ticking the "BOF" checkbox - could anyone let me know if it's too late to get in on that action? Either way, are people (like me) who are attending *just* the user day (Thursday) perhaps looking for more Varnish chat on the Friday or the weekend? I'm there 'til Sunday, and would love to get the most out of a high concentration of Varnish-literate folk! All the best, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html ------------------------------ Message: 3 Date: Mon, 19 Mar 2012 12:50:23 -0700 From: Hugues Alary To: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" Happy Monday everybody, Nobody, got some good advices for me? :) Thanks, -Hugues On Fri, Mar 16, 2012 at 3:42 PM, Hugues Alary wrote: Hi everybody, I'm configuring varnish to be used with my web application. I need my backend to be able to give instructions to Varnish depending on the page requested. For example, some of my pages contain ESI includes, some don't. I want my application to tell varnish wether or not do the esi processing. This approach allows me to keep my VCL configuration file abstracted from the application. I can then redistribute the VCL to other users and let their application control the cache. So far my solution is to instruct varnish via HTTP headers. In my current example I set a header X-Application-DoEsi to 1 or 0. When varnish receives the response from the backend, it looks for the value of X-Application-DoEsi and does or not the ESI processing. ??- I was wondering if communicating with varnish via HTTP header is a ??good solution? ??- How bad can it be performance wise? ??- Should I be worried about security (interception/modification of the ??communication between Varnish and the backend), even if no credential will ??never be sent through HTTP headers? (Also, currently Varnish and the ??backend are on the same machine, but chances are that they will in the ??future not live on the same host). In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? Thank you for your help! -- Hugues ALARY -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Mon, 19 Mar 2012 17:11:57 -0700 From: Jeroen Ooms To: varnish-misc at varnish-cache.org Subject: using the max-age request header Message-ID: Content-Type: text/plain; charset=ISO-8859-1 How do I configure my VLC to let Varnish respect the 'Cache-Control max-age' request header? Someone on SO suggested the following: if (req.http.Cache-Control ~ '\bmax-age=\b`) { ???if (std.duration(regsub(req.http.Cache-Control, ".*\bmax-age=(\d+)\b.*", "\1s"), 0s) < obj.age) { ???????return (pass); ???} } However, what I don't like about this is that vcl_pass does not actually update the cache with the new entry. How can I configure it so that when max age < obj.age, a fresh copy will be fetched and inserted into cache? ------------------------------ Message: 5 Date: Tue, 20 Mar 2012 07:25:05 +0100 From: Per Buer To: Hugues Alary Cc: varnish-misc at varnish-cache.org Subject: Re: Communication between Varnish and the Backend Message-ID: Content-Type: text/plain; charset="iso-8859-1" On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: (..) ??- I was wondering if communicating with varnish via HTTP header is a ??good solution? Yes. ??- How bad can it be performance wise? Negligible. ??- Should I be worried about security (interception/modification of the ??communication between Varnish and the backend), even if no credential will ??never be sent through HTTP headers? (Also, currently Varnish and the ??backend are on the same machine, but chances are that they will in the ??future not live on the same host). It's more or less impossible to turn Varnish into an open proxy so I wouldn't worry about that. In the future, I plan on instructing varnish not to cache certain pages containing user defined query strings. I want the user to be able to specify these un-cachable urls query strings directly in the application. The application will then send the un-cachable query strings in a header X-Application-QueryStringNoCache: "querystring1,querystring2,...". Is that a bad idea? No. If it works for you then go for it. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 6 Date: Tue, 20 Mar 2012 09:24:02 +0000 From: Michael Borejdo To: "varnish-misc at varnish-cache.org" Subject: Stale-While-Revalidate or Similar Message-ID: Content-Type: text/plain; charset="us-ascii" Hello List, Is there support for something like "stale-while-revalidate" coming to Varnish? I need to make the request to my backend-servers async and serve slightly stale content (defined by grace) and I do not want a user to wait for the backend at any time. Or is there any other way with using vcl trickery to accomplish this? (Unfortunately I cannot seem to find any info on this topic and the thread I found on the list has not been answered) ?[1] [1] https://www.varnish-cache.org/lists/pipermail/varnish-misc/2012-February/021644.html Thanks Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc End of varnish-misc Digest, Vol 72, Issue 21 ******************************************** ? http://www.bbc.co.uk This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. ------------------------------ _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc End of varnish-misc Digest, Vol 72, Issue 22 ******************************************** ? http://www.bbc.co.uk This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this. From apj at mutt.dk Tue Mar 20 10:30:04 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Tue, 20 Mar 2012 11:30:04 +0100 Subject: Stale-While-Revalidate or Similar In-Reply-To: References: <91B1AABC-E35E-491E-A7DC-10BDC3638D3F@bbc.co.uk> Message-ID: <20120320103004.GL12685@nerd.dk> On Tue, Mar 20, 2012 at 10:21:12AM +0000, Michael Borejdo wrote: > > > Yeah, you want grace mode: > > https://www.varnish-cache.org/docs/trunk/tutorial/handling_misbehaving_servers.html#grace-mode > > As far as I tried, grace mode does serve stale content to 9999 / 10000 users, > but one still has to refresh the cache and wait for the backend servers. > Doing this async, does not seem to be supported by grace-mode, as far as I > understood. Correct me, if I'm wrong. You're right. You can use a local HTTP client to refresh content before it expires by setting req.hash_always_miss. That way you keep control of which client takes the delay. -- Andreas From hugues.alary at gmail.com Tue Mar 20 17:35:20 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Tue, 20 Mar 2012 10:35:20 -0700 Subject: Communication between Varnish and the Backend In-Reply-To: References: Message-ID: Thank you Per! On Mon, Mar 19, 2012 at 11:25 PM, Per Buer wrote: > On Fri, Mar 16, 2012 at 11:42 PM, Hugues Alary wrote: > (..) > >> >> - I was wondering if communicating with varnish via HTTP header is a >> good solution? >> >> Yes. > >> >> - How bad can it be performance wise? >> >> Negligible. > > >> >> - Should I be worried about security (interception/modification of >> the communication between Varnish and the backend), even if no credential >> will never be sent through HTTP headers? (Also, currently Varnish and the >> backend are on the same machine, but chances are that they will in the >> future not live on the same host). >> >> > It's more or less impossible to turn Varnish into an open proxy so I > wouldn't worry about that. > > >> >> >> In the future, I plan on instructing varnish not to cache certain pages >> containing user defined query strings. I want the user to be able to >> specify these un-cachable urls query strings directly in the application. >> The application will then send the un-cachable query strings in a header >> X-Application-QueryStringNoCache: "querystring1,querystring2,...". >> >> Is that a bad idea? >> > > No. If it works for you then go for it. > > > -- > Per Buer, CEO > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | Video | > Twitter > > > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From anders at fupp.net Tue Mar 20 21:04:19 2012 From: anders at fupp.net (Anders Nordby) Date: Tue, 20 Mar 2012 22:04:19 +0100 Subject: SPDY in Varnish ? In-Reply-To: References: Message-ID: <20120320210418.GA68307@fupp.net> Hi, FWIW, Firefox 11 includes SPDY support: http://techsplurge.com/8147/firefox-11-vs-chrome-17-released-features-3d-page-view-chrome-bookmarks-import-extensive-tests/ OTOH, it'll make debugging HTTP more difficult? ;-/ Cheers, Anders. On l?r, apr 30, 2011 at 09:06:52am +0200, Per Buer wrote: > We've discussed SPDY several times. SPDY is interesting but it would be > premature to implement it this early. SPDY isn't even an official IETF draft > yet and Google is still experimenting with it. I think, for us to consider > implementing it, we would need at least two things to happen. 1) An IETF > standard and 2) browser adoption. Even then it might not make sense. The > earlier drafts of SPDY weren't very proxy friendly. I'm not familiar with > Googles infrastructure but they might not use generic web proxies in their > web applications so it wasn't relevant for them. > > Until then I think it's better to sit tight and se who wins. HTTP-MPLEX, > Waka and SCTP are other technologies that operate in the same problem space. > We have no idea who might win. > > > Per. > > On Sat, Apr 30, 2011 at 1:24 AM, Simon Lyall wrote: > > > > > Just wondering what the varnish devs thoughts are on the SPDY protocol [1] > > and it's likelihood of going into varnish alongside http? > > > > [1] http://www.chromium.org/spdy > > > > -- > > Simon Lyall | Very Busy | Web: http://www.darkmere.gen.nz/ > > "To stay awake all night adds a day to your life" - Stilgar | eMT. > > > > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > > > > > -- > Per Buer, CEO > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | > Video | > Twitter > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc -- Anders. From David.Petzel at disney.com Tue Mar 20 21:31:10 2012 From: David.Petzel at disney.com (Petzel, David) Date: Tue, 20 Mar 2012 17:31:10 -0400 Subject: Question on varnishlog and -m option Message-ID: <3F0C69D55568D642AED3AE818E8E71FF1635506E18@SM-NYNY-VXMB02A.nena.wdpr.disney.com> I'm a fairly new Varnish user running 3.0.2 revision 55e70a4. We are trying to setup varnishlog daemon on RHEL 5.5 such that it only logs 500 series errors. The daemon is running as: /usr/bin/varnishlog -a -w /var/log/varnish/varnish.log -D -P /var/run/varnishlog.pid -c -m TxStatus:"5\d{2}" The problem I am having is that the filter appears to be ignored when writing to file, and every single request is logged instead. If I remove the "-w /var/log/varnish/varnish.log" from the list of arguments, the results are of course displayed on-screen, however the filter seems to be honored. I checked https://www.varnish-cache.org/docs/trunk/reference/varnishlog.html and this isnt called out as known behaviour, so I am trying to figure out, is the -m filter ignored when writing to file or should the above result in only 500 series log entries being written to file? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From isp at daviesinc.com Tue Mar 20 23:29:00 2012 From: isp at daviesinc.com (Chris Davies) Date: Tue, 20 Mar 2012 19:29:00 -0400 Subject: SPDY in Varnish ? In-Reply-To: <20120320210418.GA68307@fupp.net> References: <20120320210418.GA68307@fupp.net> Message-ID: On Mar 20, 2012, at 5:04 PM, Anders Nordby wrote: > FWIW, Firefox 11 includes SPDY support: > http://techsplurge.com/8147/firefox-11-vs-chrome-17-released-features-3d-page-view-chrome-bookmarks-import-extensive-tests/ > > OTOH, it'll make debugging HTTP more difficult? ;-/ > >> >> On Sat, Apr 30, 2011 at 1:24 AM, Simon Lyall wrote: >> >>> >>> Just wondering what the varnish devs thoughts are on the SPDY protocol [1] >>> and it's likelihood of going into varnish alongside http? >>> >>> [1] http://www.chromium.org/spdy Remember that SPDY requires SSL-npn and is a transport that goes across SSL. Currently, Varnish doesn't support SSL and I believe it isn't on the near-term roadmap. You can run SPDY in non-SSL environments for testing, but, it will break most production browsers. From bedis9 at gmail.com Wed Mar 21 06:31:45 2012 From: bedis9 at gmail.com (Baptiste) Date: Wed, 21 Mar 2012 07:31:45 +0100 Subject: Going crazy to mitigate slow read In-Reply-To: References: <4F59CEF4.5040207@ants.eu> Message-ID: Hi, Or you can do this in HAProxy: http://blog.exceliance.fr/2012/02/27/use-a-load-balancer-as-a-first-row-of-defense-against-ddos/ HAProxy and Varnish works pretty well together ;) HAProxy will even protect you again slowloris and some other type of attacks. cheers On Fri, Mar 9, 2012 at 6:09 PM, Damon Snyder wrote: > Another way of doing this in nginx in front of varnish. See the limit_* > directives in nginx http://wiki.nginx.org/HttpLimitZoneModule#limit_zone. It > depends on your application, but typically, if you have an abusive > client(s), you end up serving a lot of the requests from varnish so your > apache processes never sees the bulk of the requests. Additionally, your > apache threads are a more finite resource, so you want to keep them from all > being occupied by the flood of requests if you can. > > Hope this helps, > Damon > > > On Fri, Mar 9, 2012 at 1:35 AM, Gianni Carabelli wrote: >> >> Hi all. >> I've got few servers with varnish + apache on loopback. >> Modsecurity mitigate the problem on the only apache side, but fails with >> apache + varnish. >> I'm using mod_rpaf to get the right ip address, but probably something >> goes wrong. >> >> I would like to get another approach and try to block the attack >> completely in varnish. >> In apache, some directive say: "if there are enough connection from this >> ip in READ/WRITE state, reject incoming connections from that ip" >> Is there a way to do so in varnish? >> >> Thanks >> >> JohnnyRun >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From gc at ants.eu Wed Mar 21 08:27:01 2012 From: gc at ants.eu (Gianni Carabelli) Date: Wed, 21 Mar 2012 09:27:01 +0100 Subject: Going crazy to mitigate slow read In-Reply-To: References: <4F59CEF4.5040207@ants.eu> Message-ID: <4F6990D5.1010703@ants.eu> On 03/21/2012 07:31 AM, Baptiste wrote: > Hi, > > Or you can do this in HAProxy: > http://blog.exceliance.fr/2012/02/27/use-a-load-balancer-as-a-first-row-of-defense-against-ddos/ > HAProxy and Varnish works pretty well together ;) > > HAProxy will even protect you again slowloris and some other type of attacks. > > cheers > Thanks a lot for reply. Protecting in load balancer instead of proxing with nginx is a lot better in my configuration. JohnnyRun From ruben at varnish-software.com Wed Mar 21 12:07:11 2012 From: ruben at varnish-software.com (=?UTF-8?Q?Rub=C3=A9n_Romero?=) Date: Wed, 21 Mar 2012 13:07:11 +0100 Subject: VUG5 Paris BOF In-Reply-To: References: Message-ID: Hi Jonathan, On Mon, Mar 19, 2012 at 2:25 PM, Jonathan Matthews wrote: > Hi all - > > I'm heading along to VUG5 this week - really looking forward to > meeting a lot of you and seeing how you're using and abusing our > favourite tool :-) > > Great! You are not alone. :-) > When I signed up, I don't recall ticking the "BOF" checkbox - could > anyone let me know if it's too late to get in on that action? > > It came in later. You are registered now. > Either way, are people (like me) who are attending *just* the user day > (Thursday) perhaps looking for more Varnish chat on the Friday or the > weekend? I'm there 'til Sunday, and would love to get the most out of > a high concentration of Varnish-literate folk! > > Indeed. We can ask people interested to follow this list (and thread) for more information about Friday/Saturday/Sunday. What do you think? > All the best, > Jonathan > -- > Jonathan Matthews > London, Oxford, UK > http://www.jpluscplusm.com/contact.html > > Best regards, -- Rub?n Romero, Global Sales Executive Phone: +47 21 98 92 62 / Mobile: +47 959 64 088 / Skype: ruben_varnish / GTalk: *Varnish makes websites fly!* Whitepapers | Video | Twitter | LinkedIn -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Thu Mar 22 06:17:20 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 22 Mar 2012 15:17:20 +0900 Subject: Varnish client IP address not display In-Reply-To: <4F66EB9E.7040806@uplex.de> References: <20120319080029.GA19957@grum.quex.org> <4F66EB9E.7040806@uplex.de> Message-ID: Hello All, sorry for not undestand clearly first. Now my understandin is the following code is working sub vcl_recv { remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; } and this will create a new header X-Forwarded-For (which valu will be client IP address) now this ?X-Forwarded-For? value we have to chatch in our back end web server like apace, IIS, nginx, tomcat, resin-pro etc! This is what is understand and its work for me. Please make me confirm it. Or is there other way to catch this client IP in back end server ? (in my case our application is made by java which need huge change if I use header "X-Forwarded-For" ) Thanks Jewel On Mon, Mar 19, 2012 at 5:17 PM, Geoff Simmons wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 3/19/12 9:00 AM, Michael Alger wrote: > >> On Mon, Mar 19, 2012 at 4:36 PM, Jewel Nuruddin wrote: > >>> My varnish is run on 10.70.18.22 server and my web server run > >>> back end 10.70.18.30 When client browse through varnish in my > >>> web server it always show varnish IP(10.70.18.22) But I want my > >>> web server should display client IP address. I use the > >>> following configuration > >> Sorry I the configuration is bellow, please ignore my previous > >> configuration. > >> > >> sub vcl_recv { remove req.http.X-Forwarded-For; set > >> req.http.X-Forwarded-For = client.ip; > >> > >> } > >> > >> But still it did not work for me !!! > > > > The above code adds a new header "X-Forwarded-For" which will > > contain the IP address of the client, as seen by Varnish. You can > > modify the backend server to utilise this header rather than the > > address of the connection itself, if you wish to > > display/store/etc. the client's IP address. This is fairly easy if > > you're displaying this information in your own server-side code > > (PHP, ASP, etc.). > > Should add to this that in vcl_recv(), we don't know if the request > will be seen by a backend at all -- it depends on whether or not > Varnish decides to deliver a cached object. If backends generate > responses that include a client IP obtained from X-Forwarded-For, and > those responses are cached, then when Varnish returns the cached > object, it will have whatever client IP was included when the backend > generated it. That very likely *won't* be the IP of the client who > sent the current request. > > If you want Varnish to return responses that include the current > client IP every time, then it is almost certainly impossible to have > Varnish cache those responses. There might be some sort of trick here, > perhaps some kind of black magic with ESI, but I doubt it. > > Is this is a problem you could solve some other way? Having the > current client IP in every response and caching with Varnish are two > goals that are in conflict with one another. > > > Best, > Geoff > - -- > UPLEX Systemoptimierung > Schwanenwik 24 > 22087 Hamburg > http://uplex.de/ > Mob: +49-176-63690917 > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.14 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQIcBAEBCAAGBQJPZuudAAoJEOUwvh9pJNUReZoP/jTCsZB1HNE3s9nv5ybtrTOR > 2KWLmGlkF5ZoO7GAVfy+20FwP2RoeBphAl6k8N2Wve3a5bP5ZgUZT3dtlHUh1u9l > LGuW2qBtU76yNnHpGWbQXifTN26DZ6e24MuWkr+mpMbPe0kAFSxEukvmVSBZGwgW > IVbsIW025AnkNL3DHUvE3NcBYnw/zuGuvBWF2NyT7a+hC/jJfE9KUv2GVGRKhK8o > UtTl8TiyWZsKIWLGGJuWg4pNMKxLoGyXiHuY4FAs32u96m14yrvIc27/IB1N6rJw > x7Od8oNYPYrUp9sI5o/KIVqAM7kg1kqlAy7/HdZ647JyXMODQqf4HxjURa+1NpJl > STNrLh9VTgNBIMHiGBpyq54tBm1Hr43qh/JN9T8OegkuCbf1Jpmb2nwP+S4mt6hu > CH3qbWm6HDdX20c5s9n9Pq+m2NCz7pKkWv0QJmtVHigriiZBaQEcTRynAboctbGD > DcgJkkCvVfNYpSPJvHQndkHUj7vXoilN7wUXUQm3mB111RpqeiZ5BaocgeJ+iXHf > FScApUGhYDxI/FbCkSj9tHo5RSpydorNqwkQREFLgzre1pUBBt4Xu6vg5eEdQt1l > ialnhCXYZeS0zxq+3QFQvs3mpKJZ60HFZEcjBqPPzKcAqxhKe1y057PjHoyY+GFp > FEQBlT1LfpQVu9pTutcU > =nJcZ > -----END PGP SIGNATURE----- > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvernica at gmail.com Thu Mar 22 18:25:07 2012 From: rvernica at gmail.com (Rares Vernica) Date: Thu, 22 Mar 2012 11:25:07 -0700 Subject: serve cached data based on the freshness of an URL argument Message-ID: <873990ijcs.fsf@cessna.hpl.hp.com> Hello, I am new to Varnish so so the question might me a bit poorly stated. I am trying to configure Varnish so that serving an URL from cache depends on the freshness of another URL given as argument to the original URL. For example, the original URL might look like: http://fancyprocessing.com/processimage?http://images.com/123.jpg If I have seen this URL before and cached its result, I would like Varnish to use the cached data only if: http://images.com/123.jpg has not changed since the result was cached. Any pointers would be greatly appreciated. Thanks! Rares From pprocacci at datapipe.com Thu Mar 22 18:59:13 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Thu, 22 Mar 2012 13:59:13 -0500 Subject: serve cached data based on the freshness of an URL argument In-Reply-To: <873990ijcs.fsf@cessna.hpl.hp.com> References: <873990ijcs.fsf@cessna.hpl.hp.com> Message-ID: <20120322185913.GD55022@nat.myhome> You can ban (invalidate) `http://images.com/123.jpg` everytime `http://fancyprocessing.com/processimage?http://images.com/123.jpg` is fetched from the backend (I believe). I've never had to do this personally, but the documentation on bans might be of use. https://www.varnish-cache.org/docs/trunk/tutorial/purging.html ~Paul On Thu, Mar 22, 2012 at 11:25:07AM -0700, Rares Vernica wrote: > Hello, > > I am new to Varnish so so the question might me a bit poorly stated. I am > trying to configure Varnish so that serving an URL from cache depends on > the freshness of another URL given as argument to the original URL. > > For example, the original URL might look like: > > http://fancyprocessing.com/processimage?http://images.com/123.jpg > > If I have seen this URL before and cached its result, I would like > Varnish to use the cached data only if: > > http://images.com/123.jpg > > has not changed since the result was cached. > > Any pointers would be greatly appreciated. > > Thanks! > Rares > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc ________________________________ 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. From shib4u at gmail.com Fri Mar 23 10:29:35 2012 From: shib4u at gmail.com (Shibashish) Date: Fri, 23 Mar 2012 15:59:35 +0530 Subject: Deny caching on mime-type Message-ID: Hi, I have a IIS back-end server which serves a aspx file Content-Type as text/html or text/vnd.wap.wml depending on the browser request, i.e it serves Content-Type text/vnd.wap.wml to a wap-browser, but serves Content-Type text/html to chrome/firefox/ie. How do I ask varnish not to cache based on mime-tyme text/vnd.wap.wml ? Thanks. ShiB. while ( ! ( succeed = try() ) ); -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Fri Mar 23 10:34:34 2012 From: roberto.fernandezcrisial at gmail.com (=?utf-8?B?Um9iZXJ0byBPLiBGZXJuw6FuZGV6IENyaXNpYWw=?=) Date: Fri, 23 Mar 2012 10:34:34 +0000 Subject: Deny caching on mime-type In-Reply-To: References: Message-ID: <1904321384-1332498875-cardhu_decombobulator_blackberry.rim.net-1799243565-@b15.c27.bise6.blackberry> ShiB, Maybe you should try with something on vcl_fetch like: if (beresp.http.Content-Type == 'text/vnd.wap.wml') { return(pass); } Good luck, Roberto (@rofc) -----Original Message----- From: Shibashish Sender: varnish-misc-bounces at varnish-cache.org Date: Fri, 23 Mar 2012 15:59:35 To: Subject: Deny caching on mime-type _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From apj at mutt.dk Fri Mar 23 10:43:32 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Fri, 23 Mar 2012 11:43:32 +0100 Subject: Deny caching on mime-type In-Reply-To: <1904321384-1332498875-cardhu_decombobulator_blackberry.rim.net-1799243565-@b15.c27.bise6.blackberry> References: <1904321384-1332498875-cardhu_decombobulator_blackberry.rim.net-1799243565-@b15.c27.bise6.blackberry> Message-ID: <20120323104332.GM12685@nerd.dk> On Fri, Mar 23, 2012 at 10:34:34AM +0000, Roberto O. Fern?ndez Crisial wrote: > > Maybe you should try with something on vcl_fetch like: > > if (beresp.http.Content-Type == 'text/vnd.wap.wml') > { > return(pass); > } That would be return(hit_for_pass) since 3.0. Remember to set a TTL if you want to cache the objects uncacheability (which you generally want) -- Andreas From shib4u at gmail.com Fri Mar 23 11:23:52 2012 From: shib4u at gmail.com (Shibashish) Date: Fri, 23 Mar 2012 16:53:52 +0530 Subject: Deny caching on mime-type In-Reply-To: <20120323104332.GM12685@nerd.dk> References: <1904321384-1332498875-cardhu_decombobulator_blackberry.rim.net-1799243565-@b15.c27.bise6.blackberry> <20120323104332.GM12685@nerd.dk> Message-ID: On Fri, Mar 23, 2012 at 4:13 PM, Andreas Plesner Jacobsen wrote: > On Fri, Mar 23, 2012 at 10:34:34AM +0000, Roberto O. Fern?ndez Crisial > wrote: > > > > Maybe you should try with something on vcl_fetch like: > > > > if (beresp.http.Content-Type == 'text/vnd.wap.wml') > > { > > return(pass); > > } > > That would be return(hit_for_pass) since 3.0. > > Remember to set a TTL if you want to cache the objects uncacheability > (which > you generally want) > > -- > Andreas > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > Awesome.. Thanks Roberto and Andreas.. works as expected ! I'm on varnish-2.1.5-1 -- ShiB. while ( ! ( succeed = try() ) ); -------------- next part -------------- An HTML attachment was scrubbed... URL: From lampe at hauke-lampe.de Fri Mar 23 11:43:20 2012 From: lampe at hauke-lampe.de (Hauke Lampe) Date: Fri, 23 Mar 2012 12:43:20 +0100 Subject: Deny caching on mime-type In-Reply-To: References: Message-ID: <4F6C61D8.3010001@hauke-lampe.de> On 23.03.2012 11:29, Shibashish wrote: > I have a IIS back-end server which serves a aspx file Content-Type as > text/html or text/vnd.wap.wml depending on the browser request, i.e it > serves Content-Type text/vnd.wap.wml to a wap-browser, but serves > Content-Type text/html to chrome/firefox/ie. > > How do I ask varnish not to cache based on mime-tyme text/vnd.wap.wml ? You shouldn't. Have IIS add a "Vary: User-Agent" header, so that varnish caches the different versions. You might want to normalize the User-Agent header in vcl_recv() to reduce the number of variants and improve cache efficiency, but that's not strictly necessary. Hauke. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: From apj at mutt.dk Fri Mar 23 13:20:05 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Fri, 23 Mar 2012 14:20:05 +0100 Subject: Deny caching on mime-type In-Reply-To: <4F6C61D8.3010001@hauke-lampe.de> References: <4F6C61D8.3010001@hauke-lampe.de> Message-ID: <20120323132005.GN12685@nerd.dk> On Fri, Mar 23, 2012 at 12:43:20PM +0100, Hauke Lampe wrote: > > > I have a IIS back-end server which serves a aspx file Content-Type as > > text/html or text/vnd.wap.wml depending on the browser request, i.e it > > serves Content-Type text/vnd.wap.wml to a wap-browser, but serves > > Content-Type text/html to chrome/firefox/ie. > > > > How do I ask varnish not to cache based on mime-tyme text/vnd.wap.wml ? > > You shouldn't. Have IIS add a "Vary: User-Agent" header, so that varnish > caches the different versions. > > You might want to normalize the User-Agent header in vcl_recv() to > reduce the number of variants and improve cache efficiency, but that's > not strictly necessary. Not just "might". You need to. There's way too much variance in User-Agent. -- Andreas From imyousuf at gmail.com Fri Mar 23 15:05:52 2012 From: imyousuf at gmail.com (Imran M Yousuf) Date: Fri, 23 Mar 2012 21:05:52 +0600 Subject: Caching RESTful Web Services with Varnish Message-ID: Hi, I have used Varnish earlier for caching Web Sites and even used ESI with Varnish. Now I want to use Varnish to cache RESTful Web Services artifacts. The project I am referring to is as follows: http://kenai.com/projects/smart-cms/pages/Home Here is what the Web Service does: 1. Returns Last-Modified, ETag, Cache-Control with max-age 2. Returns 'Vary' as applicable. 3. No session has been used Here is what I can get to work with out of the box VCL: 1. Caches for the time period mentioned in max-age 2. Does not respond to PUT/POST on the URI being cached Here is what I want to achieve: 1. I want Varnish to evict from cache if a URI that is cached receives a POST/PUT/DELETE to it 2. I want Varnish to do conditional GET after cache expires 3. I want to evict all sub-resources of a resource (URI) from cache upon receiving POST/PUT/DELETE to it Can someone please guide me to a documentation or sample VCL using which I can achieve these? Thank you, -- Imran M Yousuf Twitter: @imyousuf - http://twitter.com/imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 From cosimo at streppone.it Fri Mar 23 17:26:24 2012 From: cosimo at streppone.it (Cosimo Streppone) Date: Fri, 23 Mar 2012 18:26:24 +0100 Subject: vmod-bootstrap Message-ID: During today's VUG5 dev meeting, we discussed vmod development, and looks like most people are interested in it. Now, I may be a bit slow to understand how to build a vmod, but my personal view is I don't like copying and pasting stuff around to start something new. For this reason, during this morning dev meeting, I hacked together, with a bit of spit and duct tape, sorry for that, vmod-bootstrap. https://github.com/cosimo/vmod-bootstrap/ vmod-bootstrap is a script that will generate a new vmod skeleton for you. It needs a "vmod.conf" file: { "name" : "frobnicator", "author" : "James J. Hacker", "version" : "0.01", "src" : "src/vmod_frobnicator.vcc", "required_libs" : [ { "name" : "mhash", "function" : "mhash_count", }, ], "copyright" : "Copyright (c) 2012 James J. Hacker", "repository" : "git://github.com/jamesjhacker/vmod-frobnicator", ... yadda yadda ... } Run vmod-bootstrap and it will: - check pre-requisite packages (automake, libtool and friends) - build autoconf and automake files - inflate "m4" and "src" dirs so you can hopefully run ./autogen.sh && ./configure. Pointless? Yeah, probably. It helps me in 3 ways: - understanding which of these files are actually necessary - saves me time doing search/replace - keeps all files consistent Additional intelligence can be hardwired directly into the bootstrap tool, which makes it really interesting going forward, where now is quite stupid. Bonus idea: take all the vmod.conf you can find, and build a tool that automatically clones the sources, builds and installs/packages the vmod, cpanm-like. Thoughts? -- Cosimo From contact at jpluscplusm.com Fri Mar 23 17:34:07 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Fri, 23 Mar 2012 18:34:07 +0100 Subject: Caching RESTful Web Services with Varnish In-Reply-To: References: Message-ID: On 23 March 2012 16:05, Imran M Yousuf wrote: > Hi, > > I have used Varnish earlier for caching Web Sites and even used ESI > with Varnish. Now I want to use Varnish to cache RESTful Web Services > artifacts. The project I am referring to is as follows: > http://kenai.com/projects/smart-cms/pages/Home > > Here is what the Web Service does: > 1. Returns Last-Modified, ETag, Cache-Control with max-age > 2. Returns 'Vary' as applicable. > 3. No session has been used > > Here is what I can get to work with out of the box VCL: > 1. Caches for the time period mentioned in max-age > 2. Does not respond to PUT/POST on the URI being cached > > Here is what I want to achieve: > 1. I want Varnish to evict from cache if a URI that is cached receives > a POST/PUT/DELETE to it I started a thread back in the 2.x days about your point #1: https://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-May/020507.html The naive purge I came up with may not be optimal for 3.x (and may not have been best for 2.x!) As you'll see through that thread, the opinion of the list seemed to be that just writing VCL to do it wasn't the way forward. I'm not *convinced* this is the case however. > 2. I want Varnish to do conditional GET after cache expires > 3. I want to evict all sub-resources of a resource (URI) from cache > upon receiving POST/PUT/DELETE to it I'm not sure what you mean by this. Can you give us some examples? Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From straightflush at gmail.com Fri Mar 23 18:35:28 2012 From: straightflush at gmail.com (AD) Date: Fri, 23 Mar 2012 14:35:28 -0400 Subject: vmod-bootstrap In-Reply-To: References: Message-ID: You should try and merge with the existing template out there https://github.com/varnish/libvmod-example On Fri, Mar 23, 2012 at 1:26 PM, Cosimo Streppone wrote: > During today's VUG5 dev meeting, we discussed > vmod development, and looks like most people > are interested in it. > > Now, I may be a bit slow to understand how to build > a vmod, but my personal view is I don't like copying and > pasting stuff around to start something new. > > For this reason, during this morning dev meeting, > I hacked together, with a bit of spit and duct tape, > sorry for that, vmod-bootstrap. > > https://github.com/cosimo/**vmod-bootstrap/ > > vmod-bootstrap is a script that will generate > a new vmod skeleton for you. > > It needs a "vmod.conf" file: > > { > "name" : "frobnicator", > "author" : "James J. Hacker", > "version" : "0.01", > "src" : "src/vmod_frobnicator.vcc", > "required_libs" : [ > { > "name" : "mhash", > "function" : "mhash_count", > }, > ], > "copyright" : "Copyright (c) 2012 James J. Hacker", > "repository" : "git://github.com/**jamesjhacker/vmod-frobnicator > "**, > ... > yadda yadda > ... > } > > Run vmod-bootstrap and it will: > > - check pre-requisite packages (automake, libtool and friends) > - build autoconf and automake files > - inflate "m4" and "src" dirs > > so you can hopefully run ./autogen.sh && ./configure. > > Pointless? Yeah, probably. It helps me in 3 ways: > > - understanding which of these files are actually necessary > - saves me time doing search/replace > - keeps all files consistent > > Additional intelligence can be hardwired directly into the bootstrap tool, > which makes it really interesting going forward, where now is quite > stupid. > > Bonus idea: take all the vmod.conf you can find, and > build a tool that automatically clones the sources, builds > and installs/packages the vmod, cpanm-like. > > Thoughts? > > -- > Cosimo > > ______________________________**_________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cosimo at streppone.it Fri Mar 23 18:39:17 2012 From: cosimo at streppone.it (Cosimo Streppone) Date: Fri, 23 Mar 2012 19:39:17 +0100 Subject: vmod-bootstrap In-Reply-To: References: Message-ID: On Fri, 23 Mar 2012 19:35:28 +0100, AD wrote: > You should try and merge with the existing template out there > https://github.com/varnish/libvmod-example Okay... that's exactly what I thought I did. The files that vmod-bootstrap builds are exactly the same files that you find in libvmod-example. Maybe I didn't understand your comment? -- Cosimo From straightflush at gmail.com Fri Mar 23 19:45:31 2012 From: straightflush at gmail.com (AD) Date: Fri, 23 Mar 2012 15:45:31 -0400 Subject: vmod-bootstrap In-Reply-To: References: Message-ID: no i just wasnt sure if you were aware of it since I think its what people are using to start their vmod dev. Sorry, i didnt fully check your repo i was just pointing it out. On Fri, Mar 23, 2012 at 2:39 PM, Cosimo Streppone wrote: > On Fri, 23 Mar 2012 19:35:28 +0100, AD wrote: > > You should try and merge with the existing template out there >> https://github.com/varnish/**libvmod-example >> > > Okay... > > that's exactly what I thought I did. > > The files that vmod-bootstrap builds are exactly > the same files that you find in libvmod-example. > > Maybe I didn't understand your comment? > > > -- > Cosimo > > ______________________________**_________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cosimo at streppone.it Fri Mar 23 22:48:48 2012 From: cosimo at streppone.it (Cosimo Streppone) Date: Fri, 23 Mar 2012 23:48:48 +0100 Subject: vmod-bootstrap In-Reply-To: References: Message-ID: On Fri, 23 Mar 2012 20:45:31 +0100, AD wrote: > no i just wasnt sure if you were aware of it since I think its what > people are using to start their vmod dev. > Sorry, i didnt fully check your repo i was just pointing it out. No problem. I've been thinking more about this coming back from VUG5. Trying to imagine the future a little... :) What if vmod-bootstrap was renamed into varnishmod? Could it grow into a tool to be shipped with varnish? Examples: # Create a new module skeleton varnishmod bootstrap [--config vmod.conf] # Operate on the local module in ./ ? varnishmod {build,test,install} # List all available VMODs, consulting a central db SomeWhere(tm) varnishmod list # Publish this new module in the central db (w/ some screening?) varnishmod push [--config vmod.conf] # Download a remote module and optionally install it varnishmod download digest cd libvmod-digest varnishmod install So, it just makes it simpler to boot the process of VMOD development, but it also paves the way for further interesting next steps. -- Cosimo From imyousuf at gmail.com Sat Mar 24 13:04:35 2012 From: imyousuf at gmail.com (Imran M Yousuf) Date: Sat, 24 Mar 2012 19:04:35 +0600 Subject: Caching RESTful Web Services with Varnish In-Reply-To: References: Message-ID: Hi Jonathan, Thanks for sharing the thread. Per Buer's comment is actually the path that needs to be taken to resolve it sensibly and successfully. If I understand correctly, what needs to be done is the backend will issue PURGE to velocity servers when an URI is to be invalidated. Further understandings are inline below. On Fri, Mar 23, 2012 at 11:34 PM, Jonathan Matthews wrote: > On 23 March 2012 16:05, Imran M Yousuf wrote: >> >> 1. I want Varnish to evict from cache if a URI that is cached receives >> a POST/PUT/DELETE to it > > I started a thread back in the 2.x days about your point #1: > https://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-May/020507.html > > The naive purge I came up with may not be optimal for 3.x (and may not > have been best for 2.x!) > > As you'll see through that thread, the opinion of the list seemed to > be that just writing VCL to do it wasn't the way forward. I'm not > *convinced* this is the case however. > I think you are right and as I mentioned above I think issue PURGE to Velocity is what Per Buer is suggesting. Here it suggests that each Varnish instance in a cluster has to be requested individually; ain't there a better way for coordinating this synchronization? >> 2. I want Varnish to do conditional GET after cache expires >> 3. I want to evict all sub-resources of a resource (URI) from cache >> upon receiving POST/PUT/DELETE to it > > I'm not sure what you mean by this. Can you give us some examples? > I think your question was indicating to point 3; to confirm for point 2 & 3 use cases I am referring to a resource as follows: > GET /cms/c/com.aponn/TRANSCOM/i/5d88a1a4-0a8e-4dda-ba9f-505bff697d6e HTTP/1.1 > User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 > Host: localhost:8080 > Accept: application/json > < HTTP/1.1 200 OK < Date: Sat, 24 Mar 2012 12:45:07 GMT < Server: Jetty(7.3.1.v20110307) < ETag: "d9e940a99d2baa960ad041999f002960" < Last-Modified: Sat, 24 Mar 2012 10:58:34 GMT < Cache-Control: no-transform, max-age=300 < Vary: Accept < Content-Type: application/json < Via: 1.1 cms.aponiq.com < Transfer-Encoding: chunked < = For Conditional GET = As we can notice, Cache-Control specifies max-age to 300 seconds; once that time elapses and velocity receives a request to this URI, I want Velocity to go the backend with 'If-Modified-Since' and/or 'If-None-Match' request headers. Is it possible and if so then how? = For invalidating sub resources = I think this needs to be done through PURGE too. The use case is resource '/cms/c/com.aponn/TRANSCOM/i/5d88a1a4-0a8e-4dda-ba9f-505bff697d6e' has subresources such as '/cms/c/com.aponn/TRANSCOM/i/5d88a1a4-0a8e-4dda-ba9f-505bff697d6e/f/fieldA' and so on per field. I want to PURGE them too on PUT/POST/DELETE to '/cms/c/com.aponn/TRANSCOM/i/5d88a1a4-0a8e-4dda-ba9f-505bff697d6e'; IOW I want to invalidate all resources with URI pattern '/cms/c/com.aponn/TRANSCOM/i/5d88a1a4-0a8e-4dda-ba9f-505bff697d6e*' Though PURGE is a possible solution but if it could be done without PURGE that would be easier. Any ideas? Thank you, -- Imran M Yousuf Twitter: @imyousuf - http://twitter.com/imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 From ryanchan404 at gmail.com Sun Mar 25 03:15:47 2012 From: ryanchan404 at gmail.com (Ryan Chan) Date: Sun, 25 Mar 2012 11:15:47 +0800 Subject: How to make Varnish not caching response if they do not have proper cache header? Message-ID: Seems *Varnish* is caching too aggressively, e.g. I have a *index.php* does not send out *last-modifieid*,*cache-control*, Varnish still cache it. my default.vcl backend default { .host = "127.0.0.1"; .port = "8080"; } Is it possible to turn off this strange behaviors? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From contact at jpluscplusm.com Sun Mar 25 10:10:19 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Sun, 25 Mar 2012 12:10:19 +0200 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: Message-ID: On 25 March 2012 05:15, Ryan Chan wrote: > Seems?Varnish?is caching too aggressively, e.g. I have a?index.php?does not > send out?last-modifieid,cache-control, Varnish still cache it. > > my default.vcl > > backend default { > .host = "127.0.0.1"; > .port = "8080"; > } > > Is it possible to turn off this strange behaviors? Your responses are probably being cached because of the default default_ttl setting, which you'll find detailed a little way down https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters. However, rather than changing that run-time setting, you may want to force Varnish always to contact the back-end next time for those resources which don't dictate an explicit TTL. This would be both more visible and more tunable, later on. This VCL would achieve that goal, I believe (untested, but taken from the docs): sub vcl_fetch { if (beresp.ttl <= 0s) { # Mark as "Hit-For-Pass" for the next 2 minutes set beresp.ttl = 120s; return (hit_for_pass); } } HTH, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From kunmi at shebafoods.com Sun Mar 25 11:43:28 2012 From: kunmi at shebafoods.com (Kunmi Sheba Foods) Date: Sun, 25 Mar 2012 07:43:28 -0400 Subject: How do I install Varnish? Message-ID: <45b7355d$3b356779$a17dcb5$@com> Hello everyone, Can someone please share answers to my questions: 1. I am using regular linux and downloaded Varnish Cache 3.0.2 varnish-3.0.2.tar where do I put the files? 2. I read here https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-p ackages to run commands, but don't know where am to be to run the backups. - should I be in one of the folders in the tar file above to run the commands? 3. What messages should I see to confirm that Varnish is properly installed? 4. Please share any other pertinent information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodrigo at mercadolibre.com Sun Mar 25 19:41:18 2012 From: rodrigo at mercadolibre.com (Rodrigo Benzaquen) Date: Sun, 25 Mar 2012 19:41:18 +0000 (UTC) Subject: Invitation to connect on LinkedIn Message-ID: <261577587.3946197.1332704478214.JavaMail.app@ela4-bed78.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Rodrigo Rodrigo Benzaquen R & D Director at MercadoLibre Argentina Confirm that you know Rodrigo Benzaquen: https://www.linkedin.com/e/-j8jd37-h08hu4n6-1r/isd/6425721744/ZcqHxnut/?hs=false&tok=0CRQno2AutX581 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-j8jd37-h08hu4n6-1r/qj8gVubsam-VZpZ14ta9Vubs2iYTPmz3_bp9EIbbG4Y_Sw3/goo/varnish-misc%40projects%2Elinpro%2Eno/20061/I2229723267_1/?hs=false&tok=0XYnlzE_StX581 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn at ruberg.no Sun Mar 25 20:18:55 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Sun, 25 Mar 2012 22:18:55 +0200 Subject: How do I install Varnish? In-Reply-To: <45b7355d$3b356779$a17dcb5$@com> References: <45b7355d$3b356779$a17dcb5$@com> Message-ID: <4F6F7DAF.3010108@ruberg.no> On 25. mars 2012 13:43, Kunmi Sheba Foods wrote: > Hello everyone, > > Can someone please share answers to my questions: > > 1. I am using regular linux [...] What kind of Linux is that? You might want to specify your choice of Linux distribution, so we can help you better. Given proper information, Varnish will probably be way easier to install than what you're currently doing. -- Bj?rn -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn at ruberg.no Sun Mar 25 21:12:41 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Sun, 25 Mar 2012 23:12:41 +0200 Subject: How do I install Varnish? In-Reply-To: <7f5f577d$641f03ab$433c9240$@com> References: <7f5f577d$641f03ab$433c9240$@com> Message-ID: <4F6F8A49.8040105@ruberg.no> On 25. mars 2012 22:43, Kunmi Sheba Foods wrote: > Many thanks for your response. I am using linux centos 5.8.6, perl > version 5.8.8, Kernel version 2.6.18-238.9.1.el5PAE Then the proper release is available as documented at https://www.varnish-cache.org/releases/varnish-cache-3.0.2. > I look forward to your step-by-step instructions. No such luck. Please see https://www.varnish-cache.org/installation/redhat. Varnish is a power tool for experienced administrators and if you're not able to install it without step-by-step instructions, Varnish might not be what you're after. > Have a good day! You too, and for future reference please 1) respond to the list, and 2) stop top-posting. -- Bj?rn -------------- next part -------------- An HTML attachment was scrubbed... URL: From kunmi at shebafoods.com Sun Mar 25 22:11:41 2012 From: kunmi at shebafoods.com (Kunmi Sheba Foods) Date: Sun, 25 Mar 2012 18:11:41 -0400 Subject: Resending: How do I install Varnish? Message-ID: <13b75035$57ec10b1$519de9d1$@com> I am using linux centos 5.8.6, perl version 5.8.8, Kernel version 2.6.18. Thanks for your attention. ---------------------------------------- From: "Kunmi Sheba Foods" Sent: Sunday, March 25, 2012 7:43 AM To: varnish-misc at varnish-cache.org Subject: How do I install Varnish? Hello everyone, Can someone please share answers to my questions: 1. I am using regular linux and downloaded Varnish Cache 3.0.2 varnish-3.0.2.tar where do I put the files? 2. I read here https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-p ackages to run commands, but don't know where am to be to run the backups. - should I be in one of the folders in the tar file above to run the commands? 3. What messages should I see to confirm that Varnish is properly installed? 4. Please share any other pertinent information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tripathi.vimlesh at gmail.com Mon Mar 26 08:26:31 2012 From: tripathi.vimlesh at gmail.com (vimlesh tripathi) Date: Mon, 26 Mar 2012 13:56:31 +0530 Subject: Fwd: varnish-misc Digest, Vol 72, Issue 31 In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Date: Mon, Mar 26, 2012 at 2:42 AM Subject: varnish-misc Digest, Vol 72, Issue 31 To: varnish-misc at varnish-cache.org Send varnish-misc mailing list submissions to varnish-misc at varnish-cache.org To subscribe or unsubscribe via the World Wide Web, visit https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc or, via email, send a message with subject or body 'help' to varnish-misc-request at varnish-cache.org You can reach the person managing the list at varnish-misc-owner at varnish-cache.org When replying, please edit your Subject line so it is more specific than "Re: Contents of varnish-misc digest..." Today's Topics: 1. Re: How to make Varnish not caching response if they do not have proper cache header? (Jonathan Matthews) 2. How do I install Varnish? (Kunmi Sheba Foods) 3. Invitation to connect on LinkedIn (Rodrigo Benzaquen) 4. Re: How do I install Varnish? (Bj?rn Ruberg) 5. Re: How do I install Varnish? (Bj?rn Ruberg) ---------------------------------------------------------------------- Message: 1 Date: Sun, 25 Mar 2012 12:10:19 +0200 From: Jonathan Matthews To: varnish-misc at projects.linpro.no Subject: Re: How to make Varnish not caching response if they do not have proper cache header? Message-ID: Content-Type: text/plain; charset=UTF-8 On 25 March 2012 05:15, Ryan Chan wrote: > Seems?Varnish?is caching too aggressively, e.g. I have a?index.php?does not > send out?last-modifieid,cache-control, Varnish still cache it. > > my default.vcl > > backend default { > .host = "127.0.0.1"; > .port = "8080"; > } > > Is it possible to turn off this strange behaviors? Your responses are probably being cached because of the default default_ttl setting, which you'll find detailed a little way down https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters . However, rather than changing that run-time setting, you may want to force Varnish always to contact the back-end next time for those resources which don't dictate an explicit TTL. This would be both more visible and more tunable, later on. This VCL would achieve that goal, I believe (untested, but taken from the docs): sub vcl_fetch { if (beresp.ttl <= 0s) { # Mark as "Hit-For-Pass" for the next 2 minutes set beresp.ttl = 120s; return (hit_for_pass); } } HTH, Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html ------------------------------ Message: 2 Date: Sun, 25 Mar 2012 07:43:28 -0400 From: "Kunmi Sheba Foods" To: Subject: How do I install Varnish? Message-ID: <45b7355d$3b356779$a17dcb5$@com> Content-Type: text/plain; charset="us-ascii" Hello everyone, Can someone please share answers to my questions: 1. I am using regular linux and downloaded Varnish Cache 3.0.2 varnish-3.0.2.tar where do I put the files? 2. I read here https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-p ackages to run commands, but don't know where am to be to run the backups. - should I be in one of the folders in the tar file above to run the commands? 3. What messages should I see to confirm that Varnish is properly installed? 4. Please share any other pertinent information. -------------- next part -------------- An HTML attachment was scrubbed... URL: < https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120325/9b853873/attachment-0001.html > ------------------------------ Message: 3 Date: Sun, 25 Mar 2012 19:41:18 +0000 (UTC) From: Rodrigo Benzaquen To: Subject: Invitation to connect on LinkedIn Message-ID: <261577587.3946197.1332704478214.JavaMail.app at ela4-bed78.prod> Content-Type: text/plain; charset="utf-8" LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Rodrigo Rodrigo Benzaquen R & D Director at MercadoLibre Argentina Confirm that you know Rodrigo Benzaquen: https://www.linkedin.com/e/-j8jd37-h08hu4n6-1r/isd/6425721744/ZcqHxnut/?hs=false&tok=0CRQno2AutX581 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-j8jd37-h08hu4n6-1r/qj8gVubsam-VZpZ14ta9Vubs2iYTPmz3_bp9EIbbG4Y_Sw3/goo/varnish-misc%40projects%2Elinpro%2Eno/20061/I2229723267_1/?hs=false&tok=0XYnlzE_StX581 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: < https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120325/da5c6883/attachment-0001.html > ------------------------------ Message: 4 Date: Sun, 25 Mar 2012 22:18:55 +0200 From: Bj?rn Ruberg To: varnish-misc at varnish-cache.org Subject: Re: How do I install Varnish? Message-ID: <4F6F7DAF.3010108 at ruberg.no> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" On 25. mars 2012 13:43, Kunmi Sheba Foods wrote: > Hello everyone, > > Can someone please share answers to my questions: > > 1. I am using regular linux [...] What kind of Linux is that? You might want to specify your choice of Linux distribution, so we can help you better. Given proper information, Varnish will probably be way easier to install than what you're currently doing. -- Bj?rn -------------- next part -------------- An HTML attachment was scrubbed... URL: < https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120325/6a117ccb/attachment-0001.html > ------------------------------ Message: 5 Date: Sun, 25 Mar 2012 23:12:41 +0200 From: Bj?rn Ruberg To: varnish-misc at varnish-cache.org Subject: Re: How do I install Varnish? Message-ID: <4F6F8A49.8040105 at ruberg.no> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" On 25. mars 2012 22:43, Kunmi Sheba Foods wrote: > Many thanks for your response. I am using linux centos 5.8.6, perl > version 5.8.8, Kernel version 2.6.18-238.9.1.el5PAE Then the proper release is available as documented at https://www.varnish-cache.org/releases/varnish-cache-3.0.2. > I look forward to your step-by-step instructions. No such luck. Please see https://www.varnish-cache.org/installation/redhat. Varnish is a power tool for experienced administrators and if you're not able to install it without step-by-step instructions, Varnish might not be what you're after. > Have a good day! You too, and for future reference please 1) respond to the list, and 2) stop top-posting. -- Bj?rn -------------- next part -------------- An HTML attachment was scrubbed... URL: < https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120325/5827723b/attachment.html > ------------------------------ _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc End of varnish-misc Digest, Vol 72, Issue 31 ******************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanchan404 at gmail.com Mon Mar 26 10:55:01 2012 From: ryanchan404 at gmail.com (Ryan Chan) Date: Mon, 26 Mar 2012 18:55:01 +0800 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: Message-ID: Hello, On Sun, Mar 25, 2012 at 6:10 PM, Jonathan Matthews wrote: > On 25 March 2012 05:15, Ryan Chan wrote:Your > responses are probably being cached because of the default > default_ttl setting, which you'll find detailed a little way down > > https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters > . > > 1. I am wondering why `default_ttl of 120s is a good thing`, if the backend don't specify the ttl, shouldn't just pass it and not cache it would be the safest option? Hard coding 120s sound evil to me. 2. I am using 2.1, so sound like hard coding the ttl is the best choice then? Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Mon Mar 26 11:05:15 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Mon, 26 Mar 2012 13:05:15 +0200 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: Message-ID: <20120326110515.GQ12685@nerd.dk> On Mon, Mar 26, 2012 at 06:55:01PM +0800, Ryan Chan wrote: > > > Your responses are probably being cached because of the default default_ttl > > setting, which you'll find detailed a little way down > > > > https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters > > 1. I am wondering why `default_ttl of 120s is a good thing`, if the backend > don't specify the ttl, shouldn't just pass it and not cache it would be the > safest option? Hard coding 120s sound evil to me. No, since Varnish is not a cache in the RFC2616 sense. You're expected to configure your own policy. You can easily check for header presence in VCL and set TTL accordingly. > 2. I am using 2.1, so sound like hard coding the ttl is the best choice > then? 2.1 has the same default_ttl parameter. See man varnishd. -- Andreas From contact at jpluscplusm.com Mon Mar 26 11:10:10 2012 From: contact at jpluscplusm.com (Jonathan Matthews) Date: Mon, 26 Mar 2012 12:10:10 +0100 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: Message-ID: On 26 March 2012 11:55, Ryan Chan wrote: > On Sun, Mar 25, 2012 at 6:10 PM, Jonathan Matthews > wrote: >> >> On 25 March 2012 05:15, Ryan Chan wrote:Your >> responses are probably being cached because of the default >> default_ttl setting, which you'll find detailed a little way down >> >> https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters. >> > 1. I am wondering why `default_ttl of 120s is a good thing`, if the backend > don't specify the ttl, shouldn't just pass it and not cache it would be the > safest option? Hard coding 120s sound evil to me. I can't disagree with you there, personally :-) I always drop this to 0s so I can insist that the back-end devs request caching be enabled by explicitly setting the appropriate headers. > 2. I am using 2.1, so sound like hard coding the ttl is the best choice > then? You'll find the 2.1 documentation is still available on the site. In some ways it's actually a bit easier to find your way around than the current 3.0 docs. *Most* 3.0 functionality is available in 2.1. default_ttl definitely is, however. Jonathan -- Jonathan Matthews London, Oxford, UK http://www.jpluscplusm.com/contact.html From ryanchan404 at gmail.com Mon Mar 26 11:14:08 2012 From: ryanchan404 at gmail.com (Ryan Chan) Date: Mon, 26 Mar 2012 19:14:08 +0800 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: Message-ID: On Mon, Mar 26, 2012 at 7:10 PM, Jonathan Matthews wrote: > > You'll find the 2.1 documentation is still available on the site. In > some ways it's actually a bit easier to find your way around than the > current 3.0 docs. *Most* 3.0 functionality is available in 2.1. > default_ttl definitely is, however. > > Thanks. Problem solved by editing the file "/etc/default/varnish", using the flag "-t 0" -------------- next part -------------- An HTML attachment was scrubbed... URL: From straightflush at gmail.com Mon Mar 26 13:24:24 2012 From: straightflush at gmail.com (AD) Date: Mon, 26 Mar 2012 09:24:24 -0400 Subject: vmod-bootstrap In-Reply-To: References: Message-ID: Interesting concept kind of like gems in ruby. I would be up for helping out with something like that. On Fri, Mar 23, 2012 at 6:48 PM, Cosimo Streppone wrote: > On Fri, 23 Mar 2012 20:45:31 +0100, AD wrote: > > no i just wasnt sure if you were aware of it since I think its what >> people are using to start their vmod dev. >> Sorry, i didnt fully check your repo i was just pointing it out. >> > > No problem. > > I've been thinking more about this coming back from VUG5. > Trying to imagine the future a little... :) > What if vmod-bootstrap was renamed into varnishmod? > > Could it grow into a tool to be shipped with varnish? > Examples: > > # Create a new module skeleton > varnishmod bootstrap [--config vmod.conf] > > # Operate on the local module in ./ ? > varnishmod {build,test,install} > > # List all available VMODs, consulting a central db SomeWhere(tm) > varnishmod list > > # Publish this new module in the central db (w/ some screening?) > varnishmod push [--config vmod.conf] > > # Download a remote module and optionally install it > varnishmod download digest > cd libvmod-digest > varnishmod install > > So, it just makes it simpler to boot the process of VMOD > development, but it also paves the way for further > interesting next steps. > > > -- > Cosimo > > ______________________________**_________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.gareth.light at gmail.com Tue Mar 27 16:42:15 2012 From: j.gareth.light at gmail.com (James Light) Date: Tue, 27 Mar 2012 12:42:15 -0400 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: <20120326110515.GQ12685@nerd.dk> References: <20120326110515.GQ12685@nerd.dk> Message-ID: On Mon, Mar 26, 2012 at 7:05 AM, Andreas Plesner Jacobsen wrote: [snip] >> safest option? Hard coding 120s sound evil to me. > > No, since Varnish is not a cache in the RFC2616 sense. You're expected to > configure your own policy. You can easily check for header presence in VCL and > set TTL accordingly. I'm wondering what you mean by this? In what ways does varnish not follow RFC 2616's recommendations / requirements for an HTTP cache? Do you simply mean that this is because varnish is meant to be used in an organization's internal infrastructure and that the RFC's language about caching seems to be more in reference to downstream caches run by third party organizations that are neither the client nor associated with the organizations responsible for the original content? [snip] > Andreas > Thanks, jlight From perbu at varnish-software.com Tue Mar 27 20:29:43 2012 From: perbu at varnish-software.com (Per Buer) Date: Tue, 27 Mar 2012 22:29:43 +0200 Subject: How to make Varnish not caching response if they do not have proper cache header? In-Reply-To: References: <20120326110515.GQ12685@nerd.dk> Message-ID: Hi James, On Tue, Mar 27, 2012 at 6:42 PM, James Light wrote: > > I'm wondering what you mean by this? In what ways does varnish not > follow RFC 2616's recommendations / requirements for an HTTP cache? We're a "surrogate cache" or, if you like, a web server with a HTTP backend. RFC2616 talks about forward proxies when it talks about caches and what is says isn't relevant for us. > Do you simply mean that this is because varnish is meant to be used in an > organization's internal infrastructure and that the RFC's language > about caching seems to be more in reference to downstream caches run > by third party organizations that are neither the client nor > associated with the organizations responsible for the original > content? > Yes. Content providers might have their content stumble onto a downstream forward proxy. I doubt it will stumble into a Varnish server without them knowing it. This has been discussed back and forth on the mailing list a couple of times. -- Per Buer Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From zacharyalexstern at gmail.com Tue Mar 27 23:31:15 2012 From: zacharyalexstern at gmail.com (Zachary Alex Stern) Date: Tue, 27 Mar 2012 19:31:15 -0400 Subject: varnish *slowing* down site, any ideas? Message-ID: Hey there, We have a lot of websites (perhaps 15-20) running on apache, behind a varnish cache. One of our sites seems to experience random slowdowns when varnish is enabled. It will take between 5-20 seconds to load, fairly frequently. Our other sites all seem unaffected. When I disable varnish and have apache listen on port 80, the problem disappears entirely. Any thoughts? Here's our vcl.conf if it helps: http://pastebin.com/XPUvSPeu Thanks! * * *-Zachary Alex Stern* * * -------------- next part -------------- An HTML attachment was scrubbed... URL: From isp at daviesinc.com Wed Mar 28 01:38:27 2012 From: isp at daviesinc.com (Chris Davies) Date: Tue, 27 Mar 2012 21:38:27 -0400 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: On Mar 27, 2012, at 7:31 PM, Zachary Alex Stern wrote: > One of our sites seems to experience random slowdowns when varnish is enabled. It will take between 5-20 seconds to load, fairly frequently. Our other sites all seem unaffected. Is the one site handling large files? sockets? Is it a particular file extension? dynamic page? should the page be cached? Run varnishlog and see if you can catch a few of the responses that are delayed, that will give a bit more information about what varnish is doing. What version of Varnish, what OS? From stig at zedge.net Wed Mar 28 07:45:35 2012 From: stig at zedge.net (Stig Bakken) Date: Wed, 28 Mar 2012 09:45:35 +0200 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: On Wed, Mar 28, 2012 at 1:31 AM, Zachary Alex Stern < zacharyalexstern at gmail.com> wrote: > Hey there, > > We have a lot of websites (perhaps 15-20) running on apache, behind a > varnish cache. > > One of our sites seems to experience random slowdowns when varnish is > enabled. It will take between 5-20 seconds to load, fairly frequently. Our > other sites all seem unaffected. > > When I disable varnish and have apache listen on port 80, the problem > disappears entirely. > > Any thoughts? > > Here's our vcl.conf if it helps: http://pastebin.com/XPUvSPeu > For this kind of problem, it is very useful if you post the output of "varnishadm param.show" and "varnishstat -1" as well. - Stig -------------- next part -------------- An HTML attachment was scrubbed... URL: From kacperw at gmail.com Wed Mar 28 13:34:18 2012 From: kacperw at gmail.com (Kacper Wysocki) Date: Wed, 28 Mar 2012 15:34:18 +0200 Subject: VUG5 securing your web stack with varnish Message-ID: Hi folks & thanks for a fun VUG5 with a lot of interesting chats with some of you interesting chaps. My slides can be found at http://delta9.pl/public/varnishsec/ I'll be happy to take comments and answer any questions that were left unanswered on Thursday. Regards, Kacper Wysocki -- http://comotion.delta9.pl http://u.delta9.pl http://kacper.doesntexist.org Too much order is its own chaos. Employ no technique to gain supreme enlightment. From kacperw at gmail.com Wed Mar 28 13:44:09 2012 From: kacperw at gmail.com (Kacper Wysocki) Date: Wed, 28 Mar 2012 15:44:09 +0200 Subject: Resending: How do I install Varnish? In-Reply-To: <13b75035$57ec10b1$519de9d1$@com> References: <13b75035$57ec10b1$519de9d1$@com> Message-ID: On Mon, Mar 26, 2012 at 12:11 AM, Kunmi Sheba Foods wrote: > I am using linux centos 5.8.6, perl version 5.8.8, Kernel version?2.6.18. > Hello everyone, > > Can someone please share answers to my questions: > > 1. I am using regular linux and downloaded Varnish Cache > 3.0.2?varnish-3.0.2.tar > ? ? where do I put the files? > > 2. I read here > https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-packages?to > run commands, but don't know where am to be to run the backups. > - ?should I be in one of the folders in the tar file above to run the > commands? > > 3. What messages should I see to confirm that Varnish is properly installed? > > 4. ?Please share any other pertinent information. Hi Kunmi, Varnish 2.0.6, which is a very good and stable release, can be easily installed through Yum on CentOS 5 if you have enabled the EPEL repository: https://www.varnish-cache.org/docs/3.0/installation/install.html#centos-redhat This is the recommended installation procedure for you. As this is a basic CentOS administration task, please see a generic tutorial on installing RPM packages through yum. If you are wondering why your questions do not get answered, please see http://perl.plover.com/Questions.html Regards, Kacper From straightflush at gmail.com Wed Mar 28 13:49:03 2012 From: straightflush at gmail.com (AD) Date: Wed, 28 Mar 2012 09:49:03 -0400 Subject: VUG5 securing your web stack with varnish In-Reply-To: References: Message-ID: awesome. Ruben any chance we can get all the slides from the VUG :-) -AD On Wed, Mar 28, 2012 at 9:34 AM, Kacper Wysocki wrote: > Hi folks & thanks for a fun VUG5 with a lot of interesting chats with > some of you interesting chaps. > > My slides can be found at > > http://delta9.pl/public/varnishsec/ > > I'll be happy to take comments and answer any questions that were left > unanswered on Thursday. > > Regards, > Kacper Wysocki > > -- > http://comotion.delta9.pl > http://u.delta9.pl > http://kacper.doesntexist.org > Too much order is its own chaos. > Employ no technique to gain supreme enlightment. > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruben at varnish-software.com Wed Mar 28 14:04:49 2012 From: ruben at varnish-software.com (=?UTF-8?Q?Rub=C3=A9n_Romero?=) Date: Wed, 28 Mar 2012 16:04:49 +0200 Subject: Summarizing VUG5 (User Day) Message-ID: Hello there, First of all: Thank you to everyone that, one way or another, made a great 2day user group meeting last week in Paris happen! As promised, I have now updated the page with participant information as well as links to all slides presented during VUG5, mostly during the User Day. You can see it all here (please do not forget to give us feedback): * https://www.varnish-cache.org/vug5 Someone else than me will give you a summary of the discussions under the Developer Day. It was a pleasure meeting you all, and I hope this is not the last time. Personally, I am very happy we got our first patch for Varnish Status (Graphs!)[1] and that The Varnish Book[2] is finally out :-) Thanks for all the fish! Best regards, -- Rub?n Romero, Global Sales Executive & Community Cheerleader Phone: +47 21 98 92 62 / Mobile: +47 959 64 088 / Skype: ruben_varnish / GTalk: *Varnish makes websites fly!* Whitepapers | Video | Twitter | LinkedIn [1] https://github.com/lkarsten/libvmod-status/pull/3 [2] https://www.varnish-software.com/book -------------- next part -------------- An HTML attachment was scrubbed... URL: From longvnit at gmail.com Wed Mar 28 16:15:58 2012 From: longvnit at gmail.com (Nguyen Long) Date: Wed, 28 Mar 2012 23:15:58 +0700 Subject: Expected ';' got 'req.url' Message-ID: I used the vcl code to redirect website to mobile version as follow sub vcl_recv { if ((req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ "Android" || req.http.User-Agent ~ "Symbian" || req.http.User-Agent ~ "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" || req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" || req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "webOS" || req.http.User-Agent ~ "^PalmSource") && req.http.host ~ "^(www.vechai.info| vechai.info)") { error 750 "Moved Temporarily"; } } sub vcl_error { if (obj.status == 750) { set obj.http.Location = "http://domain.com" req.url; set obj.status = 302; return(deliver); } } But when I use above code on Centos has kernel version is Linux localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux then every things is ok. But when I use bove code on Centos has kernel version is Linux server6.vina84.com 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux then fail :( Both OS updated latest version. Error as follow: Message from VCC-compiler: Expected ';' got 'req.url' (program line 174), at ('input' Line 121 Pos 64) set obj.http.Location = "http://domain.com" req.url; ---------------------------------------------------------------#######- Running VCC-compiler failed, exit 1 VCL compilation failed Command failed with error code 106 And when I change "set obj.http.Location = "http://domain.com" req.url;" to " set obj.http.Location = "http://domain.com";" then varnish is aleady running. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pprocacci at datapipe.com Wed Mar 28 16:40:41 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Wed, 28 Mar 2012 11:40:41 -0500 Subject: Expected ';' got 'req.url' In-Reply-To: References: Message-ID: <20120328164041.GB44507@nat.myhome> I think to concat strings you need a '+' sign between them. You should also escape your '.' periods in your regex's. ~Paul On Wed, Mar 28, 2012 at 11:15:58PM +0700, Nguyen Long wrote: > I used the vcl code to redirect website to mobile version as follow > > sub vcl_recv { > if ((req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ > "Android" || req.http.User-Agent ~ "Symbian" || req.http.User-Agent ~ > "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" || > req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" || > req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "webOS" || > req.http.User-Agent ~ "^PalmSource") && req.http.host ~ "^(www.vechai.info| > vechai.info)") { > error 750 "Moved Temporarily"; > } > } > > sub vcl_error { > if (obj.status == 750) { > set obj.http.Location = "http://domain.com" req.url; > set obj.status = 302; > return(deliver); > } > } > > But when I use above code on Centos has kernel version is Linux > localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST > 2011 x86_64 x86_64 x86_64 GNU/Linux then every things is ok. > But when I use bove code on Centos has kernel version is Linux > server6.vina84.com 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 > x86_64 x86_64 x86_64 GNU/Linux then fail :( > Both OS updated latest version. > > Error as follow: > Message from VCC-compiler: > Expected ';' got 'req.url' > (program line 174), at > ('input' Line 121 Pos 64) > set obj.http.Location = "http://domain.com" req.url; > ---------------------------------------------------------------#######- > > Running VCC-compiler failed, exit 1 > VCL compilation failed > Command failed with error code 106 > > And when I change "set obj.http.Location = "http://domain.com" req.url;" > to " set obj.http.Location = "http://domain.com";" then varnish is aleady > running. > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc ________________________________ 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. From kim at heldig.org Wed Mar 28 18:01:30 2012 From: kim at heldig.org (Kim Eik) Date: Wed, 28 Mar 2012 20:01:30 +0200 Subject: Banning objects by req.url and Authorization header. Message-ID: Hi, i'm fairly new to varnish. And i'm trying to get this configuration to work. sub vcl_recv { if(req.request == "PUT" && req.url ~ "^/api/0.1/userMedia"){ ban ("req.url == /api/0.1/user && req.http.Authorization == " + req.http.Authorization); return(pass); } if(req.url ~ "^/api/0.1"){ return(lookup); } } sub vcl_hash { if(req.url ~ "^/api/0.1"){ hash_data(req.http.Authorization); } } Basically what i'm trying to do is in the case where there is a request against /api/0.1/userMedia with the request method PUT, then i want to evict any cached objects which matches the url /api/0.1/user and that has the same Authorization header. Everything worked fine until i added && req.http.Authorization == " + req.http.Authorization to the ban line. What is the proper way to do this? Any help on this is appreciated. -Kim From zacharyalexstern at gmail.com Wed Mar 28 18:08:06 2012 From: zacharyalexstern at gmail.com (Zachary Alex Stern) Date: Wed, 28 Mar 2012 14:08:06 -0400 Subject: Expected ';' got 'req.url' In-Reply-To: <20120328164041.GB44507@nat.myhome> References: <20120328164041.GB44507@nat.myhome> Message-ID: Varnish 3 does in fact a string concatenation character, "+", as per: https://www.varnish-cache.org/docs/3.0/installation/upgrade.html * * *-Zachary* On Wed, Mar 28, 2012 at 12:40 PM, Paul A. Procacci wrote: > I think to concat strings you need a '+' sign between them. > You should also escape your '.' periods in your regex's. > > ~Paul > > On Wed, Mar 28, 2012 at 11:15:58PM +0700, Nguyen Long wrote: > > I used the vcl code to redirect website to mobile version as follow > > > > sub vcl_recv { > > if ((req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ > > "Android" || req.http.User-Agent ~ "Symbian" || req.http.User-Agent ~ > > "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" || > > req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" || > > req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "webOS" || > > req.http.User-Agent ~ "^PalmSource") && req.http.host ~ "^( > www.vechai.info| > > vechai.info)") { > > error 750 "Moved Temporarily"; > > } > > } > > > > sub vcl_error { > > if (obj.status == 750) { > > set obj.http.Location = "http://domain.com" req.url; > > set obj.status = 302; > > return(deliver); > > } > > } > > > > But when I use above code on Centos has kernel version is Linux > > localhost.localdomain 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST > > 2011 x86_64 x86_64 x86_64 GNU/Linux then every things is ok. > > But when I use bove code on Centos has kernel version is Linux > > server6.vina84.com 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 > > x86_64 x86_64 x86_64 GNU/Linux then fail :( > > Both OS updated latest version. > > > > Error as follow: > > Message from VCC-compiler: > > Expected ';' got 'req.url' > > (program line 174), at > > ('input' Line 121 Pos 64) > > set obj.http.Location = "http://domain.com" req.url; > > ---------------------------------------------------------------#######- > > > > Running VCC-compiler failed, exit 1 > > VCL compilation failed > > Command failed with error code 106 > > > > And when I change "set obj.http.Location = "http://domain.com" > req.url;" > > to " set obj.http.Location = "http://domain.com";" then varnish is > aleady > > running. > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > ________________________________ > > 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 at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apriou at gmail.com Wed Mar 28 18:08:31 2012 From: apriou at gmail.com (Alexandre Priou) Date: Wed, 28 Mar 2012 20:08:31 +0200 Subject: question on the cookies and varnish Message-ID: hi at all I need to erase all cookies in varnish conf except the cookie with name : PHPSESSID how i can to do that ? thank for your answer -- Alexandre Priou Analyste Concepteur Web -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at 925.dk Wed Mar 28 18:12:15 2012 From: martin at 925.dk (Martin Koch Andersen) Date: Wed, 28 Mar 2012 20:12:15 +0200 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: Den 28/03/2012 kl. 20.08 skrev Alexandre Priou: > hi at all > > I need to erase all cookies in varnish conf except the cookie with name : PHPSESSID > > how i can to do that ? This nasty way: https://www.varnish-cache.org/trac/wiki/VCLExampleRemovingSomeCookies Did anyone do a nice VMOD for this? -- Martin Koch Andersen http://925.dk From roberto.fernandezcrisial at gmail.com Wed Mar 28 18:14:30 2012 From: roberto.fernandezcrisial at gmail.com (=?ISO-8859-1?Q?Roberto_O=2E_Fern=E1ndez_Crisial?=) Date: Wed, 28 Mar 2012 15:14:30 -0300 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: Hi Alexandre, You could use something on vcl_recv() like: if (req.http.Cookie ~ "PHPSESSID") { remove req.http.Cookie; } Regards, Roberto (a.k.a. @rofc) On Wed, Mar 28, 2012 at 3:08 PM, Alexandre Priou wrote: > hi at all > > I need to erase all cookies in varnish conf except the cookie with name : > PHPSESSID > > how i can to do that ? > > thank for your answer > > -- > Alexandre Priou > Analyste Concepteur Web > > > > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apriou at gmail.com Wed Mar 28 18:16:05 2012 From: apriou at gmail.com (Alexandre Priou) Date: Wed, 28 Mar 2012 20:16:05 +0200 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: thank at all i try that best regard 2012/3/28 Roberto O. Fern?ndez Crisial > Hi Alexandre, > > You could use something on vcl_recv() like: > > if (req.http.Cookie ~ "PHPSESSID") > { > remove req.http.Cookie; > } > > Regards, > Roberto (a.k.a. @rofc) > > On Wed, Mar 28, 2012 at 3:08 PM, Alexandre Priou wrote: > >> hi at all >> >> I need to erase all cookies in varnish conf except the cookie with name : >> PHPSESSID >> >> how i can to do that ? >> >> thank for your answer >> >> -- >> Alexandre Priou >> Analyste Concepteur Web >> >> >> >> >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >> > > -- Alexandre Priou Analyste Concepteur Web -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.gareth.light at gmail.com Wed Mar 28 18:25:34 2012 From: j.gareth.light at gmail.com (James Light) Date: Wed, 28 Mar 2012 14:25:34 -0400 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: 2012/3/28 Alexandre Priou : > thank at all > > i try that > > best regard > > 2012/3/28 Roberto O. Fern?ndez Crisial > >> Hi Alexandre, >> >> You could use something on?vcl_recv() like: >> >> if (req.http.Cookie ~ "PHPSESSID") >> { >> remove req.http.Cookie; >> } >> >> Regards, >> Roberto (a.k.a. @rofc) >> >> On Wed, Mar 28, 2012 at 3:08 PM, Alexandre Priou wrote: >>> >>> hi at all >>> >>> I need to erase all cookies in varnish conf except the cookie with name : >>> PHPSESSID >>> >>> how i can to do that ? >>> >>> thank for your answer >>> >>> -- >>> Alexandre Priou >>> Analyste Concepteur Web Um, no. That's not going to work as most user agents will pass ALL of the cookies in one single "Cookie:" header. That VCL above says "If there's the string "PHPSESSID" in the HTTP headers of the client request, remove that entire header. What you asked was how to remove every *other* cookie *except* PHPSESSID. There is an example of how to do that on the varnish site here: https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html Personally, I prefer a different way, which amounts to: * extract the PHPSESSID into a different header * unset the entire Cookie Header * add back only the PHPSESSID as the Cookie header A reminder that VCL has PCRE (perl compat regexes), so you can look up those as needed and go at it. Hope that helps. -jlight From pprocacci at datapipe.com Wed Mar 28 18:32:46 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Wed, 28 Mar 2012 13:32:46 -0500 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: <20120328183246.GD44507@nat.myhome> https://github.com/varnish/libvmod-header Haven't tested it, but it seems this would do what the parent wants. `header.get(
, )` import header; set req.http.cookie = header.get(req.http.cookie, "PHPSESSID"); ~Paul On Wed, Mar 28, 2012 at 08:12:15PM +0200, Martin Koch Andersen wrote: > > Den 28/03/2012 kl. 20.08 skrev Alexandre Priou: > > hi at all > > > > I need to erase all cookies in varnish conf except the cookie with name : PHPSESSID > > > > how i can to do that ? > > This nasty way: https://www.varnish-cache.org/trac/wiki/VCLExampleRemovingSomeCookies > > Did anyone do a nice VMOD for this? > > -- > Martin Koch Andersen > http://925.dk > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc ________________________________ 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. From pprocacci at datapipe.com Wed Mar 28 18:33:40 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Wed, 28 Mar 2012 13:33:40 -0500 Subject: question on the cookies and varnish In-Reply-To: <20120328183246.GD44507@nat.myhome> References: <20120328183246.GD44507@nat.myhome> Message-ID: <20120328183340.GE44507@nat.myhome> Disregard....it won't. On Wed, Mar 28, 2012 at 01:32:46PM -0500, Paul A. Procacci wrote: > https://github.com/varnish/libvmod-header > > Haven't tested it, but it seems this would do what the parent wants. > > `header.get(
, )` > > import header; > set req.http.cookie = header.get(req.http.cookie, "PHPSESSID"); > > ~Paul > > On Wed, Mar 28, 2012 at 08:12:15PM +0200, Martin Koch Andersen wrote: > > > > Den 28/03/2012 kl. 20.08 skrev Alexandre Priou: > > > hi at all > > > > > > I need to erase all cookies in varnish conf except the cookie with name : PHPSESSID > > > > > > how i can to do that ? > > > > This nasty way: https://www.varnish-cache.org/trac/wiki/VCLExampleRemovingSomeCookies > > > > Did anyone do a nice VMOD for this? > > > > -- > > Martin Koch Andersen > > http://925.dk > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc ________________________________ 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. From j.gareth.light at gmail.com Wed Mar 28 18:47:32 2012 From: j.gareth.light at gmail.com (James Light) Date: Wed, 28 Mar 2012 14:47:32 -0400 Subject: Fwd: question on the cookies and varnish In-Reply-To: References: <20120328183246.GD44507@nat.myhome> Message-ID: On Wed, Mar 28, 2012 at 2:32 PM, Paul A. Procacci wrote: > https://github.com/varnish/libvmod-header > > Haven't tested it, but it seems this would do what the parent wants. > > `header.get(
, )` > > import header; > set req.http.cookie = header.get(req.http.cookie, "PHPSESSID"); > > ~Paul > No, that also won't work unless the only cookie is PHPSESSID as this library will still return the ENTIRE header. >From the documentation, it looks like this library was written to help the situation where multiple "Set-Cookie" headers are sent from the backend and there exists a need to parse several of them, however I believe the vmod_std module now includes a collect() subroutine, which is capable of similar functionality by collapsing all headers of the same type into one long header of that same type: https://www.varnish-cache.org/docs/3.0/reference/vmod_std.html?highlight=collect ? ? -jlight From zacharyalexstern at gmail.com Wed Mar 28 19:57:52 2012 From: zacharyalexstern at gmail.com (Zachary Alex Stern) Date: Wed, 28 Mar 2012 15:57:52 -0400 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: *Output of varnishadm param.show:* acceptor_sleep_decay 0.900000 [] acceptor_sleep_incr 0.001000 [s] acceptor_sleep_max 0.050000 [s] auto_restart on [bool] ban_dups on [bool] ban_lurker_sleep 0.010000 [s] between_bytes_timeout 60.000000 [s] cc_command "exec gcc -std=gnu99 -g -O2 -pthread -fpic -shared -Wl,-x -o %o %s" cli_buffer 8192 [bytes] cli_timeout 10 [seconds] clock_skew 10 [s] connect_timeout 0.700000 [s] critbit_cooloff 180.000000 [s] default_grace 10.000000 [seconds] default_keep 0.000000 [seconds] default_ttl 120.000000 [seconds] diag_bitmap 0x0 [bitmap] esi_syntax 0 [bitmap] expiry_sleep 1.000000 [seconds] fetch_chunksize 128 [kilobytes] fetch_maxchunksize 262144 [kilobytes] first_byte_timeout 60.000000 [s] group nogroup (65534) gzip_level 6 [] gzip_memlevel 8 [] gzip_stack_buffer 32768 [Bytes] gzip_tmp_space 0 [] gzip_window 15 [] http_gzip_support on [bool] http_max_hdr 64 [header lines] http_range_support on [bool] http_req_hdr_len 8192 [bytes] http_req_size 32768 [bytes] http_resp_hdr_len 8192 [bytes] http_resp_size 32768 [bytes] listen_address 0.0.0.0:80 listen_depth 1024 [connections] log_hashstring on [bool] log_local_address off [bool] lru_interval 2 [seconds] max_esi_depth 5 [levels] max_restarts 4 [restarts] nuke_limit 50 [allocations] ping_interval 3 [seconds] pipe_timeout 60 [seconds] prefer_ipv6 off [bool] queue_max 100 [%] rush_exponent 3 [requests per request] saintmode_threshold 10 [objects] send_timeout 60 [seconds] sess_timeout 5 [seconds] sess_workspace 65536 [bytes] session_linger 50 [ms] session_max 100000 [sessions] shm_reclen 255 [bytes] shm_workspace 8192 [bytes] shortlived 10.000000 [s] syslog_cli_traffic on [bool] thread_pool_add_delay 2 [milliseconds] thread_pool_add_threshold 2 [requests] thread_pool_fail_delay 200 [milliseconds] thread_pool_max 2048 [threads] thread_pool_min 1 [threads] thread_pool_purge_delay 1000 [milliseconds] thread_pool_stack unlimited [bytes] thread_pool_timeout 10 [seconds] thread_pool_workspace 65536 [bytes] thread_pools 2 [pools] thread_stats_rate 10 [requests] user nobody (65534) vcc_err_unref on [bool] vcl_dir /etc/varnish vcl_trace off [bool] vmod_dir /usr/lib/varnish/vmods waiter default (epoll, poll) * * *Output of varnishstat -1:* client_conn 1164 1.23 Client connections accepted client_drop 0 0.00 Connection dropped, no sess/wrk client_req 1164 1.23 Client requests received cache_hit 524 0.56 Cache hits cache_hitpass 0 0.00 Cache hits for pass cache_miss 98 0.10 Cache misses backend_conn 546 0.58 Backend conn. success backend_unhealthy 0 0.00 Backend conn. not attempted backend_busy 0 0.00 Backend conn. too many backend_fail 0 0.00 Backend conn. failures backend_reuse 94 0.10 Backend conn. reuses backend_toolate 3 0.00 Backend conn. was closed backend_recycle 97 0.10 Backend conn. recycles backend_retry 0 0.00 Backend conn. retry fetch_head 0 0.00 Fetch head fetch_length 563 0.60 Fetch with Length fetch_chunked 14 0.01 Fetch chunked fetch_eof 0 0.00 Fetch EOF fetch_bad 0 0.00 Fetch had bad headers fetch_close 43 0.05 Fetch wanted close fetch_oldhttp 0 0.00 Fetch pre HTTP/1.1 closed fetch_zero 0 0.00 Fetch zero len fetch_failed 0 0.00 Fetch failed fetch_1xx 0 0.00 Fetch no body (1xx) fetch_204 0 0.00 Fetch no body (204) fetch_304 19 0.02 Fetch no body (304) n_sess_mem 17 . N struct sess_mem n_sess 0 . N struct sess n_object 69 . N struct object n_vampireobject 0 . N unresurrected objects n_objectcore 71 . N struct objectcore n_objecthead 71 . N struct objecthead n_waitinglist 24 . N struct waitinglist n_vbc 0 . N struct vbc n_wrk 2 . N worker threads n_wrk_create 24 0.03 N worker threads created n_wrk_failed 0 0.00 N worker threads not created n_wrk_max 33 0.03 N worker threads limited n_wrk_lqueue 0 0.00 work request queue length n_wrk_queued 152 0.16 N queued work requests n_wrk_drop 0 0.00 N dropped work requests n_backend 1 . N backends n_expired 29 . N expired objects n_lru_nuked 0 . N LRU nuked objects n_lru_moved 458 . N LRU moved objects losthdr 0 0.00 HTTP header overflows n_objsendfile 0 0.00 Objects sent with sendfile n_objwrite 1135 1.20 Objects sent with write n_objoverflow 0 0.00 Objects overflowing workspace s_sess 1164 1.23 Total Sessions s_req 1164 1.23 Total Requests s_pipe 0 0.00 Total pipe s_pass 542 0.57 Total pass s_fetch 639 0.68 Total fetch s_hdrbytes 437246 463.18 Total header bytes s_bodybytes 14474608 15333.27 Total body bytes sess_closed 1164 1.23 Session Closed sess_pipeline 0 0.00 Session Pipeline sess_readahead 0 0.00 Session Read Ahead sess_linger 0 0.00 Session Linger sess_herd 0 0.00 Session herd shm_records 85020 90.06 SHM records shm_writes 6648 7.04 SHM writes shm_flushes 0 0.00 SHM flushes due to overflow shm_cont 8 0.01 SHM MTX contention shm_cycles 0 0.00 SHM cycles through buffer sms_nreq 1 0.00 SMS allocator requests sms_nobj 0 . SMS outstanding allocations sms_nbytes 0 . SMS outstanding bytes sms_balloc 419 . SMS bytes allocated sms_bfree 419 . SMS bytes freed backend_req 640 0.68 Backend requests made n_vcl 1 0.00 N vcl total n_vcl_avail 1 0.00 N vcl available n_vcl_discard 0 0.00 N vcl discarded n_ban 1 . N total active bans n_ban_add 1 0.00 N new bans added n_ban_retire 0 0.00 N old bans deleted n_ban_obj_test 0 0.00 N objects tested n_ban_re_test 0 0.00 N regexps tested against n_ban_dups 0 0.00 N duplicate bans removed hcb_nolock 0 0.00 HCB Lookups without lock hcb_lock 0 0.00 HCB Lookups with lock hcb_insert 0 0.00 HCB Inserts esi_errors 0 0.00 ESI parse errors (unlock) esi_warnings 0 0.00 ESI parse warnings (unlock) accept_fail 0 0.00 Accept failures client_drop_late 0 0.00 Connection dropped late uptime 944 1.00 Client uptime dir_dns_lookups 0 0.00 DNS director lookups dir_dns_failed 0 0.00 DNS director failed lookups dir_dns_hit 0 0.00 DNS director cached lookups hit dir_dns_cache_full 0 0.00 DNS director full dnscache vmods 0 . Loaded VMODs n_gzip 0 0.00 Gzip operations n_gunzip 521 0.55 Gunzip operations LCK.sms.creat 1 0.00 Created locks LCK.sms.destroy 0 0.00 Destroyed locks LCK.sms.locks 3 0.00 Lock Operations LCK.sms.colls 0 0.00 Collisions LCK.smp.creat 0 0.00 Created locks LCK.smp.destroy 0 0.00 Destroyed locks LCK.smp.locks 0 0.00 Lock Operations LCK.smp.colls 0 0.00 Collisions LCK.sma.creat 2 0.00 Created locks LCK.sma.destroy 0 0.00 Destroyed locks LCK.sma.locks 2922 3.10 Lock Operations LCK.sma.colls 0 0.00 Collisions LCK.smf.creat 0 0.00 Created locks LCK.smf.destroy 0 0.00 Destroyed locks LCK.smf.locks 0 0.00 Lock Operations LCK.smf.colls 0 0.00 Collisions LCK.hsl.creat 0 0.00 Created locks LCK.hsl.destroy 0 0.00 Destroyed locks LCK.hsl.locks 0 0.00 Lock Operations LCK.hsl.colls 0 0.00 Collisions LCK.hcb.creat 0 0.00 Created locks LCK.hcb.destroy 0 0.00 Destroyed locks LCK.hcb.locks 0 0.00 Lock Operations LCK.hcb.colls 0 0.00 Collisions LCK.hcl.creat 16383 17.35 Created locks LCK.hcl.destroy 0 0.00 Destroyed locks LCK.hcl.locks 1175 1.24 Lock Operations LCK.hcl.colls 0 0.00 Collisions LCK.vcl.creat 1 0.00 Created locks LCK.vcl.destroy 0 0.00 Destroyed locks LCK.vcl.locks 48 0.05 Lock Operations LCK.vcl.colls 0 0.00 Collisions LCK.stat.creat 1 0.00 Created locks LCK.stat.destroy 0 0.00 Destroyed locks LCK.stat.locks 17 0.02 Lock Operations LCK.stat.colls 0 0.00 Collisions LCK.sessmem.creat 1 0.00 Created locks LCK.sessmem.destroy 0 0.00 Destroyed locks LCK.sessmem.locks 1270 1.35 Lock Operations LCK.sessmem.colls 0 0.00 Collisions LCK.wstat.creat 1 0.00 Created locks LCK.wstat.destroy 0 0.00 Destroyed locks LCK.wstat.locks 2858 3.03 Lock Operations LCK.wstat.colls 0 0.00 Collisions LCK.herder.creat 1 0.00 Created locks LCK.herder.destroy 0 0.00 Destroyed locks LCK.herder.locks 148 0.16 Lock Operations LCK.herder.colls 0 0.00 Collisions LCK.wq.creat 2 0.00 Created locks LCK.wq.destroy 0 0.00 Destroyed locks LCK.wq.locks 4200 4.45 Lock Operations LCK.wq.colls 0 0.00 Collisions LCK.objhdr.creat 119 0.13 Created locks LCK.objhdr.destroy 48 0.05 Destroyed locks LCK.objhdr.locks 1469 1.56 Lock Operations LCK.objhdr.colls 0 0.00 Collisions LCK.exp.creat 1 0.00 Created locks LCK.exp.destroy 0 0.00 Destroyed locks LCK.exp.locks 1072 1.14 Lock Operations LCK.exp.colls 0 0.00 Collisions LCK.lru.creat 2 0.00 Created locks LCK.lru.destroy 0 0.00 Destroyed locks LCK.lru.locks 98 0.10 Lock Operations LCK.lru.colls 0 0.00 Collisions LCK.cli.creat 1 0.00 Created locks LCK.cli.destroy 0 0.00 Destroyed locks LCK.cli.locks 327 0.35 Lock Operations LCK.cli.colls 0 0.00 Collisions LCK.ban.creat 1 0.00 Created locks LCK.ban.destroy 0 0.00 Destroyed locks LCK.ban.locks 1073 1.14 Lock Operations LCK.ban.colls 0 0.00 Collisions LCK.vbp.creat 1 0.00 Created locks LCK.vbp.destroy 0 0.00 Destroyed locks LCK.vbp.locks 0 0.00 Lock Operations LCK.vbp.colls 0 0.00 Collisions LCK.vbe.creat 1 0.00 Created locks LCK.vbe.destroy 0 0.00 Destroyed locks LCK.vbe.locks 1092 1.16 Lock Operations LCK.vbe.colls 0 0.00 Collisions LCK.backend.creat 1 0.00 Created locks LCK.backend.destroy 0 0.00 Destroyed locks LCK.backend.locks 1895 2.01 Lock Operations LCK.backend.colls 0 0.00 Collisions SMA.s0.c_req 172 0.18 Allocator requests SMA.s0.c_fail 0 0.00 Allocator failures SMA.s0.c_bytes 8694705 9210.49 Bytes allocated SMA.s0.c_freed 6874254 7282.05 Bytes freed SMA.s0.g_alloc 137 . Allocations outstanding SMA.s0.g_bytes 1820451 . Bytes outstanding SMA.s0.g_space 1071921373 . Bytes available SMA.Transient.c_req 1089 1.15 Allocator requests SMA.Transient.c_fail 0 0.00 Allocator failures SMA.Transient.c_bytes 64465868 68290.11 Bytes allocated SMA.Transient.c_freed 64465868 68290.11 Bytes freed SMA.Transient.g_alloc 0 . Allocations outstanding SMA.Transient.g_bytes 0 . Bytes outstanding SMA.Transient.g_space 0 . Bytes available VBE.default(127.0.0.1,,8081).vcls 1 . VCL references VBE.default(127.0.0.1,,8081).happy 0 . Happy health probes * * Thanks in advance. On Wed, Mar 28, 2012 at 3:45 AM, Stig Bakken wrote: > On Wed, Mar 28, 2012 at 1:31 AM, Zachary Alex Stern < > zacharyalexstern at gmail.com> wrote: > >> Hey there, >> >> We have a lot of websites (perhaps 15-20) running on apache, behind a >> varnish cache. >> >> One of our sites seems to experience random slowdowns when varnish is >> enabled. It will take between 5-20 seconds to load, fairly frequently. Our >> other sites all seem unaffected. >> >> When I disable varnish and have apache listen on port 80, the problem >> disappears entirely. >> >> Any thoughts? >> >> Here's our vcl.conf if it helps: http://pastebin.com/XPUvSPeu >> > > For this kind of problem, it is very useful if you post the output of > "varnishadm param.show" and "varnishstat -1" as well. > > - Stig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From perbu at varnish-software.com Wed Mar 28 20:04:11 2012 From: perbu at varnish-software.com (Per Buer) Date: Wed, 28 Mar 2012 22:04:11 +0200 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: On Wed, Mar 28, 2012 at 8:25 PM, James Light wrote: > What you asked was how to remove every *other* cookie *except* PHPSESSID. > > There is an example of how to do that on the varnish site here: > https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html > > Personally, I prefer a different way, which amounts to: > * extract the PHPSESSID into a different header > * unset the entire Cookie Header > * add back only the PHPSESSID as the Cookie header > Thats quite a neat way to do it. Could you send me the VCL for this? It might be a good example for the docs. The current example is rather horrid. -- Per Buer Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From zacharyalexstern at gmail.com Wed Mar 28 20:24:47 2012 From: zacharyalexstern at gmail.com (Zachary Alex Stern) Date: Wed, 28 Mar 2012 16:24:47 -0400 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: I believe I may have nailed it down to hanging on this request: 13 RxHeader c Connection: close 13 RxHeader c X-Forwarded-For: 10.176.37.167 13 VCL_call c recv lookup 13 VCL_call c hash 13 Hash c /network/4f161967582b94141a000001/get_file/4f61503f572b946e30000049/src 13 Hash c influencer.enternewmedia.com 13 VCL_return c hash 13 Hit c 1967773888 13 VCL_call c hit deliver 13 VCL_call c deliver deliver 13 TxProtocol c HTTP/1.1 13 TxStatus c 200 13 TxResponse c OK 13 TxHeader c Server: Apache/2.2.14 (Ubuntu) 13 TxHeader c X-Powered-By: PHP/5.3.2-1ubuntu4.14 13 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT 13 TxHeader c Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 13 TxHeader c Pragma: no-cache 13 TxHeader c Vary: Accept-Encoding 13 TxHeader c Content-Type: text/plain 13 TxHeader c Date: Wed, 28 Mar 2012 20:23:12 GMT 13 TxHeader c X-Varnish: 1967774712 1967773888 13 TxHeader c Age: 697 13 TxHeader c Via: 1.1 varnish 13 TxHeader c Connection: close 13 Gzip c U D - 1443 6338 80 80 11480 13 Length c 0 13 ReqEnd c 1967774712 1332966192.134290457 1332966192.134568691 0.000132561 0.000075102 0.000203133 13 SessionClose c EOF mode 13 StatSess c 10.176.37.133 12414 0 1 1 0 0 0 392 0 0 ExpKill - 1967774563 -11 0 CLI - Rd ping * * * * Any thoughts on next steps? On Wed, Mar 28, 2012 at 3:57 PM, Zachary Alex Stern < zacharyalexstern at gmail.com> wrote: > *Output of varnishadm param.show:* > > acceptor_sleep_decay 0.900000 [] > acceptor_sleep_incr 0.001000 [s] > acceptor_sleep_max 0.050000 [s] > auto_restart on [bool] > ban_dups on [bool] > ban_lurker_sleep 0.010000 [s] > between_bytes_timeout 60.000000 [s] > cc_command "exec gcc -std=gnu99 -g -O2 -pthread -fpic > -shared -Wl,-x -o %o %s" > cli_buffer 8192 [bytes] > cli_timeout 10 [seconds] > clock_skew 10 [s] > connect_timeout 0.700000 [s] > critbit_cooloff 180.000000 [s] > default_grace 10.000000 [seconds] > default_keep 0.000000 [seconds] > default_ttl 120.000000 [seconds] > diag_bitmap 0x0 [bitmap] > esi_syntax 0 [bitmap] > expiry_sleep 1.000000 [seconds] > fetch_chunksize 128 [kilobytes] > fetch_maxchunksize 262144 [kilobytes] > first_byte_timeout 60.000000 [s] > group nogroup (65534) > gzip_level 6 [] > gzip_memlevel 8 [] > gzip_stack_buffer 32768 [Bytes] > gzip_tmp_space 0 [] > gzip_window 15 [] > http_gzip_support on [bool] > http_max_hdr 64 [header lines] > http_range_support on [bool] > http_req_hdr_len 8192 [bytes] > http_req_size 32768 [bytes] > http_resp_hdr_len 8192 [bytes] > http_resp_size 32768 [bytes] > listen_address 0.0.0.0:80 > listen_depth 1024 [connections] > log_hashstring on [bool] > log_local_address off [bool] > lru_interval 2 [seconds] > max_esi_depth 5 [levels] > max_restarts 4 [restarts] > nuke_limit 50 [allocations] > ping_interval 3 [seconds] > pipe_timeout 60 [seconds] > prefer_ipv6 off [bool] > queue_max 100 [%] > rush_exponent 3 [requests per request] > saintmode_threshold 10 [objects] > send_timeout 60 [seconds] > sess_timeout 5 [seconds] > sess_workspace 65536 [bytes] > session_linger 50 [ms] > session_max 100000 [sessions] > shm_reclen 255 [bytes] > shm_workspace 8192 [bytes] > shortlived 10.000000 [s] > syslog_cli_traffic on [bool] > thread_pool_add_delay 2 [milliseconds] > thread_pool_add_threshold 2 [requests] > thread_pool_fail_delay 200 [milliseconds] > thread_pool_max 2048 [threads] > thread_pool_min 1 [threads] > thread_pool_purge_delay 1000 [milliseconds] > thread_pool_stack unlimited [bytes] > thread_pool_timeout 10 [seconds] > thread_pool_workspace 65536 [bytes] > thread_pools 2 [pools] > thread_stats_rate 10 [requests] > user nobody (65534) > vcc_err_unref on [bool] > vcl_dir /etc/varnish > vcl_trace off [bool] > vmod_dir /usr/lib/varnish/vmods > waiter default (epoll, poll) > * > * > *Output of varnishstat -1:* > > client_conn 1164 1.23 Client connections accepted > client_drop 0 0.00 Connection dropped, no sess/wrk > client_req 1164 1.23 Client requests received > cache_hit 524 0.56 Cache hits > cache_hitpass 0 0.00 Cache hits for pass > cache_miss 98 0.10 Cache misses > backend_conn 546 0.58 Backend conn. success > backend_unhealthy 0 0.00 Backend conn. not attempted > backend_busy 0 0.00 Backend conn. too many > backend_fail 0 0.00 Backend conn. failures > backend_reuse 94 0.10 Backend conn. reuses > backend_toolate 3 0.00 Backend conn. was closed > backend_recycle 97 0.10 Backend conn. recycles > backend_retry 0 0.00 Backend conn. retry > fetch_head 0 0.00 Fetch head > fetch_length 563 0.60 Fetch with Length > fetch_chunked 14 0.01 Fetch chunked > fetch_eof 0 0.00 Fetch EOF > fetch_bad 0 0.00 Fetch had bad headers > fetch_close 43 0.05 Fetch wanted close > fetch_oldhttp 0 0.00 Fetch pre HTTP/1.1 closed > fetch_zero 0 0.00 Fetch zero len > fetch_failed 0 0.00 Fetch failed > fetch_1xx 0 0.00 Fetch no body (1xx) > fetch_204 0 0.00 Fetch no body (204) > fetch_304 19 0.02 Fetch no body (304) > n_sess_mem 17 . N struct sess_mem > n_sess 0 . N struct sess > n_object 69 . N struct object > n_vampireobject 0 . N unresurrected objects > n_objectcore 71 . N struct objectcore > n_objecthead 71 . N struct objecthead > n_waitinglist 24 . N struct waitinglist > n_vbc 0 . N struct vbc > n_wrk 2 . N worker threads > n_wrk_create 24 0.03 N worker threads created > n_wrk_failed 0 0.00 N worker threads not created > n_wrk_max 33 0.03 N worker threads limited > n_wrk_lqueue 0 0.00 work request queue length > n_wrk_queued 152 0.16 N queued work requests > n_wrk_drop 0 0.00 N dropped work requests > n_backend 1 . N backends > n_expired 29 . N expired objects > n_lru_nuked 0 . N LRU nuked objects > n_lru_moved 458 . N LRU moved objects > losthdr 0 0.00 HTTP header overflows > n_objsendfile 0 0.00 Objects sent with sendfile > n_objwrite 1135 1.20 Objects sent with write > n_objoverflow 0 0.00 Objects overflowing workspace > s_sess 1164 1.23 Total Sessions > s_req 1164 1.23 Total Requests > s_pipe 0 0.00 Total pipe > s_pass 542 0.57 Total pass > s_fetch 639 0.68 Total fetch > s_hdrbytes 437246 463.18 Total header bytes > s_bodybytes 14474608 15333.27 Total body bytes > sess_closed 1164 1.23 Session Closed > sess_pipeline 0 0.00 Session Pipeline > sess_readahead 0 0.00 Session Read Ahead > sess_linger 0 0.00 Session Linger > sess_herd 0 0.00 Session herd > shm_records 85020 90.06 SHM records > shm_writes 6648 7.04 SHM writes > shm_flushes 0 0.00 SHM flushes due to overflow > shm_cont 8 0.01 SHM MTX contention > shm_cycles 0 0.00 SHM cycles through buffer > sms_nreq 1 0.00 SMS allocator requests > sms_nobj 0 . SMS outstanding allocations > sms_nbytes 0 . SMS outstanding bytes > sms_balloc 419 . SMS bytes allocated > sms_bfree 419 . SMS bytes freed > backend_req 640 0.68 Backend requests made > n_vcl 1 0.00 N vcl total > n_vcl_avail 1 0.00 N vcl available > n_vcl_discard 0 0.00 N vcl discarded > n_ban 1 . N total active bans > n_ban_add 1 0.00 N new bans added > n_ban_retire 0 0.00 N old bans deleted > n_ban_obj_test 0 0.00 N objects tested > n_ban_re_test 0 0.00 N regexps tested against > n_ban_dups 0 0.00 N duplicate bans removed > hcb_nolock 0 0.00 HCB Lookups without lock > hcb_lock 0 0.00 HCB Lookups with lock > hcb_insert 0 0.00 HCB Inserts > esi_errors 0 0.00 ESI parse errors (unlock) > esi_warnings 0 0.00 ESI parse warnings (unlock) > accept_fail 0 0.00 Accept failures > client_drop_late 0 0.00 Connection dropped late > uptime 944 1.00 Client uptime > dir_dns_lookups 0 0.00 DNS director lookups > dir_dns_failed 0 0.00 DNS director failed lookups > dir_dns_hit 0 0.00 DNS director cached lookups hit > dir_dns_cache_full 0 0.00 DNS director full dnscache > vmods 0 . Loaded VMODs > n_gzip 0 0.00 Gzip operations > n_gunzip 521 0.55 Gunzip operations > LCK.sms.creat 1 0.00 Created locks > LCK.sms.destroy 0 0.00 Destroyed locks > LCK.sms.locks 3 0.00 Lock Operations > LCK.sms.colls 0 0.00 Collisions > LCK.smp.creat 0 0.00 Created locks > LCK.smp.destroy 0 0.00 Destroyed locks > LCK.smp.locks 0 0.00 Lock Operations > LCK.smp.colls 0 0.00 Collisions > LCK.sma.creat 2 0.00 Created locks > LCK.sma.destroy 0 0.00 Destroyed locks > LCK.sma.locks 2922 3.10 Lock Operations > LCK.sma.colls 0 0.00 Collisions > LCK.smf.creat 0 0.00 Created locks > LCK.smf.destroy 0 0.00 Destroyed locks > LCK.smf.locks 0 0.00 Lock Operations > LCK.smf.colls 0 0.00 Collisions > LCK.hsl.creat 0 0.00 Created locks > LCK.hsl.destroy 0 0.00 Destroyed locks > LCK.hsl.locks 0 0.00 Lock Operations > LCK.hsl.colls 0 0.00 Collisions > LCK.hcb.creat 0 0.00 Created locks > LCK.hcb.destroy 0 0.00 Destroyed locks > LCK.hcb.locks 0 0.00 Lock Operations > LCK.hcb.colls 0 0.00 Collisions > LCK.hcl.creat 16383 17.35 Created locks > LCK.hcl.destroy 0 0.00 Destroyed locks > LCK.hcl.locks 1175 1.24 Lock Operations > LCK.hcl.colls 0 0.00 Collisions > LCK.vcl.creat 1 0.00 Created locks > LCK.vcl.destroy 0 0.00 Destroyed locks > LCK.vcl.locks 48 0.05 Lock Operations > LCK.vcl.colls 0 0.00 Collisions > LCK.stat.creat 1 0.00 Created locks > LCK.stat.destroy 0 0.00 Destroyed locks > LCK.stat.locks 17 0.02 Lock Operations > LCK.stat.colls 0 0.00 Collisions > LCK.sessmem.creat 1 0.00 Created locks > LCK.sessmem.destroy 0 0.00 Destroyed locks > LCK.sessmem.locks 1270 1.35 Lock Operations > LCK.sessmem.colls 0 0.00 Collisions > LCK.wstat.creat 1 0.00 Created locks > LCK.wstat.destroy 0 0.00 Destroyed locks > LCK.wstat.locks 2858 3.03 Lock Operations > LCK.wstat.colls 0 0.00 Collisions > LCK.herder.creat 1 0.00 Created locks > LCK.herder.destroy 0 0.00 Destroyed locks > LCK.herder.locks 148 0.16 Lock Operations > LCK.herder.colls 0 0.00 Collisions > LCK.wq.creat 2 0.00 Created locks > LCK.wq.destroy 0 0.00 Destroyed locks > LCK.wq.locks 4200 4.45 Lock Operations > LCK.wq.colls 0 0.00 Collisions > LCK.objhdr.creat 119 0.13 Created locks > LCK.objhdr.destroy 48 0.05 Destroyed locks > LCK.objhdr.locks 1469 1.56 Lock Operations > LCK.objhdr.colls 0 0.00 Collisions > LCK.exp.creat 1 0.00 Created locks > LCK.exp.destroy 0 0.00 Destroyed locks > LCK.exp.locks 1072 1.14 Lock Operations > LCK.exp.colls 0 0.00 Collisions > LCK.lru.creat 2 0.00 Created locks > LCK.lru.destroy 0 0.00 Destroyed locks > LCK.lru.locks 98 0.10 Lock Operations > LCK.lru.colls 0 0.00 Collisions > LCK.cli.creat 1 0.00 Created locks > LCK.cli.destroy 0 0.00 Destroyed locks > LCK.cli.locks 327 0.35 Lock Operations > LCK.cli.colls 0 0.00 Collisions > LCK.ban.creat 1 0.00 Created locks > LCK.ban.destroy 0 0.00 Destroyed locks > LCK.ban.locks 1073 1.14 Lock Operations > LCK.ban.colls 0 0.00 Collisions > LCK.vbp.creat 1 0.00 Created locks > LCK.vbp.destroy 0 0.00 Destroyed locks > LCK.vbp.locks 0 0.00 Lock Operations > LCK.vbp.colls 0 0.00 Collisions > LCK.vbe.creat 1 0.00 Created locks > LCK.vbe.destroy 0 0.00 Destroyed locks > LCK.vbe.locks 1092 1.16 Lock Operations > LCK.vbe.colls 0 0.00 Collisions > LCK.backend.creat 1 0.00 Created locks > LCK.backend.destroy 0 0.00 Destroyed locks > LCK.backend.locks 1895 2.01 Lock Operations > LCK.backend.colls 0 0.00 Collisions > SMA.s0.c_req 172 0.18 Allocator requests > SMA.s0.c_fail 0 0.00 Allocator failures > SMA.s0.c_bytes 8694705 9210.49 Bytes allocated > SMA.s0.c_freed 6874254 7282.05 Bytes freed > SMA.s0.g_alloc 137 . Allocations outstanding > SMA.s0.g_bytes 1820451 . Bytes outstanding > SMA.s0.g_space 1071921373 . Bytes available > SMA.Transient.c_req 1089 1.15 Allocator requests > SMA.Transient.c_fail 0 0.00 Allocator failures > SMA.Transient.c_bytes 64465868 68290.11 Bytes allocated > SMA.Transient.c_freed 64465868 68290.11 Bytes freed > SMA.Transient.g_alloc 0 . Allocations outstanding > SMA.Transient.g_bytes 0 . Bytes outstanding > SMA.Transient.g_space 0 . Bytes available > VBE.default(127.0.0.1,,8081).vcls 1 . VCL references > VBE.default(127.0.0.1,,8081).happy 0 . Happy health > probes > * > * > Thanks in advance. > > On Wed, Mar 28, 2012 at 3:45 AM, Stig Bakken wrote: > >> On Wed, Mar 28, 2012 at 1:31 AM, Zachary Alex Stern < >> zacharyalexstern at gmail.com> wrote: >> >>> Hey there, >>> >>> We have a lot of websites (perhaps 15-20) running on apache, behind a >>> varnish cache. >>> >>> One of our sites seems to experience random slowdowns when varnish is >>> enabled. It will take between 5-20 seconds to load, fairly frequently. Our >>> other sites all seem unaffected. >>> >>> When I disable varnish and have apache listen on port 80, the problem >>> disappears entirely. >>> >>> Any thoughts? >>> >>> Here's our vcl.conf if it helps: http://pastebin.com/XPUvSPeu >>> >> >> For this kind of problem, it is very useful if you post the output of >> "varnishadm param.show" and "varnishstat -1" as well. >> >> - Stig >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcpetit at syspark.com Wed Mar 28 20:34:53 2012 From: jcpetit at syspark.com (Jean-Christophe Petit) Date: Wed, 28 Mar 2012 16:34:53 -0400 Subject: Closing connection (similar to the Nginx 444 error) Message-ID: <4F7375ED.8030903@syspark.com> Hello everyone, would it be possible to close connections in the vcl_recv when a specific header is received ? Something like: if ( req.http.user-agent ~ "BAD-USER_AGENT" ) { set req.http.connection = "close"; } Nginx has this feature with the error code 444 Thank you, Jean-Christophe Petit From j.gareth.light at gmail.com Wed Mar 28 20:35:57 2012 From: j.gareth.light at gmail.com (James Light) Date: Wed, 28 Mar 2012 16:35:57 -0400 Subject: Fwd: question on the cookies and varnish In-Reply-To: References: Message-ID: On Wed, Mar 28, 2012 at 4:04 PM, Per Buer wrote: > On Wed, Mar 28, 2012 at 8:25 PM, James Light wrote: > >> What you asked was how to remove every *other* cookie *except* PHPSESSID. >> >> There is an example of how to do that on the varnish site here: >> https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html >> >> Personally, I prefer a different way, which amounts to: >> * extract the PHPSESSID into a different header >> * unset the entire Cookie Header >> * add back only the PHPSESSID as the Cookie header >> > > > Thats quite a neat way to do it. Could you send me the VCL for this? It > might be a good example for the docs. The current example is rather horrid. > > > -- > Per Buer > Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer > *Varnish makes websites fly!* > Whitepapers | Video | > Twitter > > > I've adapted this off the cuff from what I have internally currently where I'm working. I have not done extensive testing on this as it is simply an adaptation of what I actually do in our vcl code. Let me know any problems that I have overlooked. This attempts to match a PHPSESSID that is one or more ASCII alphanumeric character. I'm not a PHP developer, I just asked the PHP guy if I can always expect that the PHPSESSID will consist of only alphanumerics and he said yes it will. This will not work for a cookie that has a string that contains characters that are not ASCII alphanumerics. I'm not sure if rfc2616 has any restrictions on the Character Encoding for Cookies, so I can't guarantee that this will work in all cases and I currently don't have the time to look into the spec to make sure that what I'm giving doesn't totally suck. Basically, I'm just posting this here because you asked me to, I don't claim to be an expert in anything except persistence. --------8<-------- sub vcl_recv { # save the original cookie header so we can mangle it set req.http.X-Varnish-PHP_SID = req.http.Cookie; # using a capturing sub pattern, extract the continuous string of alphanumerics that immediately follows "PHPSESSID=" set req.http.X-Varnish-PHP_SID = regsuball(req.http.X-Varnish-PHP_SID, ";? ?PHPSESSID=([a-zA-Z0-9]+)( |;| ;).*","\1"); set req.http.Cookie = req.X-Varnish-PHP_SID; remove req.X-Varnish-PHP_SID; } --------8<-------- Hope this helps. -jlight -------------- next part -------------- An HTML attachment was scrubbed... URL: From zacharyalexstern at gmail.com Wed Mar 28 20:38:38 2012 From: zacharyalexstern at gmail.com (Zachary Alex Stern) Date: Wed, 28 Mar 2012 16:38:38 -0400 Subject: pass requests that take a long time Message-ID: Would it be possible to say, pass any request that takes more than two seconds to complete, rather than attempt to cache it? * * *-Zachary Alex Stern* * * *917.727.3456* *@zacharystern* *zacharyalexstern.com* -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Wed Mar 28 20:40:17 2012 From: roberto.fernandezcrisial at gmail.com (=?ISO-8859-1?Q?Roberto_O=2E_Fern=E1ndez_Crisial?=) Date: Wed, 28 Mar 2012 17:40:17 -0300 Subject: Closing connection (similar to the Nginx 444 error) In-Reply-To: <4F7375ED.8030903@syspark.com> References: <4F7375ED.8030903@syspark.com> Message-ID: Hi Jean-Christophe, I think you can use a mix: 1) in vcl_recv set an X-HTTP header and return error; 2) in vcl_error check if header has been set and return "444 error" and/with close connection. Roberto (a.k.a. @rofc) On Wed, Mar 28, 2012 at 5:34 PM, Jean-Christophe Petit wrote: > Hello everyone, > > would it be possible to close connections in the vcl_recv when a specific > header is received ? > Something like: > if ( req.http.user-agent ~ "BAD-USER_AGENT" ) { > set req.http.connection = "close"; > } > > Nginx has this feature with the error code 444 > > Thank you, > > Jean-Christophe Petit > > ______________________________**_________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/**lists/mailman/listinfo/**varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apriou at gmail.com Wed Mar 28 20:41:13 2012 From: apriou at gmail.com (Alexandre Priou) Date: Wed, 28 Mar 2012 22:41:13 +0200 Subject: question on the cookies and varnish In-Reply-To: References: Message-ID: i just said : thanks for your help ! but i speak chines somewhere next time , i try your help On Wed, Mar 28, 2012 at 10:35 PM, James Light wrote: > On Wed, Mar 28, 2012 at 4:04 PM, Per Buer wrote: > >> On Wed, Mar 28, 2012 at 8:25 PM, James Light wrote: >> >>> What you asked was how to remove every *other* cookie *except* PHPSESSID. >>> >>> There is an example of how to do that on the varnish site here: >>> https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html >>> >>> Personally, I prefer a different way, which amounts to: >>> * extract the PHPSESSID into a different header >>> * unset the entire Cookie Header >>> * add back only the PHPSESSID as the Cookie header >>> >> >> >> Thats quite a neat way to do it. Could you send me the VCL for this? It >> might be a good example for the docs. The current example is rather horrid. >> >> >> -- >> Per Buer >> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer >> *Varnish makes websites fly!* >> Whitepapers | Video | >> Twitter >> >> >> > I've adapted this off the cuff from what I have internally currently where > I'm working. I have not done extensive testing on this as it is simply an > adaptation of what I actually do in our vcl code. Let me know any problems > that I have overlooked. > > This attempts to match a PHPSESSID that is one or more ASCII alphanumeric > character. I'm not a PHP developer, I just asked the PHP guy if I can > always expect that the PHPSESSID will consist of only alphanumerics and he > said yes it will. > > This will not work for a cookie that has a string that contains characters > that are not ASCII alphanumerics. I'm not sure if rfc2616 has any > restrictions on the Character Encoding for Cookies, so I can't guarantee > that this will work in all cases and I currently don't have the time to > look into the spec to make sure that what I'm giving doesn't totally suck. > > Basically, I'm just posting this here because you asked me to, I don't > claim to be an expert in anything except persistence. > > --------8<-------- > sub vcl_recv { > > # save the original cookie header so we can mangle it > set req.http.X-Varnish-PHP_SID = req.http.Cookie; > > # using a capturing sub pattern, extract the continuous string of > alphanumerics that immediately follows "PHPSESSID=" > set req.http.X-Varnish-PHP_SID = > regsuball(req.http.X-Varnish-PHP_SID, ";? ?PHPSESSID=([a-zA-Z0-9]+)( |;| > ;).*","\1"); > > set req.http.Cookie = req.X-Varnish-PHP_SID; > > remove req.X-Varnish-PHP_SID; > > } > --------8<-------- > > Hope this helps. > -jlight > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Alexandre Priou Analyste Concepteur Web 64 rue de l'Essonne 91000 ?vry tel_perso : 06.14.83.81.03 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cosimo at streppone.it Wed Mar 28 20:48:20 2012 From: cosimo at streppone.it (Cosimo Streppone) Date: Wed, 28 Mar 2012 22:48:20 +0200 Subject: Closing connection (similar to the Nginx 444 error) In-Reply-To: <4F7375ED.8030903@syspark.com> References: <4F7375ED.8030903@syspark.com> Message-ID: On Wed, 28 Mar 2012 22:34:53 +0200, Jean-Christophe Petit wrote: > would it be possible to close connections in the vcl_recv when a > specific header is received ? > [...] > Nginx has this feature with the error code 444 I think this is what you're looking for: https://github.com/varnish/libvmod-shield -- Cosimo From jcpetit at syspark.com Wed Mar 28 20:56:21 2012 From: jcpetit at syspark.com (Jean-Christophe Petit) Date: Wed, 28 Mar 2012 16:56:21 -0400 Subject: Closing connection (similar to the Nginx 444 error) In-Reply-To: References: <4F7375ED.8030903@syspark.com> Message-ID: <4F737AF5.5080504@syspark.com> Thank you Cosimo, we are still on varnish-2.1.x, I'll look into it if we can change it or move to varnish-3.0.x Have a good day, Jean-Christophe > On Wed, 28 Mar 2012 22:34:53 +0200, Jean-Christophe Petit > wrote: > >> would it be possible to close connections in the vcl_recv when a >> specific header is received ? >> [...] >> Nginx has this feature with the error code 444 > > I think this is what you're looking for: > > https://github.com/varnish/libvmod-shield > -- Jean-Christophe Petit VP R&D et DSI GROUPE SYSPARK The Power of Internet Engineering / La Force du G?nie Internet 606 Cathcart, Suite 510 Montreal, Quebec H3B 1K9 - CANADA T: 1 514 875 8755 C: 1 514 575 5560 F: 1 514 875 8775 ------------------------------------------------------------------- Le contenu de ce courriel est confidentiel et ? l'intention du (des) destinataire(s) seulement. Si vous recevez cette transmission par erreur, veuillez m'aviser imm?diatement par t?l?phone en utilisant le num?ro ci-haut (? frais vir?s si n?cessaire). Veuillez effacer ou d?truire toutes copies de ce courriel re?ues. Merci. The information contained in this email is confidential information intended only for the addressee(s). If you have received this communication in error, please immediately notify me by telephone at the above noted number (collect if necessary) and delete or destroy any copies of it. Thank you From stig at zedge.net Thu Mar 29 07:31:16 2012 From: stig at zedge.net (Stig Bakken) Date: Thu, 29 Mar 2012 09:31:16 +0200 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: >From your varnishstat output I see that your "n_wrk_max" is > 0, which means varnish had problems creating threads at some point. I would try increasing thread_pool_min to for example 100 (threads are cheap). n_wrk_max should be 0. - Stig On Wed, Mar 28, 2012 at 10:24 PM, Zachary Alex Stern < zacharyalexstern at gmail.com> wrote: > I believe I may have nailed it down to hanging on this request: > > 13 RxHeader c Connection: close > 13 RxHeader c X-Forwarded-For: 10.176.37.167 > 13 VCL_call c recv lookup > 13 VCL_call c hash > 13 Hash c > /network/4f161967582b94141a000001/get_file/4f61503f572b946e30000049/src > 13 Hash c influencer.enternewmedia.com > 13 VCL_return c hash > 13 Hit c 1967773888 > 13 VCL_call c hit deliver > 13 VCL_call c deliver deliver > 13 TxProtocol c HTTP/1.1 > 13 TxStatus c 200 > 13 TxResponse c OK > 13 TxHeader c Server: Apache/2.2.14 (Ubuntu) > 13 TxHeader c X-Powered-By: PHP/5.3.2-1ubuntu4.14 > 13 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT > 13 TxHeader c Cache-Control: no-store, no-cache, must-revalidate, > post-check=0, pre-check=0 > 13 TxHeader c Pragma: no-cache > 13 TxHeader c Vary: Accept-Encoding > 13 TxHeader c Content-Type: text/plain > 13 TxHeader c Date: Wed, 28 Mar 2012 20:23:12 GMT > 13 TxHeader c X-Varnish: 1967774712 1967773888 > 13 TxHeader c Age: 697 > 13 TxHeader c Via: 1.1 varnish > 13 TxHeader c Connection: close > 13 Gzip c U D - 1443 6338 80 80 11480 > 13 Length c 0 > 13 ReqEnd c 1967774712 1332966192.134290457 1332966192.134568691 > 0.000132561 0.000075102 0.000203133 > 13 SessionClose c EOF mode > 13 StatSess c 10.176.37.133 12414 0 1 1 0 0 0 392 0 > 0 ExpKill - 1967774563 -11 > 0 CLI - Rd ping > * > * > * > * > Any thoughts on next steps? > > > > On Wed, Mar 28, 2012 at 3:57 PM, Zachary Alex Stern < > zacharyalexstern at gmail.com> wrote: > >> *Output of varnishadm param.show:* >> >> acceptor_sleep_decay 0.900000 [] >> acceptor_sleep_incr 0.001000 [s] >> acceptor_sleep_max 0.050000 [s] >> auto_restart on [bool] >> ban_dups on [bool] >> ban_lurker_sleep 0.010000 [s] >> between_bytes_timeout 60.000000 [s] >> cc_command "exec gcc -std=gnu99 -g -O2 -pthread -fpic >> -shared -Wl,-x -o %o %s" >> cli_buffer 8192 [bytes] >> cli_timeout 10 [seconds] >> clock_skew 10 [s] >> connect_timeout 0.700000 [s] >> critbit_cooloff 180.000000 [s] >> default_grace 10.000000 [seconds] >> default_keep 0.000000 [seconds] >> default_ttl 120.000000 [seconds] >> diag_bitmap 0x0 [bitmap] >> esi_syntax 0 [bitmap] >> expiry_sleep 1.000000 [seconds] >> fetch_chunksize 128 [kilobytes] >> fetch_maxchunksize 262144 [kilobytes] >> first_byte_timeout 60.000000 [s] >> group nogroup (65534) >> gzip_level 6 [] >> gzip_memlevel 8 [] >> gzip_stack_buffer 32768 [Bytes] >> gzip_tmp_space 0 [] >> gzip_window 15 [] >> http_gzip_support on [bool] >> http_max_hdr 64 [header lines] >> http_range_support on [bool] >> http_req_hdr_len 8192 [bytes] >> http_req_size 32768 [bytes] >> http_resp_hdr_len 8192 [bytes] >> http_resp_size 32768 [bytes] >> listen_address 0.0.0.0:80 >> listen_depth 1024 [connections] >> log_hashstring on [bool] >> log_local_address off [bool] >> lru_interval 2 [seconds] >> max_esi_depth 5 [levels] >> max_restarts 4 [restarts] >> nuke_limit 50 [allocations] >> ping_interval 3 [seconds] >> pipe_timeout 60 [seconds] >> prefer_ipv6 off [bool] >> queue_max 100 [%] >> rush_exponent 3 [requests per request] >> saintmode_threshold 10 [objects] >> send_timeout 60 [seconds] >> sess_timeout 5 [seconds] >> sess_workspace 65536 [bytes] >> session_linger 50 [ms] >> session_max 100000 [sessions] >> shm_reclen 255 [bytes] >> shm_workspace 8192 [bytes] >> shortlived 10.000000 [s] >> syslog_cli_traffic on [bool] >> thread_pool_add_delay 2 [milliseconds] >> thread_pool_add_threshold 2 [requests] >> thread_pool_fail_delay 200 [milliseconds] >> thread_pool_max 2048 [threads] >> thread_pool_min 1 [threads] >> thread_pool_purge_delay 1000 [milliseconds] >> thread_pool_stack unlimited [bytes] >> thread_pool_timeout 10 [seconds] >> thread_pool_workspace 65536 [bytes] >> thread_pools 2 [pools] >> thread_stats_rate 10 [requests] >> user nobody (65534) >> vcc_err_unref on [bool] >> vcl_dir /etc/varnish >> vcl_trace off [bool] >> vmod_dir /usr/lib/varnish/vmods >> waiter default (epoll, poll) >> * >> * >> *Output of varnishstat -1:* >> >> client_conn 1164 1.23 Client connections accepted >> client_drop 0 0.00 Connection dropped, no >> sess/wrk >> client_req 1164 1.23 Client requests received >> cache_hit 524 0.56 Cache hits >> cache_hitpass 0 0.00 Cache hits for pass >> cache_miss 98 0.10 Cache misses >> backend_conn 546 0.58 Backend conn. success >> backend_unhealthy 0 0.00 Backend conn. not attempted >> backend_busy 0 0.00 Backend conn. too many >> backend_fail 0 0.00 Backend conn. failures >> backend_reuse 94 0.10 Backend conn. reuses >> backend_toolate 3 0.00 Backend conn. was closed >> backend_recycle 97 0.10 Backend conn. recycles >> backend_retry 0 0.00 Backend conn. retry >> fetch_head 0 0.00 Fetch head >> fetch_length 563 0.60 Fetch with Length >> fetch_chunked 14 0.01 Fetch chunked >> fetch_eof 0 0.00 Fetch EOF >> fetch_bad 0 0.00 Fetch had bad headers >> fetch_close 43 0.05 Fetch wanted close >> fetch_oldhttp 0 0.00 Fetch pre HTTP/1.1 closed >> fetch_zero 0 0.00 Fetch zero len >> fetch_failed 0 0.00 Fetch failed >> fetch_1xx 0 0.00 Fetch no body (1xx) >> fetch_204 0 0.00 Fetch no body (204) >> fetch_304 19 0.02 Fetch no body (304) >> n_sess_mem 17 . N struct sess_mem >> n_sess 0 . N struct sess >> n_object 69 . N struct object >> n_vampireobject 0 . N unresurrected objects >> n_objectcore 71 . N struct objectcore >> n_objecthead 71 . N struct objecthead >> n_waitinglist 24 . N struct waitinglist >> n_vbc 0 . N struct vbc >> n_wrk 2 . N worker threads >> n_wrk_create 24 0.03 N worker threads created >> n_wrk_failed 0 0.00 N worker threads not created >> n_wrk_max 33 0.03 N worker threads limited >> n_wrk_lqueue 0 0.00 work request queue length >> n_wrk_queued 152 0.16 N queued work requests >> n_wrk_drop 0 0.00 N dropped work requests >> n_backend 1 . N backends >> n_expired 29 . N expired objects >> n_lru_nuked 0 . N LRU nuked objects >> n_lru_moved 458 . N LRU moved objects >> losthdr 0 0.00 HTTP header overflows >> n_objsendfile 0 0.00 Objects sent with sendfile >> n_objwrite 1135 1.20 Objects sent with write >> n_objoverflow 0 0.00 Objects overflowing workspace >> s_sess 1164 1.23 Total Sessions >> s_req 1164 1.23 Total Requests >> s_pipe 0 0.00 Total pipe >> s_pass 542 0.57 Total pass >> s_fetch 639 0.68 Total fetch >> s_hdrbytes 437246 463.18 Total header bytes >> s_bodybytes 14474608 15333.27 Total body bytes >> sess_closed 1164 1.23 Session Closed >> sess_pipeline 0 0.00 Session Pipeline >> sess_readahead 0 0.00 Session Read Ahead >> sess_linger 0 0.00 Session Linger >> sess_herd 0 0.00 Session herd >> shm_records 85020 90.06 SHM records >> shm_writes 6648 7.04 SHM writes >> shm_flushes 0 0.00 SHM flushes due to overflow >> shm_cont 8 0.01 SHM MTX contention >> shm_cycles 0 0.00 SHM cycles through buffer >> sms_nreq 1 0.00 SMS allocator requests >> sms_nobj 0 . SMS outstanding allocations >> sms_nbytes 0 . SMS outstanding bytes >> sms_balloc 419 . SMS bytes allocated >> sms_bfree 419 . SMS bytes freed >> backend_req 640 0.68 Backend requests made >> n_vcl 1 0.00 N vcl total >> n_vcl_avail 1 0.00 N vcl available >> n_vcl_discard 0 0.00 N vcl discarded >> n_ban 1 . N total active bans >> n_ban_add 1 0.00 N new bans added >> n_ban_retire 0 0.00 N old bans deleted >> n_ban_obj_test 0 0.00 N objects tested >> n_ban_re_test 0 0.00 N regexps tested against >> n_ban_dups 0 0.00 N duplicate bans removed >> hcb_nolock 0 0.00 HCB Lookups without lock >> hcb_lock 0 0.00 HCB Lookups with lock >> hcb_insert 0 0.00 HCB Inserts >> esi_errors 0 0.00 ESI parse errors (unlock) >> esi_warnings 0 0.00 ESI parse warnings (unlock) >> accept_fail 0 0.00 Accept failures >> client_drop_late 0 0.00 Connection dropped late >> uptime 944 1.00 Client uptime >> dir_dns_lookups 0 0.00 DNS director lookups >> dir_dns_failed 0 0.00 DNS director failed lookups >> dir_dns_hit 0 0.00 DNS director cached lookups >> hit >> dir_dns_cache_full 0 0.00 DNS director full dnscache >> vmods 0 . Loaded VMODs >> n_gzip 0 0.00 Gzip operations >> n_gunzip 521 0.55 Gunzip operations >> LCK.sms.creat 1 0.00 Created locks >> LCK.sms.destroy 0 0.00 Destroyed locks >> LCK.sms.locks 3 0.00 Lock Operations >> LCK.sms.colls 0 0.00 Collisions >> LCK.smp.creat 0 0.00 Created locks >> LCK.smp.destroy 0 0.00 Destroyed locks >> LCK.smp.locks 0 0.00 Lock Operations >> LCK.smp.colls 0 0.00 Collisions >> LCK.sma.creat 2 0.00 Created locks >> LCK.sma.destroy 0 0.00 Destroyed locks >> LCK.sma.locks 2922 3.10 Lock Operations >> LCK.sma.colls 0 0.00 Collisions >> LCK.smf.creat 0 0.00 Created locks >> LCK.smf.destroy 0 0.00 Destroyed locks >> LCK.smf.locks 0 0.00 Lock Operations >> LCK.smf.colls 0 0.00 Collisions >> LCK.hsl.creat 0 0.00 Created locks >> LCK.hsl.destroy 0 0.00 Destroyed locks >> LCK.hsl.locks 0 0.00 Lock Operations >> LCK.hsl.colls 0 0.00 Collisions >> LCK.hcb.creat 0 0.00 Created locks >> LCK.hcb.destroy 0 0.00 Destroyed locks >> LCK.hcb.locks 0 0.00 Lock Operations >> LCK.hcb.colls 0 0.00 Collisions >> LCK.hcl.creat 16383 17.35 Created locks >> LCK.hcl.destroy 0 0.00 Destroyed locks >> LCK.hcl.locks 1175 1.24 Lock Operations >> LCK.hcl.colls 0 0.00 Collisions >> LCK.vcl.creat 1 0.00 Created locks >> LCK.vcl.destroy 0 0.00 Destroyed locks >> LCK.vcl.locks 48 0.05 Lock Operations >> LCK.vcl.colls 0 0.00 Collisions >> LCK.stat.creat 1 0.00 Created locks >> LCK.stat.destroy 0 0.00 Destroyed locks >> LCK.stat.locks 17 0.02 Lock Operations >> LCK.stat.colls 0 0.00 Collisions >> LCK.sessmem.creat 1 0.00 Created locks >> LCK.sessmem.destroy 0 0.00 Destroyed locks >> LCK.sessmem.locks 1270 1.35 Lock Operations >> LCK.sessmem.colls 0 0.00 Collisions >> LCK.wstat.creat 1 0.00 Created locks >> LCK.wstat.destroy 0 0.00 Destroyed locks >> LCK.wstat.locks 2858 3.03 Lock Operations >> LCK.wstat.colls 0 0.00 Collisions >> LCK.herder.creat 1 0.00 Created locks >> LCK.herder.destroy 0 0.00 Destroyed locks >> LCK.herder.locks 148 0.16 Lock Operations >> LCK.herder.colls 0 0.00 Collisions >> LCK.wq.creat 2 0.00 Created locks >> LCK.wq.destroy 0 0.00 Destroyed locks >> LCK.wq.locks 4200 4.45 Lock Operations >> LCK.wq.colls 0 0.00 Collisions >> LCK.objhdr.creat 119 0.13 Created locks >> LCK.objhdr.destroy 48 0.05 Destroyed locks >> LCK.objhdr.locks 1469 1.56 Lock Operations >> LCK.objhdr.colls 0 0.00 Collisions >> LCK.exp.creat 1 0.00 Created locks >> LCK.exp.destroy 0 0.00 Destroyed locks >> LCK.exp.locks 1072 1.14 Lock Operations >> LCK.exp.colls 0 0.00 Collisions >> LCK.lru.creat 2 0.00 Created locks >> LCK.lru.destroy 0 0.00 Destroyed locks >> LCK.lru.locks 98 0.10 Lock Operations >> LCK.lru.colls 0 0.00 Collisions >> LCK.cli.creat 1 0.00 Created locks >> LCK.cli.destroy 0 0.00 Destroyed locks >> LCK.cli.locks 327 0.35 Lock Operations >> LCK.cli.colls 0 0.00 Collisions >> LCK.ban.creat 1 0.00 Created locks >> LCK.ban.destroy 0 0.00 Destroyed locks >> LCK.ban.locks 1073 1.14 Lock Operations >> LCK.ban.colls 0 0.00 Collisions >> LCK.vbp.creat 1 0.00 Created locks >> LCK.vbp.destroy 0 0.00 Destroyed locks >> LCK.vbp.locks 0 0.00 Lock Operations >> LCK.vbp.colls 0 0.00 Collisions >> LCK.vbe.creat 1 0.00 Created locks >> LCK.vbe.destroy 0 0.00 Destroyed locks >> LCK.vbe.locks 1092 1.16 Lock Operations >> LCK.vbe.colls 0 0.00 Collisions >> LCK.backend.creat 1 0.00 Created locks >> LCK.backend.destroy 0 0.00 Destroyed locks >> LCK.backend.locks 1895 2.01 Lock Operations >> LCK.backend.colls 0 0.00 Collisions >> SMA.s0.c_req 172 0.18 Allocator requests >> SMA.s0.c_fail 0 0.00 Allocator failures >> SMA.s0.c_bytes 8694705 9210.49 Bytes allocated >> SMA.s0.c_freed 6874254 7282.05 Bytes freed >> SMA.s0.g_alloc 137 . Allocations outstanding >> SMA.s0.g_bytes 1820451 . Bytes outstanding >> SMA.s0.g_space 1071921373 . Bytes available >> SMA.Transient.c_req 1089 1.15 Allocator requests >> SMA.Transient.c_fail 0 0.00 Allocator failures >> SMA.Transient.c_bytes 64465868 68290.11 Bytes allocated >> SMA.Transient.c_freed 64465868 68290.11 Bytes freed >> SMA.Transient.g_alloc 0 . Allocations outstanding >> SMA.Transient.g_bytes 0 . Bytes outstanding >> SMA.Transient.g_space 0 . Bytes available >> VBE.default(127.0.0.1,,8081).vcls 1 . VCL references >> VBE.default(127.0.0.1,,8081).happy 0 . Happy health >> probes >> * >> * >> Thanks in advance. >> >> On Wed, Mar 28, 2012 at 3:45 AM, Stig Bakken wrote: >> >>> On Wed, Mar 28, 2012 at 1:31 AM, Zachary Alex Stern < >>> zacharyalexstern at gmail.com> wrote: >>> >>>> Hey there, >>>> >>>> We have a lot of websites (perhaps 15-20) running on apache, behind a >>>> varnish cache. >>>> >>>> One of our sites seems to experience random slowdowns when varnish is >>>> enabled. It will take between 5-20 seconds to load, fairly frequently. Our >>>> other sites all seem unaffected. >>>> >>>> When I disable varnish and have apache listen on port 80, the problem >>>> disappears entirely. >>>> >>>> Any thoughts? >>>> >>>> Here's our vcl.conf if it helps: http://pastebin.com/XPUvSPeu >>>> >>> >>> For this kind of problem, it is very useful if you post the output of >>> "varnishadm param.show" and "varnishstat -1" as well. >>> >>> - Stig >>> >>> >> > -- Stig Bakken CTO, Zedge.net - free your phone! -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Thu Mar 29 07:40:51 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Thu, 29 Mar 2012 09:40:51 +0200 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: <20120329074050.GS12685@nerd.dk> On Wed, Mar 28, 2012 at 04:24:47PM -0400, Zachary Alex Stern wrote: > I believe I may have nailed it down to hanging on this request: I don't think so. > 13 ReqEnd c 1967774712 1332966192.134290457 1332966192.134568691 0.000132561 0.000075102 0.000203133 This request was delivered in less than a ms, so nothing in this varnishlog snippet shows any slowness. > Any thoughts on next steps? You're still on step one: Identify the slow request in varnishlog. -- Andreas From nbubingo at gmail.com Thu Mar 29 13:55:38 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Thu, 29 Mar 2012 21:55:38 +0800 Subject: about the response content-length with ESI page in the log Message-ID: Hello, I don't know if it's a bug. We use the ESI page in our site. I saw the varnishncsa.log was like this: 127.0.0.1 - - [29/Mar/2012:21:44:23 +0800] "GET http://item.taobao.com/item.htm?id=14590083648&initiative_id=staobaoz_20120329 HTTP/1.0" 200 272 "http://s.taobao.com/search?q=Streak+Pro+D43+&initiative_id=staobaoz_20120329&atype=b&filterFineness=2&bcoffset=1&sort=sale-desc" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3" 127.0.0.1 - - [29/Mar/2012:21:44:23 +0800] "GET http://item.taobao.com/item.htm?id=12717866317&_u=t63tnnube5f&initiative_id=cartz_20120329 HTTP/1.0" 200 313 "http://s.taobao.com/search?q=%B3%C1%CF%E3%CA%D6%B4%AE108&initiative_id=cartz_20120329&commend=all&ssid=s5-e&s=80" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; 360SE)" The main page includes an tiny subpage about 200bytes. The main page is about 100k. In the ncsa log, It just displayed the subpage content-length, not the main page length or the merged page length. It confused me a little a the first glance. From kim at heldig.org Thu Mar 29 18:33:14 2012 From: kim at heldig.org (Kim Eik) Date: Thu, 29 Mar 2012 20:33:14 +0200 Subject: Significance of hash_data and the rest of the vcl ecosystem. Message-ID: Im trying to figure out the varnish config, and what the ramifications of the different config options are. as far as i can figure out the hash_data will append information to the hash so that we can create a greater granularity in our cache. One example might be to create a separate cache for each different user identified by JSESSIONID. However, are other commands like ban() affected by the hash_data? so if i were to ban_url(/some/url) would it only ban /some/url for the JSESSIONID hash it was operating under or would it affect all requests against /some/url regardless? From fatblowfish at gmail.com Thu Mar 29 22:34:30 2012 From: fatblowfish at gmail.com (fatblowfish) Date: Fri, 30 Mar 2012 11:34:30 +1300 Subject: Set beresp.ttl based on Cache Control header Message-ID: Hi, I'm pretty much a Varnish 3 newb... Would it be a good idea to set the beresp.ttl for a specific url based on the cache control header, if present and set public? What can be the tradeoff for doing that? Any hints/examples are appreciated too. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Thu Mar 29 22:43:58 2012 From: roberto.fernandezcrisial at gmail.com (=?ISO-8859-1?Q?Roberto_O=2E_Fern=E1ndez_Crisial?=) Date: Thu, 29 Mar 2012 19:43:58 -0300 Subject: Set beresp.ttl based on Cache Control header In-Reply-To: References: Message-ID: Hi fatblowfish (?), Maybe you should try with something like: if req.url ~ REGEX ( set beresp.ttl == TIME) On vcl_fetch subrutine. All the best, Roberto (a.k.a. @rofc) On Thu, Mar 29, 2012 at 7:34 PM, fatblowfish wrote: > Hi, > > I'm pretty much a Varnish 3 newb... > > Would it be a good idea to set the beresp.ttl for a specific url based on > the cache control header, if present and set public? What can be the > tradeoff for doing that? > > Any hints/examples are appreciated too. > > Thanks! > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfheen at varnish-software.com Fri Mar 30 07:22:39 2012 From: tfheen at varnish-software.com (Tollef Fog Heen) Date: Fri, 30 Mar 2012 09:22:39 +0200 Subject: Significance of hash_data and the rest of the vcl ecosystem. In-Reply-To: References: Message-ID: <20120330072239.GA13911@err.no> ]] Kim Eik > However, are other commands like ban() affected by the hash_data? > > so if i were to ban_url(/some/url) would it only ban /some/url for the > JSESSIONID hash it was operating under or would it affect all requests > against /some/url regardless? No, ban_url(x) is just shorthand for ban("req.url ~ " + x). That only looks at the value of req.url, not any other variables. -- Tollef Fog Heen Technical lead, Varnish Software t: +47 21 98 92 64 From tfheen at varnish-software.com Fri Mar 30 07:23:37 2012 From: tfheen at varnish-software.com (Tollef Fog Heen) Date: Fri, 30 Mar 2012 09:23:37 +0200 Subject: about the response content-length with ESI page in the log In-Reply-To: References: Message-ID: <20120330072337.GB13911@err.no> ]] ??? > The main page includes an tiny subpage about 200bytes. The main page > is about 100k. In the ncsa log, It just displayed the subpage > content-length, not the main page length or the merged page length. It > confused me a little a the first glance. Yes, varnishncsa in 3.0 gets a bit confused when seeing ESI requests. This will hopefully be fixed in the next version. -- Tollef Fog Heen Technical lead, Varnish Software t: +47 21 98 92 64 From p.streise at allbase.de Thu Mar 8 08:53:59 2012 From: p.streise at allbase.de (Paul Streise) Date: Thu, 08 Mar 2012 08:53:59 -0000 Subject: Example for varnishreplay + varnishlog Message-ID: <001701ccfd08$fca13210$f5e39630$@allbase.de> Hello, i want to warm up my varnish cache. Have anyone an example how to use varnishreplay + varnishlog? Regards Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From savetheinterpod at gmail.com Fri Mar 23 07:01:54 2012 From: savetheinterpod at gmail.com (Michael Save) Date: Fri, 23 Mar 2012 18:01:54 +1100 Subject: User-defined variables: why not? Message-ID: Hi, In VCL, the fact that you can't create your own variables at runtime can sometimes be a limitation when writing very complicated configs. You have to use the variables Varnish already has defined for you; that is, resp.*, etc. You can of course use HTTP headers as temporary variables, but that seems like a hack to me. My question is: why doesn't VCL let you do custom variables? If I'm not mistaking, a .vcl file is just an easy-to-read and easy-to-code version of a C script (.vcl is compiled as .c at runtime), and it's not too hard to create variables in C. Are user-defined variables ever going to appear in VCL, or is that out of the scope of the Varnish Cache project (if so, why)? Thanks, Michael From kunmi at shebafoods.com Fri Mar 23 23:48:13 2012 From: kunmi at shebafoods.com (Kunmi Sheba Foods) Date: Fri, 23 Mar 2012 19:48:13 -0400 Subject: Newbie: How do I install Varnish? Message-ID: <21b1db95$3071aea3$1e9d905c$@com> Hello everyone, Can someone please share answers to my questions: 1. I am using regular linux and downloaded Varnish Cache 3.0.2 varnish-3.0.2.tar where do I put the files? 2. I read here https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-p ackages to run commands, but don't know where am to be to run the backups. - should I be in one of the folders in the tar file above to run the commands? 3. What messages should I see to confirm that Varnish is properly installed? 4. Please share any other pertinent information. If you are in the U.S. and can call to walk me through the steps. Please call me on 770.982.1000. Thanks for your attention. Kunmi -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcd at daviesinc.com Wed Mar 28 21:06:18 2012 From: mcd at daviesinc.com (Chris Davies) Date: Wed, 28 Mar 2012 17:06:18 -0400 Subject: varnish *slowing* down site, any ideas? In-Reply-To: References: Message-ID: <91D0E9B2-20EA-4BE2-B1AA-2A1A93EF5487@daviesinc.com> On Mar 28, 2012, at 4:24 PM, Zachary Alex Stern wrote: > 13 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT love your programmers sense of humor. > 13 TxHeader c Content-Type: text/plain Is this content-type right? It is possible that the browser may be trying to figure out what to do with the response. You're also overriding your expire in your VCL - this may be intentional. Since it is pulled right from varnish, it seems odd that this would be it. Does wget or apachebench lag on that particular request? Are you able to duplicate it in other browsers? From shib4u at gmail.com Fri Mar 30 07:50:19 2012 From: shib4u at gmail.com (Shibashish) Date: Fri, 30 Mar 2012 13:20:19 +0530 Subject: Newbie: How do I install Varnish? In-Reply-To: <21b1db95$3071aea3$1e9d905c$@com> References: <21b1db95$3071aea3$1e9d905c$@com> Message-ID: On Sat, Mar 24, 2012 at 5:18 AM, Kunmi Sheba Foods wrote: > Hello everyone, > > Can someone please share answers to my questions: > > 1. I am using regular linux and downloaded Varnish Cache > 3.0.2 varnish-3.0.2.tar > where do I put the files? > > 2. I read here > https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-packages to > run commands, but don't know where am to be to run the backups. > - should I be in one of the folders in the tar file above to run the > commands? > > 3. What messages should I see to confirm that Varnish is properly > installed? > > 4. Please share any other pertinent information. > > If you are in the U.S. and can call to walk me through the steps. Please > call me on 770.982.1000. > > Thanks for your attention. > > Kunmi > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc Rookie admins... damn... 1. Please specify as "I am using linux centos 5.8.6, perl version 5.8.8, Kernel version 2.6.18." 2. Read https://www.varnish-cache.org/installation/redhat 3. Learn yum http://www.centos.org/docs/5/html/yum/ 4. Google is your friend. Do not expect spoon feeding from the group. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.gareth.light at gmail.com Fri Mar 30 07:59:44 2012 From: j.gareth.light at gmail.com (James Light) Date: Fri, 30 Mar 2012 03:59:44 -0400 Subject: User-defined variables: why not? In-Reply-To: References: Message-ID: On Mar 30, 2012 3:27 AM, "Michael Save" wrote: > > Hi, > > In VCL, the fact that you can't create your own variables at runtime > can sometimes be a limitation when writing very complicated configs. > You have to use the variables Varnish already has defined for you; > that is, resp.*, etc. You can of course use HTTP headers as temporary > variables, but that seems like a hack to me. > > My question is: why doesn't VCL let you do custom variables? If I'm > not mistaking, a .vcl file is just an easy-to-read and easy-to-code > version of a C script (.vcl is compiled as .c at runtime), and it's > not too hard to create variables in C. Are user-defined variables ever > going to appear in VCL, or is that out of the scope of the Varnish > Cache project (if so, why)? > > Thanks, > Michael > > _______________________________________________ You may find this helpful: https://github.com/varnish/libvmod-var -------------- next part -------------- An HTML attachment was scrubbed... URL: From jc.bedier at gmail.com Fri Mar 30 08:07:56 2012 From: jc.bedier at gmail.com (Jean-Christian BEDIER) Date: Fri, 30 Mar 2012 10:07:56 +0200 Subject: Newbie: How do I install Varnish? In-Reply-To: <21b1db95$3071aea3$1e9d905c$@com> References: <21b1db95$3071aea3$1e9d905c$@com> Message-ID: <5318045886540959399@unknownmsgid> I think that i will mark this mail as my favourite one. Le 30 mars 2012 ? 09:27, Kunmi Sheba Foods a ?crit : Hello everyone, Can someone please share answers to my questions: 1. I am using regular linux and downloaded Varnish Cache 3.0.2 varnish-3.0.2.tar where do I put the files? 2. I read here https://www.varnish-cache.org/docs/3.0/installation/install.html#source-or-packages to run commands, but don't know where am to be to run the backups. - should I be in one of the folders in the tar file above to run the commands? 3. What messages should I see to confirm that Varnish is properly installed? 4. Please share any other pertinent information. If you are in the U.S. and can call to walk me through the steps. Please call me on 770.982.1000. Thanks for your attention. Kunmi _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc -------------- next part -------------- An HTML attachment was scrubbed... URL: From nbubingo at gmail.com Fri Mar 30 09:05:45 2012 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Fri, 30 Mar 2012 17:05:45 +0800 Subject: The grace config eat the memory greatly Message-ID: Hello, folks, Yesterday, I encountered the similar problem in varnish-3.0.2 with this ticket: https://www.varnish-cache.org/trac/ticket/546 At first, we just configure the memory to 1G "-s file,/home/admin/varnish/cache/varnish_storage.bin,1G". And we specify the response grace time in VCL to be 30 minutes: set beresp.grace =30m; Our object cache time is very short: set beresp.ttl = 5s; Half an hour later, the total resident memory is about 3.7 G. It's 3 times more than the configured size. Then I checked all the responses in my servers. I thought maybe some responses are too tiny at first time and It just wasted the index object memory. But most of the HTTP responses are about 100K pages. After that, I tested with the grace time: When I remove the grace time, it's about up to 130M. When I specify the grace time to 5 minutes, it's about up to 1G. When I specify the grace time to 10 minutes, it's about up to 1.8G. I think the response grace time greatly impacts the varnish resident memory size. I don't know if it's a bug or feature. But it do eat too much memory than the configured size. Hope this mail can help someone. From perbu at varnish-software.com Fri Mar 30 09:50:34 2012 From: perbu at varnish-software.com (Per Buer) Date: Fri, 30 Mar 2012 11:50:34 +0200 Subject: The grace config eat the memory greatly In-Reply-To: References: Message-ID: Hi, On Fri, Mar 30, 2012 at 11:05 AM, ??? wrote: > (..) > Half an hour later, the total resident memory is about 3.7 G. It's 3 > times more than the configured size. > This is a know weakness. DocWilco has provided a patch that I think is is accepted in master. Hopefully it will be out in a future release. I'm guessing it should not be to hard to backport the patch if you need to. -- Per Buer, CEO Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer *Varnish makes websites fly!* Whitepapers | Video | Twitter -------------- next part -------------- An HTML attachment was scrubbed... URL: From krjeschke at omniti.com Fri Mar 30 14:08:42 2012 From: krjeschke at omniti.com (Katherine Jeschke) Date: Fri, 30 Mar 2012 10:08:42 -0400 Subject: Surge CFP is Open! Message-ID: Surge 2012, the scalability conference, September 27-28, Baltimore, MD has opened its CFP. Please visit http://omniti.com/surge/2012/cfp for details. -- Katherine Jeschke Director of Marketing and Creative Services OmniTI Computer Consulting, Inc. 7070 Samuel Morse Drive, Ste.150 Columbia, MD 21046 O: 443-325-1357, 222 F: 410/872-4911 C: 443/643-6140 omniti.com Surge2012: http://omniti.com/surge/2012 PG Corridor Days - DC: http://pgday.bwpug.org/ The information contained in this electronic message and any attached documents is privileged, confidential, and protected from disclosure. If you are not the intended recipient, note that any review, disclosure, copying, distribution, or use of the contents of this electronic message or any attached documents is prohibited. If you have received this communication in error, please destroy it and notify us immediately by telephone (1-443-325-1360) or by electronic mail (info at omniti.com). Thank you.