From phk at phk.freebsd.dk Wed Feb 1 10:26:01 2012 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 01 Feb 2012 10:26:01 +0000 Subject: to sendfile(2) or not to sendfile(2) Message-ID: <23964.1328091961@critter.freebsd.dk> Since the earliest days, Varnish have had support for sendfile(2) on systems where sendfile(2) worked well enough. That is roughly FreeBSD 8.x and later. There are theoretical reasons why sendfile(2) should be faster than writev(2), provided you use a file based storage (-sfile, -spersistent) but I have yet to see anybody telling me that these theoretical speedups matter, or are even visible, in reality. If you have the "sendfile_threshold" on your varnishd, you should have a working sendfile, could you please try to change it contents and tell me if you can see _any_ difference at all ? VM parameters like page-faults per second etc might be where to look for changes if you cannot see them elsewhere. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From openbsdnow at gmail.com Thu Feb 2 00:01:00 2012 From: openbsdnow at gmail.com (Kevin) Date: Wed, 01 Feb 2012 16:01:00 -0800 Subject: varnish/apache wacky incorrect port issues when link contains a trailing slash Message-ID: <4F29D23C.6090205@gmail.com> Hi all, In the process of testing varnish on our dev machine, I discovered many external links pointing to our site are missing the trailing slash. If the links were just on our site, I'd fix the links, and all would be fine, but I've recently discovered there are a lot of external links pointing to our site that are missing the trailing slash, so that solution isn't in the cards. Normally, this isn't a problem since Apache gracefully handles the missing / and the visitor ends up with the / in the URL where needed. So, www.example.com/folder becomes www.example.com/folder/ Fine. Now varnish enters into the picture, and requests to www.example.com/folder become www.example.com:8080/folder/ 8080, being the port I've moved Apache onto so Varnish can live on 80. I've tried a host of different mod_rewrite rules to try to get Apache to play nice, but so far, no dice. So, I'm back to wondering: 1. if there's a way to handle this type of thing more gracefully in varnish (and if not) 2. does anyone have the mod_rewrite foo to exorcise my new-found trailing slash problem? Many thanks, Kevin P.S. This isn't as simple as opening up 8080 at the firewall, since requests then end up going to Apache rather than Varnish, so that does me no good. From sean8sean at gmail.com Thu Feb 2 01:12:56 2012 From: sean8sean at gmail.com (Sean McHugh) Date: Wed, 1 Feb 2012 20:12:56 -0500 Subject: varnish + sharepoint 2010 Message-ID: Sharepoint 2010, typical installation. Protected with Kerberos/SPNEGO ... looking to squeeze the most i can out of varnish to reduce effect of latency on our private WAN. A number of the key urls are for public consumption (images for corporate news/js/css/axd), but the entire Sharepoint site is protected - how can i bypass the default behavior and cache the result of authenticated requests for future GETs ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pprocacci at datapipe.com Thu Feb 2 01:35:35 2012 From: pprocacci at datapipe.com (Paul A. Procacci) Date: Wed, 1 Feb 2012 19:35:35 -0600 Subject: varnish + sharepoint 2010 In-Reply-To: References: Message-ID: <20120202013535.GA49102@nat.myhome> So you need to check if a user is authorized for an object (which may or may not already be cached by Varnish) by means of an external application. (Sharepoint) Something along the lines perhaps? ################################### sub vcl_recv { if (req.url ~ "^/authorized_content") { if (req.restarts == 0) { set req.backend = authorization_backend; return(pass); } else { set req.backend = real_backend; set req.url = regsub(req.url, "_authorize_me", ""); } } } sub vcl_fetch { if (req.url ~ "^/authorized_content" && req.restarts == 0) { if (beresp.status == 200) { restart; } else { error 403 "Not authorized"; } } } ################################### Part of the problem is, Varnish doesn't know what's authorized and it will have to check every request to ensure a request is in fact authorized for the given content. Other than the above brief example, you could possibly create a vmod that caches responses from the `authorization_backend` and uses that for future requests. (if one doesn't exist already) ~Paul On Wed, Feb 01, 2012 at 08:12:56PM -0500, Sean McHugh wrote: > Sharepoint 2010, typical installation. Protected with Kerberos/SPNEGO ... > looking to > squeeze the most i can out of varnish to reduce effect of latency on our > private WAN. > > A number of the key urls are for public consumption (images for corporate > news/js/css/axd), but the entire Sharepoint site is protected - how can i > bypass the default behavior and cache the result of authenticated requests > for future GETs ? > _______________________________________________ > 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 xuejin3 at staff.sina.com.cn Fri Feb 3 02:59:49 2012 From: xuejin3 at staff.sina.com.cn (xuejing) Date: Fri, 03 Feb 2012 10:59:49 +0800 Subject: varnish2.1.5 suspended sometimes Message-ID: <201202031059487180749@staff.sina.com.cn> Hello, My company develops a relatively well trafficked website,and since we've had varnish up, we've got varnish suspended sometimes, which makes our team very unhappy. At first, we were really running with default settings. We are using 2.1.5 and started with basic parameter "-a 0.0.0.0:80 -f default.vcl -s malloc,2G -T 127.0.0.1:2000 -p thread_pools=8". Our varnish suspended every two months when varnishlog stopped updating log and varnish could not wake up itself, so we have to restart it manually. Maybe the network was not stable for a little while when varnish crashed , but we could not find any other presage. I'm writing to ask for help. I'm looking forward to hearing from you soon! Best wishes! Yours truly, xuejing 2012-02-03 ------------------------------------------------------------------------- ??? xuejin3 at staff.sina.com.cn ?????????????6???????7?,?100080 18F, SHUO HUANG PLAZA, No. 6, CaiHeFand Road, Haidian, Beijing 100080,China _________________________________________________________________________ http://www.sina.com.cn You're the One ??.?????????????????????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From damon at huddler-inc.com Fri Feb 3 17:37:17 2012 From: damon at huddler-inc.com (Damon Snyder) Date: Fri, 3 Feb 2012 09:37:17 -0800 Subject: varnish2.1.5 suspended sometimes In-Reply-To: <201202031059487180749@staff.sina.com.cn> References: <201202031059487180749@staff.sina.com.cn> Message-ID: Hi Xuejing, Its hard to provide any suggestions without more information. We have been running 2.1.5 on multiple sites with a fair amount of traffic and have not had any stability issues. It might help others provide you with some suggestions if you include the os / distro you are running on and the output of varnishstat -1. Please also provide a little more information about your environment-- ie what is varnish connecting to and do you have anything between varnish and the client. What are your backends doing when varnish hangs? Are they responsive? Damon 2012/2/2 xuejing > ** > > > Hello,****** > > > My company develops a relatively well trafficked website,and since we've had varnish up, we've got varnish suspended sometimes, which makes our team very unhappy. > **** > > > At first, we were really running with default settings. We are using 2.1.5 and started with basic parameter "-a > 0.0.0.0:80 -f default.vcl -s malloc,2G -T 127.0.0.1:2000 > -p thread_pools=8". **** > > > Our varnish suspended every two months when varnishlog stopped updating log and varnish could not wake up itself, so we have to restart it manually. Maybe the network was not stable for a little while when varnish crashed , but we could not find any other presage. I'm writing to ask for help. > **** > > I'm looking forward to hearing from you soon! **** > > Best wishes! **** > > Yours truly,**** > > xuejing > > 2012-02-03 > ------------------------------ > > ------------------------------------------------------------------------- > ??? xuejin3 at staff.sina.com.cn > > ?????????????6???????7?, 100080 > 18F, SHUO HUANG PLAZA, No. 6, CaiHeFand Road, > Haidian, Beijing 100080,China > _________________________________________________________________________ > http://www.sina.com.cn You're the One > ??.?? ?????? > > _______________________________________________ > 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 r at roze.lv Mon Feb 6 09:13:40 2012 From: r at roze.lv (Reinis Rozitis) Date: Mon, 6 Feb 2012 11:13:40 +0200 Subject: Assert error in stv_alloc(), stevedore.c line 144 Message-ID: <6EF51FE32A174EC9AADAD02F8529887B@NeiRoze> Hello, I am trying to switch from pure malloc (which works flawlesly, but there is a limit of just how much ram we can plug in a server) to some file storage on ssd but after a while (I imagine when it gets filled up) varnish (latest svn trunk) restarts: Feb 5 23:02:15 is50 varnishd[12304]: Child (12305) not responding to CLI, killing it. Feb 5 23:02:15 is50 varnishd[12304]: Child (12305) died signal=6 Feb 5 23:02:15 is50 varnishd[12304]: Child (12305) Panic message: Assert error in stv_alloc(), stevedore.c line 144:#012 Condition((st) != NULL) not true.#012thread = (cache-worker)#012ident = Linux,3.2.0-rc2-2-default,x86_64,-sfile,-sfile,-smalloc,-hcritbit,epoll#012Backtrace:#012 0x4284a8: pan_ic+b8#012 0x43f9fd: STV_alloc+17d#012 0x41e057: vfp_nop_begin+97#012 0x41ea11: FetchBody+291#012 0x4164fd: CNT_Session+1c8d#012 0x429c28: wrk_do_cnt_sess+b8#012 0x42a059: wrk_thread_real+379#012 0x7f7dd3343a4f: _end+7f7dd2cd2937#012 0x7f7dd30ad91d: _end+7f7dd2a3c805#012sp = 0x7f4b93e35008 {#012 fd = 228, id = 228, xid = 1707158194,#012 client = 10.0.0.2 33966,#012 step = STP_FETCH,#012 handling = deliver,#012 err_code = 200, err_reason = (null),#012 restarts = 0, esi_level = 0#012 ws = 0x7f4b93e35080 { #012 id = "sess",#012 {s,f,r,e} = 0x7f4b93e35cd8,+320,(nil),+65536},#012 },#012 http[req] = {#012 ws = 0x7f4b93e35080[sess]#012 "GET",#012 "/profile/544/700/v1328443824/544700.jpg",#012 "HTTP/1.1",#012 "TE: deflate,gzip;q=0.3",#012 "Connection: TE, close",#012 "Host: i0.img.com",#012 "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0",#012 "X-Forwarded-For: 0.0.0.2",#012 },#012 worker = 0x7f4b2dbfebb0 {#012 ws = 0x7f4b2dbfed38 { #012 id = "wrk",#012 {s,f,r,e} = {0x7f4b2dbecb40,+4368,(nil),+65536},#012 },#012 http[bereq] = {#012 ws = 0x7f4b2dbfed38[wrk]#012 "GET",#012 "/profile/544/700/v1328443824/544700.jpg",#012 "HTTP/1.1",#012 "Host: i0.img.com",#012 "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0",#012 "X-Forwarded-For: 10.0.0.2",#012 "X-Varnish: 1707158194",#012 },#012 http[beresp] = {#012 ws = 0x7f4b2dbfed38[wrk]#012 "HTTP/1.1",#012 "200",#012 "OK",#012 "Date: Sun, 05 Feb 2012 21:02:11 GMT",#012 "Content-Type: image/jpeg",#012 "Content-Length: 54 Feb 5 23:02:15 is50 varnishd[12304]: Child cleanup complete Feb 5 23:02:15 is50 varnishd[12304]: child (21293) Started Feb 5 23:02:15 is50 varnishd[12304]: Child (21293) said Feb 5 23:02:15 is50 varnishd[12304]: Child (21293) said Child starts Feb 5 23:02:15 is50 varnishd[12304]: Child (21293) said SMF.s0 mmap'ed 107374182400 bytes of 107374182400 Feb 5 23:02:15 is50 varnishd[12304]: Child (21293) said SMF.s1 mmap'ed 107374182400 bytes of 107374182400 Varnish is started with: ./varnishd -f default.vcl -s file,/mnt/ssd1/cache,100G -s file,/mnt/ssd2/cache,100G -h critbit -p connect_timeout 600 -p thread_pools 8 -p thread_pool_min 100 -p thread_pool_max 5000 -thread_pool_add_delay=2 -p cli_timeout 50 -p session_linger 120 -p lru_interval 20 I have seen few similar bug reports: https://www.varnish-cache.org/trac/ticket/927 https://www.varnish-cache.org/trac/ticket/759 https://www.varnish-cache.org/trac/ticket/503 So I wonder if this is something new or some of the old tickets to be reopened (or maybe the issue is solved somewhat different way)? wbr rr From r at roze.lv Mon Feb 6 09:32:23 2012 From: r at roze.lv (Reinis Rozitis) Date: Mon, 6 Feb 2012 11:32:23 +0200 Subject: varnish/apache wacky incorrect port issues when link contains atrailing slash In-Reply-To: <4F29D23C.6090205@gmail.com> References: <4F29D23C.6090205@gmail.com> Message-ID: <3DCFC335448D4531A28EA719D35DE830@NeiRoze> > 1. if there's a way to handle this type of thing more gracefully in > varnish (and if not) > 2. does anyone have the mod_rewrite foo to exorcise my new-found trailing > slash problem? Try adding: UseCanonicalName Off ( http://httpd.apache.org/docs/current/mod/core.html#usecanonicalname ) in your apache config then it should use whatever port/hostname varnish (client) provides in the redirects rather than the defined in server block. rr From j.vanarragon at lukkien.com Tue Feb 7 07:48:29 2012 From: j.vanarragon at lukkien.com (Jaap van Arragon) Date: Tue, 07 Feb 2012 08:48:29 +0100 Subject: varnish serve old object during refresh In-Reply-To: Message-ID: Hello, Sorry for ?kicking? my question but I really need help with this. How can I configure varnish 3 so that it will serve cached objects to the client while the new objects are being fetched from the backed? Hope to hear something. Thank you. Regards, Jaap van Arragon On 1/30/12 3:23 PM, "Jaap van Arragon" wrote: > Hello, > > How can I serve an old object during the fetch of an expired object or max out > connection? > > I?ve configured the grace period in both the vcl_recv as the vcl_fetch. > > I even tried to use the saint mode to give me back an ?old? cached object. > > Can somebody give me help in this matter? > > sub vcl_recv { > > # Purge through http > if (req.request == "PURGE") { > if (!client.ip ~ purge) { > error 405 "Not allowed."; > } > ban("req.url ~ " + req.url ); > error 200 "Purged."; > } > > # Unset all cookies available > if (req.http.cookie) { > unset req.http.cookie; > } > > if (req.request != "GET" && req.request != "HEAD") { > /* We only deal with GET and HEAD by default */ > return (pass); > } > > # Adding Grace period in case backend lags > set req.grace = 3d; > return (lookup); > } > .... > sub vcl_fetch { > set beresp.grace = 4d; > set beresp.saintmode = 50s; > set beresp.ttl = 30s; > return (deliver); > } > > > > _______________________________________________ > 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 straightflush at gmail.com Tue Feb 7 13:27:17 2012 From: straightflush at gmail.com (AD) Date: Tue, 7 Feb 2012 08:27:17 -0500 Subject: varnish serve old object during refresh In-Reply-To: References: Message-ID: The VCL looks right at first glance. Are you sure the object is actually being cached in the first place? You can confirm with something like this in your vcl_deliver if (obj.hits > 0) { set resp.http.X-Cache = "HIT"; } else { set resp.http.X-Cache = "MISS"; } On Tue, Feb 7, 2012 at 2:48 AM, Jaap van Arragon wrote: > Hello, > > Sorry for ?kicking? my question but I really need help with this. > > How can I configure varnish 3 so that it will serve cached objects to the > client while the new objects are being fetched from the backed? > > Hope to hear something. > > Thank you. > > Regards, > Jaap van Arragon > > > > On 1/30/12 3:23 PM, "Jaap van Arragon" wrote: > > Hello, > > How can I serve an old object during the fetch of an expired object or max > out connection? > > I?ve configured the grace period in both the vcl_recv as the vcl_fetch. > > I even tried to use the saint mode to give me back an ?old? cached object. > > Can somebody give me help in this matter? > > sub vcl_recv { > > # Purge through http > if (req.request == "PURGE") { > if (!client.ip ~ purge) { > error 405 "Not allowed."; > } > ban("req.url ~ " + req.url ); > error 200 "Purged."; > } > > # Unset all cookies available > if (req.http.cookie) { > unset req.http.cookie; > } > > if (req.request != "GET" && req.request != "HEAD") { > /* We only deal with GET and HEAD by default */ > return (pass); > } > > # Adding Grace period in case backend lags > set req.grace = 3d; > return (lookup); > } > .... > sub vcl_fetch { > set beresp.grace = 4d; > set beresp.saintmode = 50s; > set beresp.ttl = 30s; > return (deliver); > } > > > ------------------------------ > _______________________________________________ > 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: From lfeys at reference.be Tue Feb 7 19:38:34 2012 From: lfeys at reference.be (Luc Feys) Date: Tue, 7 Feb 2012 19:38:34 +0000 Subject: Request coalescing and disappearing requests Message-ID: Hello, I am using Varnish in front of a Drupal website and we are currently performing load tests. The test this issue is about, is executing multiple requests for the same page on an empty (freshly restarted) Varnish.But I get results I don't understand, since even with only 10 simultaneous requests for the same page not all requests effectively lead to a response. If I have a look at the output of varnishstat (see below) after a run with 10 requests, I conclude the following: *) backend_req=1 => so request coalescing is working as expected *) n_objwrite=7 => 7 objects have been written to the response. This corresponds to the test results: 7 responses and 3 timeouts. Also corresponds with 1 miss and 6 hits in Varnish (cache_hit and cache_miss) *) sess_closed=7 => the sessions for the 7 succesful requests are being closed *) n_sess=3 => so 3 sessions just remain open? So what happened to those 3 unclosed sessions? Why don't they result in cache hits? Should I configure something in Varnish or my VCL in order for these requests to be handled as expected (meaning they should return the cached response and be removed from the request queue)? 'Varnishstat' output: 10 0.00 0.02 client_conn - Client connections accepted 10 0.00 0.02 client_req - Client requests received 6 0.00 0.01 cache_hit - Cache hits 1 0.00 0.00 cache_miss - Cache misses 1 0.00 0.00 backend_conn - Backend conn. success 1 0.00 0.00 fetch_chunked - Fetch chunked 14 . . n_sess_mem - N struct sess_mem 3 . . n_sess - N struct sess 1 . . n_object - N struct object 3 . . n_objectcore - N struct objectcore 3 . . n_objecthead - N struct objecthead 4 . . n_waitinglist - N struct waitinglist 2 . . n_wrk - N worker threads 3 0.00 0.01 n_wrk_create - N worker threads created 334272 0.00 642.83 n_wrk_max - N worker threads limited 4 0.00 0.01 n_wrk_queued - N queued work requests 3 . . n_backend - N backends 7 0.00 0.01 n_objwrite - Objects sent with write 10 0.00 0.02 s_sess - Total Sessions 10 0.00 0.02 s_req - Total Requests 1 0.00 0.00 s_fetch - Total fetch 3162 0.00 6.08 s_hdrbytes - Total header bytes 832083 0.00 1600.16 s_bodybytes - Total body bytes 7 0.00 0.01 sess_closed - Session Closed 807 0.00 1.55 shm_records - SHM records 396 0.00 0.76 shm_writes - SHM writes 1 0.00 0.00 backend_req - Backend requests made 1 0.00 0.00 n_vcl - N vcl total 1 0.00 0.00 n_vcl_avail - N vcl available 1 . . n_ban - N total active bans 1 0.00 0.00 n_ban_add - N new bans added 10 0.00 0.02 hcb_nolock - HCB Lookups without lock 1 0.00 0.00 hcb_lock - HCB Lookups with lock 1 0.00 0.00 hcb_insert - HCB Inserts 520 1.00 1.00 uptime - Client uptime 1 0.00 0.00 LCK.sms.creat - Created locks 1 0.00 0.00 LCK.sma.creat - Created locks 1 0.00 0.00 LCK.smf.creat - Created locks 4 0.00 0.01 LCK.smf.locks - Lock Operations 1 0.00 0.00 LCK.hcb.creat - Created locks 4 0.00 0.01 LCK.hcb.locks - Lock Operations 1 0.00 0.00 LCK.vcl.creat - Created locks 11 0.00 0.02 LCK.vcl.locks - Lock Operations 1 0.00 0.00 LCK.stat.creat - Created locks 14 0.00 0.03 LCK.stat.locks - Lock Operations 1 0.00 0.00 LCK.sessmem.creat - Created locks 20 0.00 0.04 LCK.sessmem.locks - Lock Operations 1 0.00 0.00 LCK.wstat.creat - Created locks 103097 198.74 198.26 LCK.wstat.locks - Lock Operations Below you can find an extract from the varnish log. It was generated using the -O option and imported into Excel. I then added one more column with increasing numbers for each line indicating the original order of the items in the log and then sorted them by request id. *) Requests 12, 15 and 17 were succesful *) Request 14 was a back-end request (executed from request 12, which was the first one) *) Request 16 never returned a response and is an example of the problem I described in my previous post. 'Varnishlog -O' output 101 0 WorkThread - 0x7fd132bfeb60 start 452 0 WorkThread - 0x7fd132bfeb60 end 1 12 SessionOpen c 192.168.10.168 2497 :6081 2 12 ReqStart c 192.168.10.168 2497 556239272 3 12 RxRequest c GET 4 12 RxURL c /nl/homepage 5 12 RxProtocol c HTTP/1.1 6 12 RxHeader c Connection: keep-alive 7 12 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 8 12 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 9 12 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 10 12 RxHeader c Keep-Alive: 115 11 12 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 12 12 RxHeader c Cache-Control: max-age=0 13 12 RxHeader c Accept-Encoding: gzip,deflate 14 12 RxHeader c Referer: http://www.footbel-2011.com/ 15 12 RxHeader c Host: www.footbel-load.com:6081 16 12 VCL_call c recv 17 12 VCL_return c lookup 18 12 VCL_call c hash 19 12 Hash c /nl/homepage 20 12 Hash c www.footbel-load.com:6081 21 12 VCL_return c hash 22 12 VCL_call c miss 23 12 VCL_return c fetch 25 12 Backend c 14 default default 179 12 TTL c 556239272 RFC 3600 1327500664 0 0 3600 0 180 12 VCL_call c fetch 181 12 VCL_return c deliver 182 12 ObjProtocol c HTTP/1.1 183 12 ObjResponse c OK 184 12 ObjHeader c Date: Wed, 25 Jan 2012 14:11:03 GMT 185 12 ObjHeader c Server: Apache/2.2.15 (Red Hat) 186 12 ObjHeader c X-Powered-By: PHP/5.2.17 187 12 ObjHeader c Cache-Control: public, max-age=3600 188 12 ObjHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 189 12 ObjHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 190 12 ObjHeader c Vary: Cookie 191 12 ObjHeader c "ETag: ""1327500663""" 192 12 ObjHeader c "Content-Type: text/html; charset=utf-8" 197 12 VCL_call c deliver 198 12 VCL_return c deliver 199 12 TxProtocol c HTTP/1.1 200 12 TxStatus c 200 201 12 TxResponse c OK 202 12 TxHeader c Server: Apache/2.2.15 (Red Hat) 203 12 TxHeader c X-Powered-By: PHP/5.2.17 204 12 TxHeader c Cache-Control: public, max-age=3600 205 12 TxHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 206 12 TxHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 207 12 TxHeader c Vary: Cookie 208 12 TxHeader c "ETag: ""1327500663""" 209 12 TxHeader c "Content-Type: text/html; charset=utf-8" 210 12 TxHeader c Content-Length: 118856 211 12 TxHeader c Accept-Ranges: bytes 212 12 TxHeader c Date: Wed, 25 Jan 2012 14:11:04 GMT 213 12 TxHeader c X-Varnish: 556239272 214 12 TxHeader c Age: 0 215 12 TxHeader c Via: 1.1 varnish 216 12 TxHeader c Connection: keep-alive 217 12 TxHeader c X-HITMISS: MISS 218 12 Length c 118856 219 12 ReqEnd c 556239272 1327500663.298880816 1327500664.062960863 0.000065565 0.760407686 0.003672361 292 12 Debug c """herding""" 442 12 SessionClose c no request 443 12 StatSess c 192.168.10.168 2497 1 1 1 0 0 1 449 118856 24 14 BackendOpen b default 127.0.0.1 59206 127.0.0.1 80 26 14 TxRequest b GET 27 14 TxURL b /nl/homepage 28 14 TxProtocol b HTTP/1.1 29 14 TxHeader b "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 30 14 TxHeader b "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 31 14 TxHeader b "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 32 14 TxHeader b "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 33 14 TxHeader b Referer: http://www.footbel-2011.com/ 34 14 TxHeader b Host: www.footbel-load.com:6081 35 14 TxHeader b X-Forwarded-For: 192.168.10.168, 192.168.10.168 36 14 TxHeader b X-Varnish: 556239272 37 14 TxHeader b Accept-Encoding: gzip 165 14 RxProtocol b HTTP/1.1 166 14 RxStatus b 200 167 14 RxResponse b OK 168 14 RxHeader b Date: Wed, 25 Jan 2012 14:11:03 GMT 169 14 RxHeader b Server: Apache/2.2.15 (Red Hat) 170 14 RxHeader b X-Powered-By: PHP/5.2.17 171 14 RxHeader b Cache-Control: public, max-age=3600 172 14 RxHeader b Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 173 14 RxHeader b Expires: Sun, 11 Mar 1984 12:00:00 GMT 174 14 RxHeader b Vary: Cookie 175 14 RxHeader b "ETag: ""1327500663""" 176 14 RxHeader b Connection: close 177 14 RxHeader b Transfer-Encoding: chunked 178 14 RxHeader b "Content-Type: text/html; charset=utf-8" 193 14 Fetch_Body b 3 0 1 194 14 Length b 118856 195 14 BackendClose b default 196 14 SessionOpen c 192.168.10.168 2504 :6081 246 14 ReqStart c 192.168.10.168 2504 556239279 247 14 RxRequest c GET 248 14 RxURL c /nl/homepage 249 14 RxProtocol c HTTP/1.1 250 14 RxHeader c Connection: keep-alive 251 14 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 252 14 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 253 14 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 254 14 RxHeader c Keep-Alive: 115 255 14 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 256 14 RxHeader c Cache-Control: max-age=0 257 14 RxHeader c Accept-Encoding: gzip,deflate 258 14 RxHeader c Referer: http://www.footbel-2011.com/ 259 14 RxHeader c Host: www.footbel-load.com:6081 260 14 VCL_call c recv 261 14 VCL_return c lookup 262 14 VCL_call c hash 263 14 Hash c /nl/homepage 264 14 Hash c www.footbel-load.com:6081 265 14 VCL_return c hash 266 14 Hit c 556239272 267 14 VCL_call c hit 268 14 VCL_return c deliver 269 14 VCL_call c deliver 270 14 VCL_return c deliver 271 14 TxProtocol c HTTP/1.1 272 14 TxStatus c 200 273 14 TxResponse c OK 274 14 TxHeader c Server: Apache/2.2.15 (Red Hat) 275 14 TxHeader c X-Powered-By: PHP/5.2.17 276 14 TxHeader c Cache-Control: public, max-age=3600 277 14 TxHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 278 14 TxHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 279 14 TxHeader c Vary: Cookie 280 14 TxHeader c "ETag: ""1327500663""" 281 14 TxHeader c "Content-Type: text/html; charset=utf-8" 282 14 TxHeader c Content-Length: 118856 283 14 TxHeader c Accept-Ranges: bytes 284 14 TxHeader c Date: Wed, 25 Jan 2012 14:11:04 GMT 285 14 TxHeader c X-Varnish: 556239279 556239272 286 14 TxHeader c Age: 0 287 14 TxHeader c Via: 1.1 varnish 288 14 TxHeader c Connection: keep-alive 289 14 TxHeader c X-HITMISS: HIT 290 14 Length c 118856 291 14 ReqEnd c 556239279 1327500664.059293509 1327500664.063805580 0.000077963 0.000107527 0.004404545 293 14 Debug c """herding""" 446 14 SessionClose c timeout 447 14 StatSess c 192.168.10.168 2504 0 1 1 0 0 0 458 118856 38 15 SessionOpen c 192.168.10.168 2498 :6081 39 15 ReqStart c 192.168.10.168 2498 556239273 40 15 RxRequest c GET 41 15 RxURL c /nl/homepage 42 15 RxProtocol c HTTP/1.1 43 15 RxHeader c Connection: keep-alive 44 15 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 45 15 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 46 15 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 47 15 RxHeader c Keep-Alive: 115 48 15 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 49 15 RxHeader c Cache-Control: max-age=0 50 15 RxHeader c Accept-Encoding: gzip,deflate 51 15 RxHeader c Referer: http://www.footbel-2011.com/ 52 15 RxHeader c Host: www.footbel-load.com:6081 53 15 VCL_call c recv 54 15 VCL_return c lookup 55 15 VCL_call c hash 56 15 Hash c /nl/homepage 57 15 Hash c www.footbel-load.com:6081 58 15 VCL_return c hash 220 15 Hit c 556239272 221 15 VCL_call c hit 222 15 VCL_return c deliver 223 15 VCL_call c deliver 224 15 VCL_return c deliver 225 15 TxProtocol c HTTP/1.1 226 15 TxStatus c 200 227 15 TxResponse c OK 228 15 TxHeader c Server: Apache/2.2.15 (Red Hat) 229 15 TxHeader c X-Powered-By: PHP/5.2.17 230 15 TxHeader c Cache-Control: public, max-age=3600 231 15 TxHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 232 15 TxHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 233 15 TxHeader c Vary: Cookie 234 15 TxHeader c "ETag: ""1327500663""" 235 15 TxHeader c "Content-Type: text/html; charset=utf-8" 236 15 TxHeader c Content-Length: 118856 237 15 TxHeader c Accept-Ranges: bytes 238 15 TxHeader c Date: Wed, 25 Jan 2012 14:11:04 GMT 239 15 TxHeader c X-Varnish: 556239273 556239272 240 15 TxHeader c Age: 0 241 15 TxHeader c Via: 1.1 varnish 242 15 TxHeader c Connection: keep-alive 243 15 TxHeader c X-HITMISS: HIT 244 15 Length c 118856 245 15 ReqEnd c 556239273 1327500663.402845621 1327500664.063805580 0.000059605 0.656617880 0.004342079 294 15 Debug c """herding""" 444 15 SessionClose c no request 445 15 StatSess c 192.168.10.168 2498 1 1 1 0 0 0 458 118856 102 16 SessionOpen c 192.168.10.168 2499 :6081 103 16 ReqStart c 192.168.10.168 2499 556239276 104 16 RxRequest c GET 105 16 RxURL c /nl/homepage 106 16 RxProtocol c HTTP/1.1 107 16 RxHeader c Connection: keep-alive 108 16 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 109 16 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 110 16 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 111 16 RxHeader c Keep-Alive: 115 112 16 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 113 16 RxHeader c Cache-Control: max-age=0 114 16 RxHeader c Accept-Encoding: gzip,deflate 115 16 RxHeader c Referer: http://www.footbel-2011.com/ 116 16 RxHeader c Host: www.footbel-load.com:6081 117 16 VCL_call c recv 118 16 VCL_return c lookup 119 16 VCL_call c hash 120 16 Hash c /nl/homepage 121 16 Hash c www.footbel-load.com:6081 122 16 VCL_return c hash 59 17 SessionOpen c 192.168.10.168 2500 :6081 60 17 ReqStart c 192.168.10.168 2500 556239274 61 17 RxRequest c GET 62 17 RxURL c /nl/homepage 63 17 RxProtocol c HTTP/1.1 64 17 RxHeader c Connection: keep-alive 65 17 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 66 17 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 67 17 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 68 17 RxHeader c Keep-Alive: 115 69 17 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 70 17 RxHeader c Cache-Control: max-age=0 71 17 RxHeader c Accept-Encoding: gzip,deflate 72 17 RxHeader c Referer: http://www.footbel-2011.com/ 73 17 RxHeader c Host: www.footbel-load.com:6081 74 17 VCL_call c recv 75 17 VCL_return c lookup 76 17 VCL_call c hash 77 17 Hash c /nl/homepage 78 17 Hash c www.footbel-load.com:6081 79 17 VCL_return c hash 321 17 Hit c 556239272 322 17 VCL_call c hit 323 17 VCL_return c deliver 324 17 VCL_call c deliver 325 17 VCL_return c deliver 326 17 TxProtocol c HTTP/1.1 327 17 TxStatus c 200 328 17 TxResponse c OK 329 17 TxHeader c Server: Apache/2.2.15 (Red Hat) 330 17 TxHeader c X-Powered-By: PHP/5.2.17 331 17 TxHeader c Cache-Control: public, max-age=3600 332 17 TxHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 333 17 TxHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 334 17 TxHeader c Vary: Cookie 335 17 TxHeader c "ETag: ""1327500663""" 336 17 TxHeader c "Content-Type: text/html; charset=utf-8" 337 17 TxHeader c Content-Length: 118856 338 17 TxHeader c Accept-Ranges: bytes 339 17 TxHeader c Date: Wed, 25 Jan 2012 14:11:04 GMT 340 17 TxHeader c X-Varnish: 556239274 556239272 341 17 TxHeader c Age: 0 342 17 TxHeader c Via: 1.1 varnish 343 17 TxHeader c Connection: keep-alive 344 17 TxHeader c X-HITMISS: HIT 345 17 Length c 118856 346 17 ReqEnd c 556239274 1327500663.621091604 1327500664.115823030 0.000060558 0.492846012 0.001885414 348 17 Debug c """herding""" 349 17 ReqStart c 192.168.10.168 2500 556239280 350 17 RxRequest c GET 351 17 RxURL c /nl/homepage 352 17 RxProtocol c HTTP/1.1 353 17 RxHeader c Connection: keep-alive 354 17 RxHeader c "Accept-Language: en,nl;q=0.7,nl-nl;q=0.3" 355 17 RxHeader c "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 356 17 RxHeader c "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23 ( .NET CLR 3.5.30729)" 357 17 RxHeader c Keep-Alive: 115 358 17 RxHeader c "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 359 17 RxHeader c Cache-Control: max-age=0 360 17 RxHeader c Accept-Encoding: gzip,deflate 361 17 RxHeader c Referer: http://www.footbel-2011.com/ 362 17 RxHeader c Host: www.footbel-load.com:6081 363 17 VCL_call c recv 364 17 VCL_return c lookup 365 17 VCL_call c hash 366 17 Hash c /nl/homepage 367 17 Hash c www.footbel-load.com:6081 368 17 VCL_return c hash 369 17 Hit c 556239272 370 17 VCL_call c hit 371 17 VCL_return c deliver 372 17 VCL_call c deliver 373 17 VCL_return c deliver 374 17 TxProtocol c HTTP/1.1 375 17 TxStatus c 200 376 17 TxResponse c OK 377 17 TxHeader c Server: Apache/2.2.15 (Red Hat) 378 17 TxHeader c X-Powered-By: PHP/5.2.17 379 17 TxHeader c Cache-Control: public, max-age=3600 380 17 TxHeader c Last-Modified: Wed, 25 Jan 2012 14:11:03 +0000 381 17 TxHeader c Expires: Sun, 11 Mar 1984 12:00:00 GMT 382 17 TxHeader c Vary: Cookie 383 17 TxHeader c "ETag: ""1327500663""" 384 17 TxHeader c "Content-Type: text/html; charset=utf-8" 385 17 TxHeader c Content-Length: 118856 386 17 TxHeader c Accept-Ranges: bytes 387 17 TxHeader c Date: Wed, 25 Jan 2012 14:11:04 GMT 388 17 TxHeader c X-Varnish: 556239280 556239272 389 17 TxHeader c Age: 0 390 17 TxHeader c Via: 1.1 varnish 391 17 TxHeader c Connection: keep-alive 392 17 TxHeader c X-HITMISS: HIT 393 17 Length c 118856 394 17 ReqEnd c 556239280 1327500664.214530468 1327500664.215306759 0.098707438 0.000080824 0.000695467 I am totally of ideas on this, so any help would be appreciated. I already posted this on the forum, but someone suggested to send it to the mailing list. Since I'm not sure this is actually a Varnish bug, I have posted to this list. Kind regards, Luc Feys Luc Feys Java Team Leader THE REFERENCE Stapelplein 70, bus 201 B-9000 Gent Phone: +32 (0)9 269 12 84 Fax: +32 (0)9 234 05 37 http://www.reference.be P Instead of printing this e-mail, you could carve it into stone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From openbsdnow at gmail.com Tue Feb 7 20:46:25 2012 From: openbsdnow at gmail.com (Kevin) Date: Tue, 07 Feb 2012 12:46:25 -0800 Subject: varnish/apache wacky incorrect port issues when link contains atrailing slash In-Reply-To: <3DCFC335448D4531A28EA719D35DE830@NeiRoze> References: <4F29D23C.6090205@gmail.com> <3DCFC335448D4531A28EA719D35DE830@NeiRoze> Message-ID: <4F318DA1.4080009@gmail.com> Reinis Rozitis wrote: >> 1. if there's a way to handle this type of thing more gracefully in >> varnish (and if not) >> 2. does anyone have the mod_rewrite foo to exorcise my new-found >> trailing slash problem? > Try adding: > > UseCanonicalName Off > > ( http://httpd.apache.org/docs/current/mod/core.html#usecanonicalname > ) in your apache config then it should use whatever port/hostname > varnish (client) provides in the redirects rather than the defined in > server block. No dice. Tried setting it globally first and for fun at the VirtualHost level, too, with the same results, :8080 in any of our URLs when the trailing / is omitted. As much as I hate to say it, this is a show-stopper for me right now with getting Varnish in play in our environment. Anyone have any other ideas? Many thanks, Kevin From apj at mutt.dk Tue Feb 7 20:51:37 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Tue, 7 Feb 2012 21:51:37 +0100 Subject: varnish/apache wacky incorrect port issues when link contains atrailing slash In-Reply-To: <4F318DA1.4080009@gmail.com> References: <4F29D23C.6090205@gmail.com> <3DCFC335448D4531A28EA719D35DE830@NeiRoze> <4F318DA1.4080009@gmail.com> Message-ID: <20120207205137.GD12685@nerd.dk> On Tue, Feb 07, 2012 at 12:46:25PM -0800, Kevin wrote: > > Tried setting it globally first and for fun at the VirtualHost > level, too, with the same results, :8080 in any of our URLs when > the trailing / is omitted. > > As much as I hate to say it, this is a show-stopper for me right now > with getting Varnish in play in our environment. > > Anyone have any other ideas? Run apache on port 80. We usually bind apache to 127.0.0.1:80 where backend and varnish runs on the same machine. -- Andreas From footplus at gmail.com Tue Feb 7 20:55:19 2012 From: footplus at gmail.com (=?UTF-8?B?QXVyw6lsaWVu?=) Date: Tue, 7 Feb 2012 21:55:19 +0100 Subject: varnish/apache wacky incorrect port issues when link contains atrailing slash In-Reply-To: <20120207205137.GD12685@nerd.dk> References: <4F29D23C.6090205@gmail.com> <3DCFC335448D4531A28EA719D35DE830@NeiRoze> <4F318DA1.4080009@gmail.com> <20120207205137.GD12685@nerd.dk> Message-ID: On Tue, Feb 7, 2012 at 9:51 PM, Andreas Plesner Jacobsen wrote: > On Tue, Feb 07, 2012 at 12:46:25PM -0800, Kevin wrote: > > > > Tried setting it globally first and for fun at the VirtualHost > > level, too, with the same results, :8080 in any of our URLs when > > the trailing / is omitted. > > > > As much as I hate to say it, this is a show-stopper for me right now > > with getting Varnish in play in our environment. > > > > Anyone have any other ideas? > > Run apache on port 80. We usually bind apache to 127.0.0.1:80 where > backend and > varnish runs on the same machine. > > That, and/or perhaps look at the description of the option UseCanonicalPhysicalPort ( http://httpd.apache.org/docs/current/mod/core.html#usecanonicalphysicalport) to be clear about the rewriting of Apache port number. Also, please make sure that the redirection was not cached by Varnish. Best regards, -- Aur?lien Guillaume *- By all means break the rules, and break them beautifully, deliberately and well. That is one of the ends for which they exist. -- *Robert Bringhurst -------------- next part -------------- An HTML attachment was scrubbed... URL: From openbsdnow at gmail.com Tue Feb 7 21:09:38 2012 From: openbsdnow at gmail.com (Kevin) Date: Tue, 07 Feb 2012 13:09:38 -0800 Subject: varnish/apache wacky incorrect port issues when link contains atrailing slash In-Reply-To: References: <4F29D23C.6090205@gmail.com> <3DCFC335448D4531A28EA719D35DE830@NeiRoze> <4F318DA1.4080009@gmail.com> <20120207205137.GD12685@nerd.dk> Message-ID: <4F319312.1060607@gmail.com> Aur?lien wrote: > On Tue, Feb 7, 2012 at 9:51 PM, Andreas Plesner Jacobsen > wrote: > > On Tue, Feb 07, 2012 at 12:46:25PM -0800, Kevin wrote: > > > > Tried setting it globally first and for fun at the VirtualHost > > level, too, with the same results, :8080 in any of our URLs when > > the trailing / is omitted. > > > > As much as I hate to say it, this is a show-stopper for me right now > > with getting Varnish in play in our environment. > > > > Anyone have any other ideas? > > Run apache on port 80. We usually bind apache to 127.0.0.1:80 > where backend and > varnish runs on the same machine. > > > That, and/or perhaps look at the description of the option > UseCanonicalPhysicalPort ( > http://httpd.apache.org/docs/current/mod/core.html#usecanonicalphysicalport > ) to be clear about the rewriting of Apache port number. For better or worse, we're still using Apache 1.3, and this isn't/wasn't an option in 1.3 (I already looked). :-( > Also, please make sure that the redirection was not cached by Varnish. I'm killing the daemon and restarting it each time I test. As far as I know, this completely kills the cache, right? Or is there something else I need to be doing, too? From jewel.nuruddin at eastbeam.co.jp Wed Feb 8 05:37:10 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Wed, 8 Feb 2012 14:37:10 +0900 Subject: jsp page cache Message-ID: Hello, My varnish could not cache .jsp page. Can any body help me how can I cache .jsp page? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn at ruberg.no Wed Feb 8 06:55:35 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Wed, 08 Feb 2012 07:55:35 +0100 Subject: jsp page cache In-Reply-To: References: Message-ID: <4F321C67.6000507@ruberg.no> On 02/08/2012 06:37 AM, Jewel Nuruddin wrote: > Hello, > My varnish could not cache .jsp page. > Can any body help me how can I cache .jsp page? You must make sure your JSP page allows Varnish to cache it, and/or force caching in Varnish. Keep in mind that cookie and set-cookie headers will usually make Varnish not cache anything. If this is the case with your setup, https://www.varnish-cache.org/trac/wiki/VCLExampleCacheCookies might be helpful. If you want a better response, you should show a varnishlog extract where the .jsp page is not being cached (so we can see exactly *why* it's not cached), and also your current VCL. -- Bj?rn From j.vanarragon at lukkien.com Wed Feb 8 07:20:00 2012 From: j.vanarragon at lukkien.com (Jaap van Arragon) Date: Wed, 08 Feb 2012 08:20:00 +0100 Subject: varnish serve old object during refresh In-Reply-To: Message-ID: Yes I?m sure. The cached images are responding a lot faster and when I look into varnishlog I can see that it is being hit. Is it even possible to server old objects while retrieving new ones or is there always one visitor that is experiencing slow images? Thanks for your reply On 2/7/12 2:27 PM, "AD" wrote: > The VCL looks right at first glance. ?Are you sure the object is actually > being cached in the first place? ?You can confirm with something like this in > your vcl_deliver > > if (obj.hits > 0) { > ? ? ?set resp.http.X-Cache = "HIT"; > ? ? ?} else { > ? ? ?set resp.http.X-Cache = "MISS"; > ? } > > On Tue, Feb 7, 2012 at 2:48 AM, Jaap van Arragon > wrote: >> Hello, >> >> Sorry for ?kicking? my question but I really need help with this. >> >> How can I configure varnish 3 so that it will serve cached objects to the >> client while the new objects are being fetched from the backed? >> >> Hope to hear something. >> >> Thank you. >> >> Regards, >> Jaap van Arragon >> >> >> >> On 1/30/12 3:23 PM, "Jaap van Arragon" > > wrote: >> >>> Hello, >>> >>> How can I serve an old object during the fetch of an expired object or max >>> out connection? >>> >>> I?ve configured the grace period in both the vcl_recv as the vcl_fetch. >>> >>> I even tried to use the saint mode to give me back an ?old? cached object. >>> >>> Can somebody give me help in this matter? >>> >>> sub vcl_recv { >>> >>> ????# Purge through http >>> ????if (req.request == "PURGE") { >>> ????????if (!client.ip ~ purge) { >>> ????????????error 405 "Not allowed."; >>> ????????} >>> ????????ban("req.url ~ " + req.url ); >>> ????????error 200 "Purged."; >>> ????} >>> >>> ????# Unset all cookies available >>> ????if (req.http.cookie) { >>> ????????unset req.http.cookie; >>> ????} >>> >>> ?????if (req.request != "GET" && req.request != "HEAD") { >>> ????????/* We only deal with GET and HEAD by default */ >>> ????????return (pass); >>> ????} >>> >>> ????# Adding Grace period in case backend lags >>> ????set req.grace = 3d; >>> ????return (lookup); >>> } >>> .... >>> sub vcl_fetch { >>> ????set beresp.grace = 4d; >>> ????set beresp.saintmode = 50s; >>> ????set beresp.ttl = 30s; >>> ????return (deliver); >>> } >>> >>> >>> >>> _______________________________________________ >>> 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: From bjorn at ruberg.no Wed Feb 8 08:05:49 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Wed, 08 Feb 2012 09:05:49 +0100 Subject: jsp page cache In-Reply-To: References: <4F321C67.6000507@ruberg.no> Message-ID: <4F322CDD.7090108@ruberg.no> Please reply to the list. Please do not top post. On 08. feb. 2012 08:45, Jewel Nuruddin wrote: > Hi > I use force caching in varnish like below > sub vcl_recv { > > > if (req.http.pragma ~ "no-cache" || req.http.Cache-Control ~ > "no-cache") { > return (lookup); > } > > unset req.http.cookie; > return (lookup); > > if (req.request == "GET" || req.request == "HEAD") { > if (req.url ~ > "\.(png|gif|jpg|swf|css|js|jsp|html|htm)$") { > return (lookup); > } > } > > # set req.backend = web; > # if ( (req.request == "GET") && (req.url ~ "\.jsp") ) { > # return(lookup); > # } > > set req.backend = web; > } > > But it can not cache .jsp file ? > > What I did mistake? You are not considering set-cookie from the backend. This would be done in vcl_fetch, as detailed in the URL I referred to in my previous response. Also, as mentioned, please include a varnishlog extract. -- Bj?rn From perbu at varnish-software.com Wed Feb 8 08:31:17 2012 From: perbu at varnish-software.com (Per Buer) Date: Wed, 8 Feb 2012 09:31:17 +0100 Subject: varnish serve old object during refresh In-Reply-To: References: Message-ID: On Wed, Feb 8, 2012 at 8:20 AM, Jaap van Arragon wrote: > > Is it even possible to server old objects while retrieving new ones or is > there always one visitor that is experiencing slow images? > There is always one poor sod. -- 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 jewel.nuruddin at eastbeam.co.jp Wed Feb 8 09:13:27 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Wed, 8 Feb 2012 18:13:27 +0900 Subject: jsp page cache problem Message-ID: Here is the full configuration of my default.vcl ### Start working for load balance ##### backend web01 { .host = "10.70.18.10"; .port = "8080"; } backend web02 { .host = "10.70.18.11"; .port = "8080"; } backend web03 { .host = "10.70.18.12"; .port = "8080"; } director web round-robin { { .backend = web01; } { .backend = web02; } { .backend = web03; } } sub vcl_recv { if (req.url ~ "\.(png|gif|jpg|swf|css|js| jsp|html|htm|xml)$") { return (lookup); set req.backend = web; } } sub vcl_fetch { if (req.url ~ "\.(png|gif|jpg|swf|css|js|jsp|html|xml)$") { unset beresp.http.set-cookie; } } Can you please kindly told me what is my wrong. This configuration can not cache .jsp file log is attached -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: varnish.log Type: application/octet-stream Size: 18276 bytes Desc: not available URL: From apj at mutt.dk Wed Feb 8 09:18:47 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Wed, 8 Feb 2012 10:18:47 +0100 Subject: jsp page cache problem In-Reply-To: References: Message-ID: <20120208091846.GE12685@nerd.dk> On Wed, Feb 08, 2012 at 06:13:27PM +0900, Jewel Nuruddin wrote: > This configuration can not cache .jsp file > log is attached According to the varnishlog, /tools/debug/plain/sleep3.jsp is cached, and is being served from cache. I don't see a problem. -- Andreas From steve.webster at lovefilm.com Wed Feb 8 09:59:48 2012 From: steve.webster at lovefilm.com (Steve Webster) Date: Wed, 8 Feb 2012 09:59:48 +0000 Subject: varnish serve old object during refresh In-Reply-To: References: Message-ID: <60C2EE2F-4FA3-45BF-BA57-D972EC5A72D3@lovefilm.com> On 8 Feb 2012, at 08:31, Per Buer wrote: > On Wed, Feb 8, 2012 at 8:20 AM, Jaap van Arragon wrote: > > Is it even possible to server old objects while retrieving new ones or is there always one visitor that is experiencing slow images? > > There is always one poor sod. This is unfortunate. Are there any plans to address this? It would be nice to have grace mode be functionally equivalent to Squid's stale-while-revalidate, which will return stale content for all requests whilst kicking off an asynchronous revalidation request. It's easy to read about grace mode and assume it's doing the same thing, especially given the inevitable direct comparisons: http://www.gossamer-threads.com/lists/varnish/dev/22475#22475 Cheers, Steve -- Steve Webster Web Architect LOVEFiLM (Apologies for the overly long pointless footer that follows) ----------------------------------------------------------------------------------------------------------------------------------------- LOVEFiLM UK Limited is a company registered in England and Wales. Registered Number: 06528297. Registered Office: No.9, 6 Portal Way, London W3 6RU, United Kingdom. This e-mail is confidential to the ordinary user of the e-mail address to which it was addressed. If you have received it in error, please delete it from your system and notify the sender immediately. This email message has been delivered safely and archived online by Mimecast. For more information please visit http://www.mimecast.co.uk ----------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From robsonpeixoto at gmail.com Wed Feb 8 18:04:44 2012 From: robsonpeixoto at gmail.com (Robson Roberto Souza Peixoto) Date: Wed, 8 Feb 2012 16:04:44 -0200 Subject: Debug Message-ID: Hi, Are there a command to keep easier the process of debug a vcl ? Something like write in log. thanks -- Robson Roberto Souza Peixoto Robinho Master in Computer Science, University of Campinas Linux Counter #395633 IRC: robsonpeixoto Twitter: http://twitter.com/rrspba github: https://github.com/robsonpeixoto -------------- next part -------------- An HTML attachment was scrubbed... URL: From damon at huddler-inc.com Wed Feb 8 18:42:42 2012 From: damon at huddler-inc.com (Damon Snyder) Date: Wed, 8 Feb 2012 10:42:42 -0800 Subject: Debug In-Reply-To: References: Message-ID: You can always in-line C and write to syslog. I found that handy (varnish 2.1.5) when we were doing some custom affinity hashing for serving images. You can do something like: # add this to the top of your vcl C{ #include #include }C sub vcl_recv { # or other ... # in some section you want to debug const char * url = VRT_r_req_url(sp); syslog(LOG_INFO, "varnish %s ...", url); ... } Hope that helps. Damon On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto < robsonpeixoto at gmail.com> wrote: > Hi, > > Are there a command to keep easier the process of debug a vcl ? Something > like write in log. > > thanks > -- > Robson Roberto Souza Peixoto > Robinho > Master in Computer Science, University of Campinas > Linux Counter #395633 > IRC: robsonpeixoto > Twitter: http://twitter.com/rrspba > github: https://github.com/robsonpeixoto > > _______________________________________________ > 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 rlane at ahbelo.com Wed Feb 8 20:34:38 2012 From: rlane at ahbelo.com (Lane, Richard) Date: Wed, 8 Feb 2012 20:34:38 +0000 Subject: Varnish 3.0.x - Gunzip / Gzip Message-ID: I have tried setting ?http_gzip_support? to off/false via startup parameter but I still see that Gunzip operations are still occurring in Varnish when looking at Varnishstat output. I would like to turn this off because I have Apache behind Varnish that is already handling Gzip/Deflate operations. Anyone know how to turn it off? /etc/sysconf/varnish: ..... -p shm_reclen=1024\ -p http_gzip_support=false \ -u varnish -g varnish ...... Varnishstat Output: ..... 1 . . vmods - Loaded VMODs 98 0.00 0.77 n_gunzip - Gunzip operations 1 0.00 0.01 LCK.sms.creat - Created locks ...... Cheers, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Thu Feb 9 04:22:04 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 9 Feb 2012 13:22:04 +0900 Subject: Varnish log analysis[how to know which page is come from varnish log] Message-ID: Hi I am very new in varnish. What is the way to know that which page is come from varnish cache and which page is come from backend server? Please help me. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From lee at leetrout.com Thu Feb 9 04:23:41 2012 From: lee at leetrout.com (Lee Trout) Date: Wed, 8 Feb 2012 23:23:41 -0500 Subject: Varnish 3.0.x - Gunzip / Gzip In-Reply-To: References: Message-ID: I seem to remember Poul-Henning showing a diagram at VUG4 that showed varnish both compressing and uncompressing as it processed content and there are notes about that here https://www.varnish-cache.org/docs/3.0/phk/gzip.html I would think that turning gzip support off would lead to seeing no gunzip operations but based on the documentation it sounds like it only affects how the objects are stored in the cache. It goes on to mention that if a client does not send an accept encoding Varnish will unzip the content. Perhaps because you have turned this off you are seeing gunzips when a client isn't accepting gzip or whenever there is a cache miss Varnish is gunzipping before it puts the content in the cache. "Enable gzip support. When enabled Varnish will compress uncompressed objects before they are stored in the cache." from https://www.varnish-cache.org/docs/3.0/reference/varnishd.html#run-time-parameters Unless you are seeing some specific performance degradation I would leave it turned on (assuming the documentation is correct and turning it on merely enforces storing compressed content). Maybe someone else will chime in and tell me I've got it all wrong :) Lee On Wed, Feb 8, 2012 at 3:34 PM, Lane, Richard wrote: > > I have tried setting ?http_gzip_support? to off/false via startup > parameter but I still see that Gunzip operations are still occurring in > Varnish when looking at Varnishstat output. I would like to turn this off > because I have Apache behind Varnish that is already handling Gzip/Deflate > operations. Anyone know how to turn it off? > > /etc/sysconf/varnish: > ..... > -p shm_reclen=1024\ > -p http_gzip_support=false \ > -u varnish -g varnish > ...... > > Varnishstat Output: > ..... > 1 . . vmods - Loaded VMODs > 98 0.00 0.77 n_gunzip - Gunzip operations > 1 0.00 0.01 LCK.sms.creat - Created locks > ...... > > Cheers, > Richard > > _______________________________________________ > 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 gasper.furman at delo.si Thu Feb 9 06:23:31 2012 From: gasper.furman at delo.si (=?windows-1252?Q?Ga=9Aper_Furman?=) Date: Thu, 09 Feb 2012 07:23:31 +0100 Subject: Varnish log analysis[how to know which page is come from varnish log] In-Reply-To: References: Message-ID: <4F336663.2040201@delo.si> Hi Use header HIT/MISS as shown in https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader Gasper On 02/09/2012 05:22 AM, Jewel Nuruddin wrote: > Hi > I am very new in varnish. > What is the way to know that which page is come from varnish cache and > which page is come from backend server? > Please help me. > > 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 Thu Feb 9 09:20:15 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 9 Feb 2012 18:20:15 +0900 Subject: java virtual machine memory cache Message-ID: Hi Our application handle user login information in our java virtual memory, there is no session or cookie for login user. What will be the varnish configuration to ignore this login information means I do not want to cached login user information. How can I handel this? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Thu Feb 9 09:25:14 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Thu, 9 Feb 2012 10:25:14 +0100 Subject: java virtual machine memory cache In-Reply-To: References: Message-ID: <20120209092514.GI12685@nerd.dk> On Thu, Feb 09, 2012 at 06:20:15PM +0900, Jewel Nuruddin wrote: > Our application handle user login information in our java virtual memory, > there is no session or cookie for login user. If the user is logged in, there needs to be a session and/or cookie. I think you need to rethink this. Do you perhaps mean that the user is not logged in at all? -- Andreas From enno at tty.nl Thu Feb 9 09:29:24 2012 From: enno at tty.nl (Enno van Amerongen) Date: Thu, 09 Feb 2012 10:29:24 +0100 Subject: Varnish log analysis[how to know which page is come from varnish log] In-Reply-To: <4F336663.2040201@delo.si> References: <4F336663.2040201@delo.si> Message-ID: <4F3391F4.3090308@tty.nl> or just look at the X-Varnish header: X-Varnish:1430572011 1430571971 that was a hit! (the second number is the original request that came from the backend) X-Varnish:1430627609 that was a miss! Enno Ga?per Furman wrote: > Hi > > Use header HIT/MISS as shown in > https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader > > Gasper > > On 02/09/2012 05:22 AM, Jewel Nuruddin wrote: >> Hi >> I am very new in varnish. >> What is the way to know that which page is come from varnish cache >> and which page is come from backend server? >> Please help me. >> >> 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 > > > > ------------------------------------------------------------------------ > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From geoff at uplex.de Thu Feb 9 09:55:38 2012 From: geoff at uplex.de (Geoff Simmons) Date: Thu, 09 Feb 2012 10:55:38 +0100 Subject: Debug In-Reply-To: References: Message-ID: <4F33981A.40302@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto > wrote: > > Are there a command to keep easier the process of debug a vcl ? > Something like write in log. On 2/8/12 7:42 PM, Damon Snyder wrote: > You can always in-line C and write to syslog. I found that handy > (varnish 2.1.5) when we were doing some custom affinity hashing > for serving images. You can do something like: > > # add this to the top of your vcl C{ #include #include > }C > > sub vcl_recv { # or other ... > > # in some section you want to debug const char * url = > VRT_r_req_url(sp); syslog(LOG_INFO, "varnish %s ...", url); > > ... } If you're in Varnish 3.x, you can just use the standard VMOD and call log() (to log into varnishlog) or syslog(): https://www.varnish-cache.org/docs/3.0/reference/vmod_std.html#log 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/ iQIcBAEBCAAGBQJPM5gYAAoJEOUwvh9pJNUReLoP/jgP2IP/anStrLGhSczAKEOF UAoiwuX+U8eIu9x2CrgL1q+KdTVJ1ljR6ho/mTxrs1YUiUOSMOp7PScpiIE/ytMv UnL1SeaV8Q0+c+z/tHcZSWXfzeVDLcTRyVQSbWkVylefMqL2+I9HNT1raQ42zTst geD+NwGfPHU1VTiUl+Al+c8t37MkY+sUDHJNyzHjCqlUAgUmUS5+ruerMZR+5I3D ggaqE8JjHfJF0TOsO27a8RmcQ94kyeESztLHIA3Kgn3zdkcdJeC9vqFI1SaYWnPB BFXbWzb6cRjvts3md3zbZOL4UHOGjUD7J9KTl50HFT2LSEbCDbXPPkC5meNvfOPG INIPspScUDyrsIsUkeAXkXal0nKU/Oko+VQyTcD1JkScad7TqgiLPgmcJqPYWp3B FctNN9FJ0002N/bARkmHTVScxwE5M+ajimJkabiq1eC6EGxYSc9H6BOMzrz28VeC TaZUAx0wQ32FXOxwwIBh9ECWkgLzCmN+1kRABIQuSf6zgr/naOV9un3eAo24LgMy 9dUCWZxSri8sW6qz9AEwRUtmZtyWd8wToy33+WOi0AWUCl8yzH/X90WPSKK+HlEt OTmAuPkhgB+gmY7/gf0BgOCx4AdxpLnqnFny4K1TgKwFm1+rYpD/zEH1GyXd8XFy Ut+ZkyBpcg9w6RMqdbFr =bDN/ -----END PGP SIGNATURE----- From robsonpeixoto at gmail.com Thu Feb 9 11:05:06 2012 From: robsonpeixoto at gmail.com (Robson Roberto Souza Peixoto) Date: Thu, 9 Feb 2012 09:05:06 -0200 Subject: Debug In-Reply-To: <4F33981A.40302@uplex.de> References: <4F33981A.40302@uplex.de> Message-ID: Thanks. Excellent tips. [ ]s On Thu, Feb 9, 2012 at 7:55 AM, Geoff Simmons wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto > > wrote: > > > > Are there a command to keep easier the process of debug a vcl ? > > Something like write in log. > > On 2/8/12 7:42 PM, Damon Snyder wrote: > > You can always in-line C and write to syslog. I found that handy > > (varnish 2.1.5) when we were doing some custom affinity hashing > > for serving images. You can do something like: > > > > # add this to the top of your vcl C{ #include #include > > }C > > > > sub vcl_recv { # or other ... > > > > # in some section you want to debug const char * url = > > VRT_r_req_url(sp); syslog(LOG_INFO, "varnish %s ...", url); > > > > ... } > > If you're in Varnish 3.x, you can just use the standard VMOD and call > log() (to log into varnishlog) or syslog(): > > https://www.varnish-cache.org/docs/3.0/reference/vmod_std.html#log > > > 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/ > > iQIcBAEBCAAGBQJPM5gYAAoJEOUwvh9pJNUReLoP/jgP2IP/anStrLGhSczAKEOF > UAoiwuX+U8eIu9x2CrgL1q+KdTVJ1ljR6ho/mTxrs1YUiUOSMOp7PScpiIE/ytMv > UnL1SeaV8Q0+c+z/tHcZSWXfzeVDLcTRyVQSbWkVylefMqL2+I9HNT1raQ42zTst > geD+NwGfPHU1VTiUl+Al+c8t37MkY+sUDHJNyzHjCqlUAgUmUS5+ruerMZR+5I3D > ggaqE8JjHfJF0TOsO27a8RmcQ94kyeESztLHIA3Kgn3zdkcdJeC9vqFI1SaYWnPB > BFXbWzb6cRjvts3md3zbZOL4UHOGjUD7J9KTl50HFT2LSEbCDbXPPkC5meNvfOPG > INIPspScUDyrsIsUkeAXkXal0nKU/Oko+VQyTcD1JkScad7TqgiLPgmcJqPYWp3B > FctNN9FJ0002N/bARkmHTVScxwE5M+ajimJkabiq1eC6EGxYSc9H6BOMzrz28VeC > TaZUAx0wQ32FXOxwwIBh9ECWkgLzCmN+1kRABIQuSf6zgr/naOV9un3eAo24LgMy > 9dUCWZxSri8sW6qz9AEwRUtmZtyWd8wToy33+WOi0AWUCl8yzH/X90WPSKK+HlEt > OTmAuPkhgB+gmY7/gf0BgOCx4AdxpLnqnFny4K1TgKwFm1+rYpD/zEH1GyXd8XFy > Ut+ZkyBpcg9w6RMqdbFr > =bDN/ > -----END PGP SIGNATURE----- > -- Robson Roberto Souza Peixoto Robinho Master in Computer Science, University of Campinas Linux Counter #395633 IRC: robsonpeixoto Twitter: http://twitter.com/rrspba github: https://github.com/robsonpeixoto -------------- next part -------------- An HTML attachment was scrubbed... URL: From kokoniimasu at gmail.com Thu Feb 9 16:59:27 2012 From: kokoniimasu at gmail.com (kokoniimasu) Date: Fri, 10 Feb 2012 01:59:27 +0900 Subject: Simple redirect Message-ID: Hi, Varnish redirect is necessary to write in two actions. I tried to be simply redirect. For example, to redirect http://www.example.com import rewrite; sub vcl_recv{ error( rewrite.location( 302,"http://www.example.com/" ) ); } vcl_error is not necessary blog-post: http://blog.xcir.net/index.php/2012/02/varnish-redirect-operation-to-easylibvmod-rewrite/ code: https://github.com/xcir/libvmod-rewrite and wrote code to simplify the output of the varnishlog. http://blog.xcir.net/index.php/2012/02/convert-varnishlog-output-to-easy/ I hope that this code is of help to you. -- Syohei Tanaka(@xcir) http://xcir.net/ From genarg at live.com Thu Feb 9 18:24:50 2012 From: genarg at live.com (Emiliano Barrionuevo) Date: Thu, 9 Feb 2012 15:24:50 -0300 Subject: Wordpress+WP-E-COMMERCE+VARNISH Message-ID: Hello. This is my first Varnish setup I plan to do. The question begins with the setup: Webpage (Wordpress+WP-E-Commerce) Testing/dummy site www.ilomilo.com.ar Homepage | No cookies needed, daily updates, SSL Products Page | No cookies needed, weekly updates, SSL Product Page | Includes button to add to cart, need cookies, SSL Checkout - Transaction Results - Account | Needs cookies, SSL 1 gig of resources (images & other media like pdf) Server configuration (planned): Intel(R) Xeon(R) CPU X5460 @ 3.16GHz, 3 cores, 1.75 GB of RAM, Max of 3 GB burstable Linux 2.6.32-042stab044.17 on i686 (CenOS 6.2) Main site Varnish (ver. 3.0.2 revision 55e70a4) port 80, 443. - Nginx - PHP-FPM+APC Local CDN Nginx Questions: How can I tell Varnish to enable cache on certain url and let pass cookies on others/rest of the site? Having 500.000 visits/month what's the best practice for cache purge? How can i configure varnish and nginx, one serving cached pages and the other (nginx) serving static content like images ON THE SAME MACHINE. I have 2 spare IP address. I have HyperCache plugin for Wordpress, it generates static files of the site and sends it to nginx to serve. APC also do its work. Should I disable HyperCache and let Varnish take care of the PHP content? More on HyperCache on http://www.satollo.net/plugins/hyper-cache From jewel.nuruddin at eastbeam.co.jp Fri Feb 10 02:25:25 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 10 Feb 2012 11:25:25 +0900 Subject: Can varnish distinction user is login or logout Message-ID: Hi Is there any way to find out in varnish whether user is login or logout ? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Fri Feb 10 02:29:45 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 10 Feb 2012 11:29:45 +0900 Subject: Is varnish can read text from html or jsp page Message-ID: Hi Is there there any way in varnish to find some text in html or jsp page? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From savetheinternet at omegasdg.com Fri Feb 10 03:20:07 2012 From: savetheinternet at omegasdg.com (Michael Save) Date: Fri, 10 Feb 2012 14:20:07 +1100 Subject: Can varnish distinction user is login or logout In-Reply-To: References: Message-ID: On Fri, Feb 10, 2012 at 1:25 PM, Jewel Nuruddin wrote: > Hi > Is there any way to find out in varnish whether user is login or logout ? > Thanks > Jewel > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc Hi, You'll have to be much more specific. When someone is "logged in", I'm assuming they have a cookie that signifies that, correct? Can you just check if that cookie is existent? It really depends on the web application, but in most cases, checking if a cookie exists (and is valid?) should be suffice. Cheers, Michael From jewel.nuruddin at eastbeam.co.jp Fri Feb 10 05:36:49 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 10 Feb 2012 14:36:49 +0900 Subject: duel varnish server or varnish master slave setup Message-ID: Hi Is varnish support dual server like master and slave. if one varnish goes down other varnish become alive. If varnish support master slave than what about the cache? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn at ruberg.no Fri Feb 10 05:53:04 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Fri, 10 Feb 2012 06:53:04 +0100 Subject: Is varnish can read text from html or jsp page In-Reply-To: References: Message-ID: <4F34B0C0.5020705@ruberg.no> On 10. feb. 2012 03:29, Jewel Nuruddin wrote: > Hi > Is there there any way in varnish to find some text in html or jsp page? No. What's the actual problem you are trying to solve? -- Bj?rn From bjorn at ruberg.no Fri Feb 10 05:56:56 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Fri, 10 Feb 2012 06:56:56 +0100 Subject: duel varnish server or varnish master slave setup In-Reply-To: References: Message-ID: <4F34B1A8.1040008@ruberg.no> On 10. feb. 2012 06:36, Jewel Nuruddin wrote: > Hi > > Is varnish support dual server like master and slave. if one varnish > goes down other varnish become alive. Varnish supports being clustered but does not in itself have those mechanisms. You would need something outside of Varnish, like a load balancer or IP address failover setup. > If varnish support master slave than what about the cache? If you don't prepare it somehow, it will be empty. http://lmgtfy.com/?q=varnish+warm+cache -- Bj?rn From perbu at varnish-software.com Fri Feb 10 13:57:06 2012 From: perbu at varnish-software.com (Per Buer) Date: Fri, 10 Feb 2012 14:57:06 +0100 Subject: Simple redirect In-Reply-To: References: Message-ID: hi, On Thu, Feb 9, 2012 at 5:59 PM, kokoniimasu wrote: > Hi, > > Varnish redirect is necessary to write in two actions. > I tried to be simply redirect. > > For example, to redirect http://www.example.com > > import rewrite; > sub vcl_recv{ > error( rewrite.location( 302,"http://www.example.com/" ) ); > } > Very nice. I'll add this to the module overview once we get it up and running (it suffered a bit when we had our server crash). 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 jfrias at gmail.com Fri Feb 10 17:17:30 2012 From: jfrias at gmail.com (Javier Frias) Date: Fri, 10 Feb 2012 12:17:30 -0500 Subject: Simple redirect In-Reply-To: References: Message-ID: your vltrans.php script to translate output is amazing, great hack! Human readability is often sacrificed in tools. Thanks, -Javier On Thu, Feb 9, 2012 at 11:59 AM, kokoniimasu wrote: > Hi, > > Varnish redirect is necessary to write in two actions. > I tried to be simply redirect. > > For example, to redirect ?http://www.example.com > > > ? ?import rewrite; > ? ?sub vcl_recv{ > ? ? ?error( rewrite.location( 302,"http://www.example.com/" ) ); > ? ?} > > > vcl_error is not necessary > > blog-post: > ?http://blog.xcir.net/index.php/2012/02/varnish-redirect-operation-to-easylibvmod-rewrite/ > > code: > ?https://github.com/xcir/libvmod-rewrite > > > and wrote code to simplify the output of the varnishlog. > ?http://blog.xcir.net/index.php/2012/02/convert-varnishlog-output-to-easy/ > > > I hope that this code is of help to you. > > -- > Syohei Tanaka(@xcir) > http://xcir.net/ > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From damon at huddler-inc.com Fri Feb 10 17:36:26 2012 From: damon at huddler-inc.com (Damon Snyder) Date: Fri, 10 Feb 2012 09:36:26 -0800 Subject: Wordpress+WP-E-COMMERCE+VARNISH In-Reply-To: References: Message-ID: See some suggestions inline below. Hope this helps get you started. Server configuration (planned): > Intel(R) Xeon(R) CPU X5460 @ 3.16GHz, 3 cores, 1.75 GB of RAM, Max of 3 GB > burstable > Linux 2.6.32-042stab044.17 on i686 (CenOS 6.2) > This is probably overkill. Varnish/nginx are not that cpu intensive. You are probably fine with that amount of memory to get started. > Questions: > How can I tell Varnish to enable cache on certain url and let pass cookies > on others/rest of the site? > Check out the docs on how to cache/not specific urls. Its pretty straight forward. See https://www.varnish-cache.org/docs/3.0/tutorial/vcl.html. One thing you want to do from the start is add a HIT/MISS header for debugging your configuration. See https://www.varnish-cache.org/trac/wiki/VCLExampleHitMissHeader. > Having 500.000 visits/month what's the best practice for cache purge? > Purge whenever you have new content. The purging is lazy, so you don't have to worry about purging being costly or effecting the operation. > How can i configure varnish and nginx, one serving cached pages and the > other (nginx) serving static content like images ON THE SAME MACHINE. I > have 2 spare IP address. > This is pretty common. You can have nginx serve maint pages and static content then proxy_pass to varnish for the content you want cached. > I have HyperCache plugin for Wordpress, it generates static files of the > site and sends it to nginx to serve. APC also do its work. Should I disable > HyperCache and let Varnish take care of the PHP content? > More on HyperCache on http://www.satollo.net/**plugins/hyper-cache Varnish is good at what it does. I would lean on varnish first so long as you can get the purging hooked in to wordpress. Since your content is updated on a schedule, you could probably purge by hand when new content is published. Hope this helps, Damon > > > > ______________________________**_________________ > 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 hugues.alary at gmail.com Fri Feb 10 20:08:33 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Fri, 10 Feb 2012 12:08:33 -0800 Subject: Varnish 3.0.2 req.hash Message-ID: Hi! I hope this question have not been asked and answered hundreds of times, but I couldn't find an answer to it. I'm using varnish 3.0.2. It is written in the documentation : The following variables are available while determining the hash key of an > object: > req.hash > The hash key used to refer to an object in the cache. Used when both > reading from and writing to the cache. I have tried using req.hash everywhere in my configuration file (vcl_hash, vcl_deliver, etc) and I always get this error at the compilation: Message from VCC-compiler: > Symbol not found: 'req.hash' (expected type STRING_LIST): > ('input' Line 218 Pos 29) > set req.http.TEST = req.hash; > ----------------------------########- > Running VCC-compiler failed, exit 1 > VCL compilation failed What am I missing? How exactly can I get the hash of a request? Your help would be greatly appreciated! Thanks in advance, -Hugues -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Fri Feb 10 20:48:08 2012 From: roberto.fernandezcrisial at gmail.com (=?ISO-8859-1?Q?Roberto_O=2E_Fern=E1ndez_Crisial?=) Date: Fri, 10 Feb 2012 17:48:08 -0300 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: Hugues, Try this: set req.http.X-TEST = req.hash; set req.http.TEST = req.http.X-TEST; It should work. Good luck, Roberto (@rofc) On Fri, Feb 10, 2012 at 5:08 PM, Hugues Alary wrote: > Hi! > > I hope this question have not been asked and answered hundreds of times, > but I couldn't find an answer to it. > > I'm using varnish 3.0.2. It is written in the documentation : > > The following variables are available while determining the hash key of an >> object: >> req.hash >> The hash key used to refer to an object in the cache. Used when both >> reading from and writing to the cache. > > > I have tried using req.hash everywhere in my configuration file (vcl_hash, > vcl_deliver, etc) and I always get this error at the compilation: > > Message from VCC-compiler: >> Symbol not found: 'req.hash' (expected type STRING_LIST): >> ('input' Line 218 Pos 29) >> set req.http.TEST = req.hash; >> ----------------------------########- >> Running VCC-compiler failed, exit 1 >> VCL compilation failed > > > What am I missing? How exactly can I get the hash of a request? > > Your help would be greatly appreciated! > > Thanks in advance, > -Hugues > > _______________________________________________ > 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 hugues.alary at gmail.com Fri Feb 10 21:00:40 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Fri, 10 Feb 2012 13:00:40 -0800 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: 2012/2/10 Roberto O. Fern?ndez Crisial > Hugues, > Hi Roberto, Thank you for your answer. > Try this: > > set req.http.X-TEST = req.hash; > set req.http.TEST = req.http.X-TEST; > > It should work. > Unfortunately the problem doesn't come from the syntax of "req.http.TEST" but from req.hash. Here is the message: Message from VCC-compiler: Symbol not found: '*req.hash*' (expected type STRING_LIST): ('input' Line 219 Pos 31) *set req.http.X-TEST* = *req.hash*; ------------------------------########- Running VCC-compiler failed, exit 1 VCL compilation failed I also tried to put that in my configuration: set req.http.X-TEST = {""} + req.hash; And, same error: Message from VCC-compiler: Symbol not found: '*req.hash*' (expected type STRING): ('input' Line 219 Pos 38) * set req.http.X-TEST* = {""} + *req.hash*; -------------------------------------########- Running VCC-compiler failed, exit 1 VCL compilation failed Do you have any other idea ? > Good luck, > > Roberto (@rofc) > > Thanks! -Hugues -------------- next part -------------- An HTML attachment was scrubbed... URL: From gau at gprj.net Sat Feb 11 01:22:45 2012 From: gau at gprj.net (gau at gprj.net) Date: Sat, 11 Feb 2012 10:22:45 +0900 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: Hugues, req.hash is the original write-only.(If my memory serves me) and, VCL is a notation has changed Varnish3. req.hash is replaced to hash_data(); vcl: sub vcl_hash { hash_data(req.url); set req.http.X-TEST = req.url; //add if (req.http.host) { hash_data(req.http.host); set req.http.X-TEST = req.http.X-TEST + " + " + req.http.host; //add } else { hash_data(server.ip); set req.http.X-TEST = req.http.X-TEST + " + " + server.ip; //add } return (hash); } sub vcl_deliver{ set resp.http.X-TEST = req.http.X-TEST; } test: wget -d http://192.168.1.199:6081/test -O - > /dev/null X-TEST: /test + 192.168.1.199:6081 Is not a very smart. (Is not a hash, but understood what anything was used) Can not think only about making the other VMOD. -- Syohei Tanaka(@xcir) http://xcir.net/ 2012/2/11 Hugues Alary : > 2012/2/10 Roberto O. Fern?ndez Crisial >> >> Hugues, > > > Hi Roberto, > > Thank you for your answer. > >> >> >> Try this: >> >> set req.http.X-TEST = req.hash; >> set req.http.TEST = req.http.X-TEST; >> >> It should work. > > > > Unfortunately the problem doesn't come from the syntax of "req.http.TEST" > but from req.hash. Here is the message: > > Message from VCC-compiler: > Symbol not found: 'req.hash' (expected type STRING_LIST): > ('input' Line 219 Pos 31) > ? ? ? ? set req.http.X-TEST = req.hash; > ------------------------------########- > > Running VCC-compiler failed, exit 1 > > VCL compilation failed > > > I also tried to put that in my configuration: > > set req.http.X-TEST = {""} + req.hash; > > > And, same error: > > Message from VCC-compiler: > Symbol not found: 'req.hash' (expected type STRING): > ('input' Line 219 Pos 38) > ? ? ? ? set req.http.X-TEST = {""} + req.hash; > -------------------------------------########- > > Running VCC-compiler failed, exit 1 > > VCL compilation failed > > > Do you have any other idea ? > >> >> Good ?luck, >> >> Roberto (@rofc) >> > > Thanks! > -Hugues > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From hugues.alary at gmail.com Sat Feb 11 21:24:34 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Sat, 11 Feb 2012 13:24:34 -0800 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: Hi Syohey, Thanks for your answer. My final goal is to get the hash calculated by Varnish. In the documentation of the 3.0.2 version it is written that req.hash contains this hash. I guess they just forgot to remove it and that req.hash doesn't exist anymore. However, is there a mean to get the *final* hash calculated by varnish, the result of hash_data()? Here: https://www.varnish-cache.org/docs/trunk/phk/varnish_does_not_hash.html it is written: "All the strings hash_data() are fed, are pushed through a cryptographic hash algorithm called SHA256, which, as the name says, always spits out 256 bits (= 32 bytes), no matter how many bits you feed it." And that's what I am looking for, the final value of the hash. I guess I could do it myself with a bit of C, but I would think that it is possible to get this value from somewhere since Varnish already does the calculation. -Hugues On Fri, Feb 10, 2012 at 5:22 PM, gau at gprj.net wrote: > Hugues, > > req.hash is the original write-only.(If my memory serves me) > and, VCL is a notation has changed Varnish3. > req.hash is replaced to hash_data(); > > > vcl: > sub vcl_hash { > hash_data(req.url); > set req.http.X-TEST = req.url; //add > if (req.http.host) { > hash_data(req.http.host); > set req.http.X-TEST = req.http.X-TEST + " + " + req.http.host; > //add > } else { > hash_data(server.ip); > set req.http.X-TEST = req.http.X-TEST + " + " + server.ip; //add > } > return (hash); > } > > > sub vcl_deliver{ > set resp.http.X-TEST = req.http.X-TEST; > } > > test: > wget -d http://192.168.1.199:6081/test -O - > /dev/null > > X-TEST: /test + 192.168.1.199:6081 > > Is not a very smart. > (Is not a hash, but understood what anything was used) > > > Can not think only about making the other VMOD. > > > -- > Syohei Tanaka(@xcir) > http://xcir.net/ > > > > 2012/2/11 Hugues Alary : > > 2012/2/10 Roberto O. Fern?ndez Crisial < > roberto.fernandezcrisial at gmail.com> > >> > >> Hugues, > > > > > > Hi Roberto, > > > > Thank you for your answer. > > > >> > >> > >> Try this: > >> > >> set req.http.X-TEST = req.hash; > >> set req.http.TEST = req.http.X-TEST; > >> > >> It should work. > > > > > > > > Unfortunately the problem doesn't come from the syntax of "req.http.TEST" > > but from req.hash. Here is the message: > > > > Message from VCC-compiler: > > Symbol not found: 'req.hash' (expected type STRING_LIST): > > ('input' Line 219 Pos 31) > > set req.http.X-TEST = req.hash; > > ------------------------------########- > > > > Running VCC-compiler failed, exit 1 > > > > VCL compilation failed > > > > > > I also tried to put that in my configuration: > > > > set req.http.X-TEST = {""} + req.hash; > > > > > > And, same error: > > > > Message from VCC-compiler: > > Symbol not found: 'req.hash' (expected type STRING): > > ('input' Line 219 Pos 38) > > set req.http.X-TEST = {""} + req.hash; > > -------------------------------------########- > > > > Running VCC-compiler failed, exit 1 > > > > VCL compilation failed > > > > > > Do you have any other idea ? > > > >> > >> Good luck, > >> > >> Roberto (@rofc) > >> > > > > Thanks! > > -Hugues > > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Sat Feb 11 21:27:46 2012 From: roberto.fernandezcrisial at gmail.com (=?utf-8?B?Um9iZXJ0byBPLiBGZXJuw6FuZGV6IENyaXNpYWw=?=) Date: Sat, 11 Feb 2012 21:27:46 +0000 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: <1084348064-1328995668-cardhu_decombobulator_blackberry.rim.net-67971023-@b26.c27.bise6.blackberry> If you're looking for the result of hash_data(), you should see what you're adding to default hash (url + uri). Nothing else ;) Roberto @rofc -----Original Message----- From: Hugues Alary Date: Sat, 11 Feb 2012 13:24:34 To: gau at gprj.net Cc: Roberto O. Fern??ndez Crisial; Subject: Re: Varnish 3.0.2 req.hash Hi Syohey, Thanks for your answer. My final goal is to get the hash calculated by Varnish. In the documentation of the 3.0.2 version it is written that req.hash contains this hash. I guess they just forgot to remove it and that req.hash doesn't exist anymore. However, is there a mean to get the *final* hash calculated by varnish, the result of hash_data()? Here: https://www.varnish-cache.org/docs/trunk/phk/varnish_does_not_hash.html it is written: "All the strings hash_data() are fed, are pushed through a cryptographic hash algorithm called SHA256, which, as the name says, always spits out 256 bits (= 32 bytes), no matter how many bits you feed it." And that's what I am looking for, the final value of the hash. I guess I could do it myself with a bit of C, but I would think that it is possible to get this value from somewhere since Varnish already does the calculation. -Hugues On Fri, Feb 10, 2012 at 5:22 PM, gau at gprj.net wrote: > Hugues, > > req.hash is the original write-only.(If my memory serves me) > and, VCL is a notation has changed Varnish3. > req.hash is replaced to hash_data(); > > > vcl: > sub vcl_hash { > hash_data(req.url); > set req.http.X-TEST = req.url; //add > if (req.http.host) { > hash_data(req.http.host); > set req.http.X-TEST = req.http.X-TEST + " + " + req.http.host; > //add > } else { > hash_data(server.ip); > set req.http.X-TEST = req.http.X-TEST + " + " + server.ip; //add > } > return (hash); > } > > > sub vcl_deliver{ > set resp.http.X-TEST = req.http.X-TEST; > } > > test: > wget -d http://192.168.1.199:6081/test -O - > /dev/null > > X-TEST: /test + 192.168.1.199:6081 > > Is not a very smart. > (Is not a hash, but understood what anything was used) > > > Can not think only about making the other VMOD. > > > -- > Syohei Tanaka(@xcir) > http://xcir.net/ > > > > 2012/2/11 Hugues Alary : > > 2012/2/10 Roberto O. Fern?ndez Crisial < > roberto.fernandezcrisial at gmail.com> > >> > >> Hugues, > > > > > > Hi Roberto, > > > > Thank you for your answer. > > > >> > >> > >> Try this: > >> > >> set req.http.X-TEST = req.hash; > >> set req.http.TEST = req.http.X-TEST; > >> > >> It should work. > > > > > > > > Unfortunately the problem doesn't come from the syntax of "req.http.TEST" > > but from req.hash. Here is the message: > > > > Message from VCC-compiler: > > Symbol not found: 'req.hash' (expected type STRING_LIST): > > ('input' Line 219 Pos 31) > > set req.http.X-TEST = req.hash; > > ------------------------------########- > > > > Running VCC-compiler failed, exit 1 > > > > VCL compilation failed > > > > > > I also tried to put that in my configuration: > > > > set req.http.X-TEST = {""} + req.hash; > > > > > > And, same error: > > > > Message from VCC-compiler: > > Symbol not found: 'req.hash' (expected type STRING): > > ('input' Line 219 Pos 38) > > set req.http.X-TEST = {""} + req.hash; > > -------------------------------------########- > > > > Running VCC-compiler failed, exit 1 > > > > VCL compilation failed > > > > > > Do you have any other idea ? > > > >> > >> Good luck, > >> > >> Roberto (@rofc) > >> > > > > Thanks! > > -Hugues > > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From gau at gprj.net Sun Feb 12 02:38:32 2012 From: gau at gprj.net (gau at gprj.net) Date: Sun, 12 Feb 2012 11:38:32 +0900 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: Hi, Hash is stored in the sp->digest(created after the vcl_hash has been called.The current version) To access it is necessary for VMOD sample(""this code is no guarantee. no error check"") VCC: ? Function STRING gethash() C: ? const char * vmod_gethash(struct sess *sp){ ? ? int u = WS_Reserve(sp->wrk->ws, 0); ? ? char *tmp = (char *)sp->wrk->ws->f; ? ? for(int i = 0; i < DIGEST_LEN; i++) ? ? ? sprintf(tmp + 2 * i, "%02x",sp->digest[i]); ? ? WS_Release(sp->wrk->ws, DIGEST_LEN*2+1); ? ? return tmp; ? } include list(It includes those that do not need) ? #include ? #include "vcl.h" ? #include "vrt.h" ? #include "bin/varnishd/cache.h" ? #include "bin/varnishd/cache_backend.h" ? #include "sys/socket.h" ? #include "vcc_if.h" ? #include ? #include ? #include "vsha256.h" VCL: ? import example2;// my test vmod ? sub vcl_deliver{ ? ? set resp.http.X-HASH=example2.gethash(); ? } TEST: ? wget ?-d http://192.168.1.199:6081/test -O - > /dev/null ? ? X-HASH: 4c77debfa66306c3b9d4ed17389bca9b4b0780ca2ebbef67104c28cb77c5995a ? wget ?-d http://192.168.1.199:6081/test2 -O - > /dev/null ? ? X-HASH: 759b213ba3e86f899a55243d31028240d3ee4680583f18356bfe6d37d43dff20 ? wget ?-d http://192.168.1.199:6081/test2XXXXXXXXXXXXXXXXXXXXXXXXXX -O - > /dev/null ? ? X-HASH: c79b81e7d55154585e80c03e954a7ccd8dcc067c8bd5d6b7d40d35276fd54a6d about VMOD: ? https://www.varnish-cache.org/docs/trunk/reference/vmod.html ? and ? https://github.com/varnish/libvmod-example Hope this helps, -- Syohei Tanaka(@xcir) http://xcir.net/ (:3[__]) 2012/2/12 Hugues Alary : > Hi Syohey, > > Thanks for your answer. > > My final goal is to get the hash calculated by Varnish. In the documentation > of the 3.0.2 version it is written that req.hash contains this hash. I guess > they just forgot to remove it and that req.hash doesn't exist anymore. > > However, is there a mean to get the final hash calculated by varnish, the > result of hash_data()? > > Here:?https://www.varnish-cache.org/docs/trunk/phk/varnish_does_not_hash.html?it > is written: > > > "All the strings hash_data() are fed, are pushed through a cryptographic > hash algorithm called SHA256, which, as the name says, always spits out 256 > bits (= 32 bytes), no matter how many bits you feed it." > > And that's what I am looking for, the final value of the hash. I guess I > could do it myself with a bit of C, but I would think that it is possible to > get this value from somewhere since Varnish already does the calculation. > > -Hugues > > On Fri, Feb 10, 2012 at 5:22 PM, gau at gprj.net wrote: >> >> Hugues, >> >> req.hash is the original write-only.(If my memory serves me) >> and, VCL is a notation has changed Varnish3. >> req.hash is replaced to hash_data(); >> >> >> ?vcl: >> ?sub vcl_hash { >> ? ? hash_data(req.url); >> ? ? set req.http.X-TEST = req.url; //add >> ? ? if (req.http.host) { >> ? ? ? ? hash_data(req.http.host); >> ? ? ? ? set req.http.X-TEST = req.http.X-TEST + " + " ?+ req.http.host; >> //add >> ? ? } else { >> ? ? ? ?hash_data(server.ip); >> ? ? ? ?set req.http.X-TEST = req.http.X-TEST + " + " + server.ip; //add >> ? ? } >> ? ? return (hash); >> ?} >> >> >> ?sub vcl_deliver{ >> ? ? ?set resp.http.X-TEST = req.http.X-TEST; >> ?} >> >> ?test: >> ?wget ?-d http://192.168.1.199:6081/test -O - > /dev/null >> >> ?X-TEST: /test + 192.168.1.199:6081 >> >> Is not a very smart. >> (Is not a hash, but understood what anything was used) >> >> >> Can not think only about making the other VMOD. >> >> >> -- >> Syohei Tanaka(@xcir) >> http://xcir.net/ >> >> >> >> 2012/2/11 Hugues Alary : >> > 2012/2/10 Roberto O. Fern?ndez Crisial >> > >> >> >> >> Hugues, >> > >> > >> > Hi Roberto, >> > >> > Thank you for your answer. >> > >> >> >> >> >> >> Try this: >> >> >> >> set req.http.X-TEST = req.hash; >> >> set req.http.TEST = req.http.X-TEST; >> >> >> >> It should work. >> > >> > >> > >> > Unfortunately the problem doesn't come from the syntax of >> > "req.http.TEST" >> > but from req.hash. Here is the message: >> > >> > Message from VCC-compiler: >> > Symbol not found: 'req.hash' (expected type STRING_LIST): >> > ('input' Line 219 Pos 31) >> > ? ? ? ? set req.http.X-TEST = req.hash; >> > ------------------------------########- >> > >> > Running VCC-compiler failed, exit 1 >> > >> > VCL compilation failed >> > >> > >> > I also tried to put that in my configuration: >> > >> > set req.http.X-TEST = {""} + req.hash; >> > >> > >> > And, same error: >> > >> > Message from VCC-compiler: >> > Symbol not found: 'req.hash' (expected type STRING): >> > ('input' Line 219 Pos 38) >> > ? ? ? ? set req.http.X-TEST = {""} + req.hash; >> > -------------------------------------########- >> > >> > Running VCC-compiler failed, exit 1 >> > >> > VCL compilation failed >> > >> > >> > Do you have any other idea ? >> > >> >> >> >> Good ?luck, >> >> >> >> Roberto (@rofc) >> >> >> > >> > Thanks! >> > -Hugues >> > >> > _______________________________________________ >> > varnish-misc mailing list >> > varnish-misc at varnish-cache.org >> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > > > > -- > Hugues ALARY > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From hugues.alary at gmail.com Sun Feb 12 02:48:26 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Sat, 11 Feb 2012 18:48:26 -0800 Subject: Varnish 3.0.2 req.hash In-Reply-To: References: Message-ID: Thanks everybody for your answers. Syohei's solution is exactly what I was looking for! Thanks Syohei. -Hugues On Sat, Feb 11, 2012 at 6:38 PM, gau at gprj.net wrote: > Hi, > > Hash is stored in the sp->digest(created after the vcl_hash has been > called.The current version) > To access it is necessary for VMOD > > > sample(""this code is no guarantee. no error check"") > > VCC: > Function STRING gethash() > C: > const char * vmod_gethash(struct sess *sp){ > int u = WS_Reserve(sp->wrk->ws, 0); > char *tmp = (char *)sp->wrk->ws->f; > for(int i = 0; i < DIGEST_LEN; i++) > sprintf(tmp + 2 * i, "%02x",sp->digest[i]); > WS_Release(sp->wrk->ws, DIGEST_LEN*2+1); > return tmp; > } > > include list(It includes those that do not need) > #include > #include "vcl.h" > #include "vrt.h" > #include "bin/varnishd/cache.h" > #include "bin/varnishd/cache_backend.h" > #include "sys/socket.h" > #include "vcc_if.h" > #include > #include > #include "vsha256.h" > > VCL: > import example2;// my test vmod > sub vcl_deliver{ > set resp.http.X-HASH=example2.gethash(); > } > > TEST: > wget -d http://192.168.1.199:6081/test -O - > /dev/null > X-HASH: > 4c77debfa66306c3b9d4ed17389bca9b4b0780ca2ebbef67104c28cb77c5995a > wget -d http://192.168.1.199:6081/test2 -O - > /dev/null > X-HASH: > 759b213ba3e86f899a55243d31028240d3ee4680583f18356bfe6d37d43dff20 > wget -d http://192.168.1.199:6081/test2XXXXXXXXXXXXXXXXXXXXXXXXXX > -O - > /dev/null > X-HASH: > c79b81e7d55154585e80c03e954a7ccd8dcc067c8bd5d6b7d40d35276fd54a6d > > about VMOD: > https://www.varnish-cache.org/docs/trunk/reference/vmod.html > and > https://github.com/varnish/libvmod-example > > > Hope this helps, > > -- > Syohei Tanaka(@xcir) > http://xcir.net/ > > (:3[__]) > > 2012/2/12 Hugues Alary : > > Hi Syohey, > > > > Thanks for your answer. > > > > My final goal is to get the hash calculated by Varnish. In the > documentation > > of the 3.0.2 version it is written that req.hash contains this hash. I > guess > > they just forgot to remove it and that req.hash doesn't exist anymore. > > > > However, is there a mean to get the final hash calculated by varnish, the > > result of hash_data()? > > > > Here: > https://www.varnish-cache.org/docs/trunk/phk/varnish_does_not_hash.html it > > is written: > > > > > > "All the strings hash_data() are fed, are pushed through a cryptographic > > hash algorithm called SHA256, which, as the name says, always spits out > 256 > > bits (= 32 bytes), no matter how many bits you feed it." > > > > And that's what I am looking for, the final value of the hash. I guess I > > could do it myself with a bit of C, but I would think that it is > possible to > > get this value from somewhere since Varnish already does the calculation. > > > > -Hugues > > > > On Fri, Feb 10, 2012 at 5:22 PM, gau at gprj.net wrote: > >> > >> Hugues, > >> > >> req.hash is the original write-only.(If my memory serves me) > >> and, VCL is a notation has changed Varnish3. > >> req.hash is replaced to hash_data(); > >> > >> > >> vcl: > >> sub vcl_hash { > >> hash_data(req.url); > >> set req.http.X-TEST = req.url; //add > >> if (req.http.host) { > >> hash_data(req.http.host); > >> set req.http.X-TEST = req.http.X-TEST + " + " + req.http.host; > >> //add > >> } else { > >> hash_data(server.ip); > >> set req.http.X-TEST = req.http.X-TEST + " + " + server.ip; //add > >> } > >> return (hash); > >> } > >> > >> > >> sub vcl_deliver{ > >> set resp.http.X-TEST = req.http.X-TEST; > >> } > >> > >> test: > >> wget -d http://192.168.1.199:6081/test -O - > /dev/null > >> > >> X-TEST: /test + 192.168.1.199:6081 > >> > >> Is not a very smart. > >> (Is not a hash, but understood what anything was used) > >> > >> > >> Can not think only about making the other VMOD. > >> > >> > >> -- > >> Syohei Tanaka(@xcir) > >> http://xcir.net/ > >> > >> > >> > >> 2012/2/11 Hugues Alary : > >> > 2012/2/10 Roberto O. Fern?ndez Crisial > >> > > >> >> > >> >> Hugues, > >> > > >> > > >> > Hi Roberto, > >> > > >> > Thank you for your answer. > >> > > >> >> > >> >> > >> >> Try this: > >> >> > >> >> set req.http.X-TEST = req.hash; > >> >> set req.http.TEST = req.http.X-TEST; > >> >> > >> >> It should work. > >> > > >> > > >> > > >> > Unfortunately the problem doesn't come from the syntax of > >> > "req.http.TEST" > >> > but from req.hash. Here is the message: > >> > > >> > Message from VCC-compiler: > >> > Symbol not found: 'req.hash' (expected type STRING_LIST): > >> > ('input' Line 219 Pos 31) > >> > set req.http.X-TEST = req.hash; > >> > ------------------------------########- > >> > > >> > Running VCC-compiler failed, exit 1 > >> > > >> > VCL compilation failed > >> > > >> > > >> > I also tried to put that in my configuration: > >> > > >> > set req.http.X-TEST = {""} + req.hash; > >> > > >> > > >> > And, same error: > >> > > >> > Message from VCC-compiler: > >> > Symbol not found: 'req.hash' (expected type STRING): > >> > ('input' Line 219 Pos 38) > >> > set req.http.X-TEST = {""} + req.hash; > >> > -------------------------------------########- > >> > > >> > Running VCC-compiler failed, exit 1 > >> > > >> > VCL compilation failed > >> > > >> > > >> > Do you have any other idea ? > >> > > >> >> > >> >> Good luck, > >> >> > >> >> Roberto (@rofc) > >> >> > >> > > >> > Thanks! > >> > -Hugues > >> > > >> > _______________________________________________ > >> > varnish-misc mailing list > >> > varnish-misc at varnish-cache.org > >> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > > > > > > > > > -- > > Hugues ALARY > > > > _______________________________________________ > > varnish-misc mailing list > > varnish-misc at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Mon Feb 13 02:30:59 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Mon, 13 Feb 2012 11:30:59 +0900 Subject: Can Varnish execute script file? Message-ID: Hello Can varnish execute script file? for example client request come to varnish server and its run a script file. Is it possible by varnish? Thank you very much for any help. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From straightflush at gmail.com Mon Feb 13 02:45:39 2012 From: straightflush at gmail.com (AD) Date: Sun, 12 Feb 2012 21:45:39 -0500 Subject: Can Varnish execute script file? In-Reply-To: References: Message-ID: do it in a vmod in 3.0. Another option is to use the libcurl vmod to call an external URL from your vcl and then handle the script execution from the external URL On Sun, Feb 12, 2012 at 9:30 PM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hello > > Can varnish execute script file? for example client request come to > varnish server and its run a script file. > Is it possible by varnish? > Thank you very much for any help. > > 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 jewel.nuruddin at eastbeam.co.jp Mon Feb 13 07:38:25 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Mon, 13 Feb 2012 16:38:25 +0900 Subject: what exactly vcl_hash do? Message-ID: Hello Sorry to ask very basic question, I am new in varnish. what exactly vcl_hash function do ? any example or where can I get every function description? Seems documentation dose not have or I miss it. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Mon Feb 13 08:15:35 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Mon, 13 Feb 2012 09:15:35 +0100 Subject: Can Varnish execute script file? In-Reply-To: References: Message-ID: <20120213081535.GJ12685@nerd.dk> On Mon, Feb 13, 2012 at 11:30:59AM +0900, Jewel Nuruddin wrote: > > Can varnish execute script file? for example client request come to varnish > server and its run a script file. The whole idea behind varnish is to deliver content fast. Running a script would kill performance. -- Andreas From apj at mutt.dk Mon Feb 13 08:26:06 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Mon, 13 Feb 2012 09:26:06 +0100 Subject: what exactly vcl_hash do? In-Reply-To: References: Message-ID: <20120213082606.GL12685@nerd.dk> On Mon, Feb 13, 2012 at 04:38:25PM +0900, Jewel Nuruddin wrote: > > Sorry to ask very basic question, I am new in varnish. > what exactly vcl_hash function do ? > any example or where can I get every function description? > Seems documentation dose not have or I miss it. man vcl -- Andreas From savetheinternet at tinyboard.org Wed Feb 8 05:47:11 2012 From: savetheinternet at tinyboard.org (Savetheinternet) Date: Wed, 8 Feb 2012 16:47:11 +1100 Subject: jsp page cache In-Reply-To: References: Message-ID: Hi, The file extension should be irrelevant unless you specify otherwise. You should take a read of some of the VCL examples here: https://www.varnish-cache.org/trac/wiki/VCLExamples. Below is wholly untested sample code for explicitly caching .jsp files for 1 hour. -- sub vcl_recv { # match .jsp files if(req.url ~ "\.jsp$") { return (lookup); } # [...] } sub vc_fetch { if(req.url ~ "\.jsp$") { # set ttl for one hour set beresp.ttl = 1h; } # [...] return (deliver); } -- Thanks, Michael On Wed, Feb 8, 2012 at 4:37 PM, Jewel Nuruddin wrote: > Hello, > My varnish could not cache .jsp page. > Can any body help me how can I cache .jsp page? > Thanks > Jewel > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From jewel.nuruddin at eastbeam.co.jp Wed Feb 15 03:22:06 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Wed, 15 Feb 2012 12:22:06 +0900 Subject: Can varnish listen 80 and 443 port at the same time Message-ID: Hi Is it possible to run varnish 80 and 443 port at the same time? If yes then how? My site is running both http:// and https:// Please help me. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From drtaber at northcarolina.edu Wed Feb 15 03:28:44 2012 From: drtaber at northcarolina.edu (Douglas R Taber) Date: Tue, 14 Feb 2012 22:28:44 -0500 Subject: Can varnish listen 80 and 443 port at the same time In-Reply-To: References: Message-ID: On Feb 14, 2012, at 10:23 PM, "Jewel Nuruddin" wrote: > Hi > Is it possible to run varnish 80 and 443 port at the same time? > If yes then how? > My site is running both http:// and https:// > Please help me. > > Thanks > Jewel > Varnish doesn't/can't do SSL traffic. https://www.varnish-cache.org/docs/trunk/phk/ssl.html From hugues.alary at gmail.com Wed Feb 15 03:29:50 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Tue, 14 Feb 2012 19:29:50 -0800 Subject: Can varnish listen 80 and 443 port at the same time In-Reply-To: References: Message-ID: Hi, Unfortunately varnish does not support HTTPS and it is not on the roadmap. I would recommend you to use Pound. Good luck, -H On Tue, Feb 14, 2012 at 7:22 PM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hi > Is it possible to run varnish 80 and 443 port at the same time? > If yes then how? > My site is running both http:// and https:// > Please help me. > > Thanks > Jewel > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From mattias at nucleus.be Wed Feb 15 06:57:02 2012 From: mattias at nucleus.be (Mattias Geniar) Date: Wed, 15 Feb 2012 07:57:02 +0100 Subject: Can varnish listen 80 and 443 port at the same time In-Reply-To: References: Message-ID: <18834F5BEC10824891FB8B22AC821A5A01FDB588@nucleus-srv01.Nucleus.local> > Unfortunately varnish does not support HTTPS and it is not on the roadmap. > I would recommend you to use Pound. I have good experience with Nginx as SSL offloader as well. Let it be a proxy to your Varnish on port 80 so it only does the SSL encryption and you still have your caching backend. Mattias From jewel.nuruddin at eastbeam.co.jp Wed Feb 15 09:35:47 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Wed, 15 Feb 2012 18:35:47 +0900 Subject: how to set how long varnish will cache Message-ID: Hello, Sorry for the basic question! How can I set that my object will be cached for 5 minutes in varnish? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjorn at ruberg.no Wed Feb 15 10:04:33 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Wed, 15 Feb 2012 11:04:33 +0100 Subject: how to set how long varnish will cache In-Reply-To: References: Message-ID: <4F3B8331.1040600@ruberg.no> On 15. feb. 2012 10:35, Jewel Nuruddin wrote: > Hello, > > Sorry for the basic question! > How can I set that my object will be cached for 5 minutes in varnish? The Varnish documentation is quite nice, and since you are asking a lot of basic questions I recommend that you spend some time with it. The answer to your question can be found here (as well as elsewhere in the docs): * https://www.varnish-cache.org/docs/3.0/tutorial/vcl.html * https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html -- Bj?rn From steve.webster at lovefilm.com Wed Feb 15 17:30:42 2012 From: steve.webster at lovefilm.com (Steve Webster) Date: Wed, 15 Feb 2012 17:30:42 +0000 Subject: Meaning of http_resp_size Message-ID: Hi, I'm attempting to tune our first production varnish server (fronting an API) and have a question about the http_resp_size run-time parameter. The description of this parameter in the varnishd documentation at https://www.varnish-cache.org/docs/3.0/reference/varnishd.html is: "Maximum number of bytes of HTTP backend resonse we will deal with. This is a limit on all bytes up to the double blank line which ends the HTTP request. The memory for the request is allocated from the worker workspace (param: sess_workspace) and this parameter limits how much of that the request is allowed to take up." The default value listed for this field is 32kb. The above description makes it sound like any backend response that exceeds the default http_resp_size of 32kb will not be handled (dropped, or at least not cached) by varnish. However, I'm happily able to request images of 200kb and up from this varnish instance, and can confirm that the it is being properly cached. If http_resp_size is not a limit on the total size of the backend response that can be handled by varnishd, what effect does it actually have on varnishd at runtime? Cheers, Steve -- Steve Webster Web Architect LOVEFiLM (apologies for the long and pointless footer that follows) ----------------------------------------------------------------------------------------------------------------------------------------- LOVEFiLM UK Limited is a company registered in England and Wales. Registered Number: 06528297. Registered Office: No.9, 6 Portal Way, London W3 6RU, United Kingdom. This e-mail is confidential to the ordinary user of the e-mail address to which it was addressed. If you have received it in error, please delete it from your system and notify the sender immediately. This email message has been delivered safely and archived online by Mimecast. For more information please visit http://www.mimecast.co.uk ----------------------------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Wed Feb 15 17:37:15 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Wed, 15 Feb 2012 18:37:15 +0100 Subject: Meaning of http_resp_size In-Reply-To: References: Message-ID: <20120215173715.GM12685@nerd.dk> On Wed, Feb 15, 2012 at 05:30:42PM +0000, Steve Webster wrote: > "Maximum number of bytes of HTTP backend resonse we will deal with. This is a > limit on all bytes up to the double blank line which ends the HTTP request. > The memory for the request is allocated from the worker workspace (param: > sess_workspace) and this parameter limits how much of that the request is > allowed to take up." "all bytes up to the double blank line which ends the HTTP request" Meaning only headers, not the content. -- Andreas From jewel.nuruddin at eastbeam.co.jp Thu Feb 16 03:24:21 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 16 Feb 2012 12:24:21 +0900 Subject: how to check whether varnish use memory for cache Message-ID: Hello I am using malloc for varnish. How can I check malloc is working and also how can I check whether my cached is using this malloc? Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From travis.crowder at spechal.com Thu Feb 16 03:31:01 2012 From: travis.crowder at spechal.com (Travis Crowder) Date: Wed, 15 Feb 2012 21:31:01 -0600 Subject: how to check whether varnish use memory for cache In-Reply-To: References: Message-ID: <4F3C7875.7020200@spechal.com> You can issue a ps auwx | grep varnish and look at the line for the process: /usr/sbin/varnishd -P /var/run/varnish.pid -a :80 -f /etc/varnish/default.vcl -T XX.XX.XX.XX:XX -t 120 -w 100,4000,120 -u varnish -g varnish -S /etc/varnish/secret -s malloc,2G This shows Varnish is using malloc and is allocated 2G of memory. You can also issue top and find the varnishd entry: 23193 varnish 15 0 4064m 1.5g 81m S 2.0 15.8 70:19.87 varnishd This shows we are using 1.5G of resident memory for our Varnish instance. HTH, Travis On 2/15/2012 9:24 PM, Jewel Nuruddin wrote: > Hello > I am using malloc for varnish. > How can I check malloc is working and also how can I check whether my > cached is using this malloc? > 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 jspam at skopis.com Thu Feb 16 03:38:22 2012 From: jspam at skopis.com (John Skopis) Date: Wed, 15 Feb 2012 21:38:22 -0600 Subject: access to root response headers from within esi subrequest Message-ID: Hello, I am experimenting with ESI. I am wondering how I can handle propagating status codes to the parent(root) request? The problem is that an esi subrequest might return a 4xx, 5xx status however the status does not propagate to the root request. I think what I would like is the ability to merge headers (overwrite) between esi subrequest and a parent request. Thanks, John Take this for example: t.php: < body>

t1"); print("

"); ?> t1.php: vcl: backend default { .host = "localhost"; .port = "80"; } backend test { .host = "localhost"; .port = "80"; } sub vcl_recv { remove req.http.Accept-Encoding; set req.http.x-saved-status = 1; if (req.request == "GET") { if (req.url == "/t1.php") { set req.backend = test; } return(pass); } } sub vcl_fetch { if (beresp.http.x-do-esi) { set beresp.do_esi = true; set req.http.x-saved-status = beresp.status; } if (beresp.http.x-esi-response) { if(beresp.status != 200 ) { set req.http.x-saved-status = beresp.status; } } if ( beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~ "no-cache" || beresp.http.Cache-Control ~ "private") { return(hit_for_pass); } } sub vcl_deliver { set resp.http.status = req.http.x-saved-status; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From geoff at uplex.de Thu Feb 16 08:18:09 2012 From: geoff at uplex.de (Geoff Simmons) Date: Thu, 16 Feb 2012 09:18:09 +0100 Subject: how to check whether varnish use memory for cache In-Reply-To: References: Message-ID: <4F3CBBC1.9080602@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/16/12 04:24 AM, Jewel Nuruddin wrote: > > I am using malloc for varnish. > How can I check malloc is working and also how can I check whether my > cached is using this malloc? In Varnish 3.x, varnishstat -1 and varnishadm show you stats about malloc usage in the SMA.s0.* fields. I don't remember exactly how it looks in Varnish 2.x, at any rate the field names were different. Best, Geoff - -- ** * * UPLEX - Nils Goroll Systemoptimierung Schwanenwik 24 22087 Hamburg Tel +49 40 2880 5731 Mob +49 176 636 90917 Fax +49 40 42949753 http://uplex.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (SunOS) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCAAGBQJPPLvBAAoJEOUwvh9pJNURwvkP/j1xQJ8dktqeyOLKkl1OURkH Qn71iKZMSoIoytCOOuGv3CWdFIN3uO2YtyCqhMk0B5gKKiVw04tIbKYGMjXyj68/ 9ac8T8AIa3iBlcQmKigGJQoW4X77oy8sXXvpIa7yJBd0OzUTWxE/EZj0GqadWghu 58zzQVMo8e79DwIkR649O7Ad6/bwEgoEB1hFhtrSKy5/CH5uG2/hdw/lWDRIlecR OoNodjU/nuxNHjCu0KDMhOKIxUhzS+izwjkv/lphw7d4L1ARkiLXZnrlxRIffU3B ZzQMlRypxexCl0nh1lzIccpTHEcPPbPdm8edkMYnljI5oghB5WX57s8AWk0HbAGt wszSkg6eAsxP1Xmux7HJyB7ovTRdhn0RYLfDCzg85CLZ8jMIU/NbyjIgifuygYpq iBWpxVuzzDtajaArboNvwR3W6hyjll5NcWmKDupCeQv8VUZG0E8due15/h5l20bg ttmBrE163jjaaPmo2GblZ4t4lnzrj6V66tc1hS0eQYWBROBwrLLiwt6ZoB2loFxA kzjswluXimnZeXwCh5wu3vK0cUQ0nxYhZsgcRit4MCzttEX+d4Iza5QaTgmV8t+p clck/L7lnru1l/7qr/e3prMvz+5Rhsfk1Y12zRebEcivurXYuH0dHOWpWyplDY6J c0YifNlZZopHswI25Qh0 =WESk -----END PGP SIGNATURE----- From perbu at varnish-software.com Thu Feb 16 10:25:15 2012 From: perbu at varnish-software.com (Per Buer) Date: Thu, 16 Feb 2012 11:25:15 +0100 Subject: how to check whether varnish use memory for cache In-Reply-To: <4F3C7875.7020200@spechal.com> References: <4F3C7875.7020200@spechal.com> Message-ID: On Thu, Feb 16, 2012 at 4:31 AM, Travis Crowder wrote: > You can issue a ps auwx | grep varnish and look at the line for the > process: > > /usr/sbin/varnishd -P /var/run/varnish.pid -a :80 -f > /etc/varnish/default.vcl -T XX.XX.XX.XX:XX -t 120 -w 100,4000,120 -u > varnish -g varnish -S /etc/varnish/secret -s malloc,2G > > This shows Varnish is using malloc and is allocated 2G of memory. > I just wanted to point out that -s malloc,2G allocated 2G of memory for storing objects. There is some overhead in the data structures that is allocated in addition to this, if needed. This overhead is dependant on the number of objects kept in cache. AFAIK it is around 1-2K per object. -- 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 perbu at varnish-software.com Thu Feb 16 14:45:27 2012 From: perbu at varnish-software.com (Per Buer) Date: Thu, 16 Feb 2012 15:45:27 +0100 Subject: VMOD listing Message-ID: We finally got the vmod listing up and running. We had some weird problems with drupal and a server crash which didn't really help and it all took a tad bit too long. Anyway, the idea is to have a listing of the all the VMODs that are in active use. If you want to register your VMOD just sign up for an account at https://www.varnish-cache.org/user/register and then go to https://www.varnish-cache.org/node/add/vmod (or click add content / VMOD) and fill out the form. Once we verify there is not goatse references in the listing it will be published on https://www.varnish-cache.org/vmods We're having some weird integration issues with Drupal 7.12 and Varnish (we blame drupal, of course :-) so there is some latency before stuff shows up (last when we tried enabling Varnish integration the whole session handling went down the drain) but we'll probably figure it out. Temporarily there is a picture of me on all the vmods I submitted but we'll clear that soon. In the mean time you can all enjoy my pretty face. Cheers, 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 ruben at varnish-software.com Thu Feb 16 18:29:51 2012 From: ruben at varnish-software.com (=?UTF-8?Q?Rub=C3=A9n_Romero?=) Date: Thu, 16 Feb 2012 19:29:51 +0100 Subject: VMOD listing In-Reply-To: References: Message-ID: On Thu, Feb 16, 2012 at 3:45 PM, Per Buer wrote: > We finally got the vmod listing up and running. We had some weird problems > with drupal and a server crash which didn't really help and it all took a > tad bit too long. > > So, I had my own document on the currently available VMODs. We have now 16 in the overview and I know of at least 3 additional VMODs that will be added in the future (2 of them doing GeoIP). Before I can do that I need the MIT License to be added to the license choices. Could you please make it happen or shall I just Other? Thanks to you (and Tollef) for getting this up and running! :-) Best, -- Rub?n Romero 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 Fri Feb 17 09:55:43 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 17 Feb 2012 18:55:43 +0900 Subject: Need some help to speed up varnish Message-ID: Hello All Here I attached my default.vcl file and /etc/sysconfig/varnish file I check with varnish and without varnish but found without varnish is faster then with varnish. Can any one please help me whats wrong with my configuration. I am new in varnish. My basic criteria I want to cache every thing except logged users.(This is working as my configuration) So I need to up varnish speed. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -u varnish -g varnish \ -S /etc/varnish/secret \ -p thread_pool_add_delay=2 \ -p thread_pools=2 \ -p thread_pool_max=10000 \ -p session_linger=100 \ -p sess_workspace=262144 \ -s malloc,4G" -------------- next part -------------- A non-text attachment was scrubbed... Name: default.vcl Type: application/octet-stream Size: 2086 bytes Desc: not available URL: From pablo at thenextweb.com Fri Feb 17 13:50:41 2012 From: pablo at thenextweb.com (=?ISO-8859-1?Q?Pablo_Rom=E1n?=) Date: Fri, 17 Feb 2012 14:50:41 +0100 Subject: Assert error in vfp_esi_bytes_gg() Message-ID: Hi there, I'm having the same issue described above regarding Vanish dying with the error: Panic message: Assert error in vfp_esi_bytes_gg(), cache_esi_fetch.c line 273:#012 Condition(i >= VGZ_OK) not true. In my case, it happens only when a certain url pattern is met. This pattern should normally resolve with a 404, but instead the server responds with an Error 324 (net::ERR_EMPTY_RESPONSE) and then Varnish dies, throwing the aforementioned error. I'm using Varnish 3.0.2 with ESI. Has someone experienced this before or have any tips on how to debug it? Thanks, -- --- Pablo Rom?n http://thenextweb.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.hayter at gmail.com Fri Feb 17 17:37:03 2012 From: jim.hayter at gmail.com (Jim Hayter) Date: Fri, 17 Feb 2012 12:37:03 -0500 Subject: Updating from 2.0.5 to 3.0.0 - some questions Message-ID: I am working on upgrading from Varnish 2.0.5 running on Ubuntu 9.10 to Varnish 3.0.0 running on Ubuntu 11.10. I have a few questions based on my reading of https://www.varnish-cache.org/trac/browser/doc/changes.rst 1) Changes from 2.1.5 to 3.0 beta 1 states: - The?-l?(shared memory log file) argument has been changed, please see the varnishd manual for the new syntax. 'man varnishd' for 2.0.5 states: -l shmlogsize Specify size of shmlog file. Scaling suffixes like 'k', 'm' can be used up to (e)tabytes. Default is 80 Megabytes. Specifying less than 8 Megabytes is unwise. 'man varnishd' for 3.0.0 states the same thing. And it appears to be working. What changed? 2) I'm also a bit confused by this code in vcl_fetch: if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { /* * Mark as "Hit-For-Pass" for the next 2 minutes */ set beresp.ttl = 120 s; return (hit_for_pass); } What is the purpose of "set beresp.ttl = 120 s;" ? So, the purpose is to mark as "Hit-For-Pass" for 2 minutes, but why is this done (what does it accomplish)? 3) I've noted that a number of the parameter values I used to set have become defaults. I also noted the change to make thread_pool_min and thread_pool_max agree better. Aside from these and some other changes (purge to ban, obj to beresp), are there particular changes I should look at closely to avoid problems when I update? 4) Is there additional doc I should review (besides https://www.varnish-cache.org/trac/browser/doc/changes.rst) that would help me avoid problems and understand what has changed? Thanks for any suggestions. Jim From kokoniimasu at gmail.com Sat Feb 18 03:48:39 2012 From: kokoniimasu at gmail.com (kokoniimasu) Date: Sat, 18 Feb 2012 12:48:39 +0900 Subject: Updating from 2.0.5 to 3.0.0 - some questions In-Reply-To: References: Message-ID: Hi Jim, >1) Changes from 2.1.5 to 3.0 beta 1 states: [root at localhost ~]# varnishd At least one of -d, -b, -f, -M, -S or -T must be specified usage: varnishd [options] ... -l shl,free,fill # Size of shared memory file # shl: space for SHL records [80m] # free: space for other allocations [1m] # fill: prefill new file [+] >2) I'm also a bit confused by this code in vcl_fetch: Refer to this url. https://www.varnish-cache.org/docs/trunk/faq/general.html#troubleshooting >3) I've noted that a number of the parameter values I used to set have If varnish's change parameter you want to know? (I'm sorry if I get it wrong. I'm not good at English... training now) This document may be relevant to you. http://blog.xcir.net/index.php/2011/07/vcl-and-parameter-changes-in-varnish-cache-3-0/ http_req_hdr_len is require special care.(if you wants very large request header(~2kb)) >4) Is there additional doc I should review (besides Refer to this url. https://www.varnish-cache.org/docs/trunk/installation/upgrade.html I hope you find it informative. -- Syohei Tanaka(@xcir) http://xcir.net/ (:3[__]) 2012?2?18?2:37 Jim Hayter : > I am working on upgrading from Varnish 2.0.5 running on Ubuntu 9.10 to > Varnish 3.0.0 running on Ubuntu 11.10. > > I have a few questions based on my reading of > https://www.varnish-cache.org/trac/browser/doc/changes.rst > > 1) Changes from 2.1.5 to 3.0 beta 1 states: > > - The -l (shared memory log file) argument has been changed, please > see the varnishd manual for the new syntax. > 'man varnishd' for 2.0.5 states: > > -l shmlogsize > Specify size of shmlog file. Scaling suffixes like 'k', 'm' > can be used up to (e)tabytes. Default is 80 Megabytes. > Specifying less than 8 Megabytes is unwise. > > 'man varnishd' for 3.0.0 states the same thing. And it appears to > be working. What changed? > > > 2) I'm also a bit confused by this code in vcl_fetch: > > if (beresp.ttl <= 0s || > beresp.http.Set-Cookie || > beresp.http.Vary == "*") { > /* > * Mark as "Hit-For-Pass" for the next 2 minutes > */ > set beresp.ttl = 120 s; > return (hit_for_pass); > } > > What is the purpose of "set beresp.ttl = 120 s;" ? So, the > purpose is to mark as "Hit-For-Pass" for 2 minutes, but why is this > done (what does it accomplish)? > > 3) I've noted that a number of the parameter values I used to set have > become defaults. I also noted the change to make thread_pool_min and > thread_pool_max agree better. Aside from these and some other changes > (purge to ban, obj to beresp), are there particular changes I should > look at closely to avoid problems when I update? > > 4) Is there additional doc I should review (besides > https://www.varnish-cache.org/trac/browser/doc/changes.rst) that would > help me avoid problems and understand what has changed? > > Thanks for any suggestions. > > Jim > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From kokoniimasu at gmail.com Sat Feb 18 04:21:18 2012 From: kokoniimasu at gmail.com (kokoniimasu) Date: Sat, 18 Feb 2012 13:21:18 +0900 Subject: Updating from 2.0.5 to 3.0.0 - some questions In-Reply-To: References: Message-ID: Hi Jim, you're working varnish is 2.0.5? 2.1.5? if varnish is 2.0.X. refer to this url.(sorry Japanese. but I put an English comment) http://wiki.xcir.net/index.php?title=Versuin2.0.x%E2%86%922.1.x%E3%81%B8%E3%81%AEVUP -- Syohei Tanaka(@xcir) http://xcir.net/ (:3[__]) 2012?2?18?2:37 Jim Hayter : > I am working on upgrading from Varnish 2.0.5 running on Ubuntu 9.10 to > Varnish 3.0.0 running on Ubuntu 11.10. > > I have a few questions based on my reading of > https://www.varnish-cache.org/trac/browser/doc/changes.rst > > 1) Changes from 2.1.5 to 3.0 beta 1 states: > > - The -l (shared memory log file) argument has been changed, please > see the varnishd manual for the new syntax. > 'man varnishd' for 2.0.5 states: > > -l shmlogsize > Specify size of shmlog file. Scaling suffixes like 'k', 'm' > can be used up to (e)tabytes. Default is 80 Megabytes. > Specifying less than 8 Megabytes is unwise. > > 'man varnishd' for 3.0.0 states the same thing. And it appears to > be working. What changed? > > > 2) I'm also a bit confused by this code in vcl_fetch: > > if (beresp.ttl <= 0s || > beresp.http.Set-Cookie || > beresp.http.Vary == "*") { > /* > * Mark as "Hit-For-Pass" for the next 2 minutes > */ > set beresp.ttl = 120 s; > return (hit_for_pass); > } > > What is the purpose of "set beresp.ttl = 120 s;" ? So, the > purpose is to mark as "Hit-For-Pass" for 2 minutes, but why is this > done (what does it accomplish)? > > 3) I've noted that a number of the parameter values I used to set have > become defaults. I also noted the change to make thread_pool_min and > thread_pool_max agree better. Aside from these and some other changes > (purge to ban, obj to beresp), are there particular changes I should > look at closely to avoid problems when I update? > > 4) Is there additional doc I should review (besides > https://www.varnish-cache.org/trac/browser/doc/changes.rst) that would > help me avoid problems and understand what has changed? > > Thanks for any suggestions. > > Jim > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From lee at leetrout.com Sat Feb 18 04:44:56 2012 From: lee at leetrout.com (Lee Trout) Date: Fri, 17 Feb 2012 23:44:56 -0500 Subject: Updating from 2.0.5 to 3.0.0 - some questions In-Reply-To: References: Message-ID: Jim, Make sure you adjust the new run time http_req_hdr_len and http_resp_hdr_len if you're site (or clients) send large headers. We discovered that our headers were averaging 8-12kb which is 2-3x the default 4096 bytes. That was a tricky one for us to sort out since only certain clients had the large cookie headers and the 413 errors were intermittent in varnishlog. Lee 2012/2/17 kokoniimasu > Hi Jim, > > you're working varnish is 2.0.5? 2.1.5? > > if varnish is 2.0.X. refer to this url.(sorry Japanese. but I put an > English comment) > > > http://wiki.xcir.net/index.php?title=Versuin2.0.x%E2%86%922.1.x%E3%81%B8%E3%81%AEVUP > > -- > Syohei Tanaka(@xcir) > http://xcir.net/ > > (:3[__]) > > > 2012?2?18?2:37 Jim Hayter : > > I am working on upgrading from Varnish 2.0.5 running on Ubuntu 9.10 to > > Varnish 3.0.0 running on Ubuntu 11.10. > > > > I have a few questions based on my reading of > > https://www.varnish-cache.org/trac/browser/doc/changes.rst > > > > 1) Changes from 2.1.5 to 3.0 beta 1 states: > > > > - The -l (shared memory log file) argument has been changed, please > > see the varnishd manual for the new syntax. > > 'man varnishd' for 2.0.5 states: > > > > -l shmlogsize > > Specify size of shmlog file. Scaling suffixes like 'k', > 'm' > > can be used up to (e)tabytes. Default is 80 Megabytes. > > Specifying less than 8 Megabytes is unwise. > > > > 'man varnishd' for 3.0.0 states the same thing. And it appears to > > be working. What changed? > > > > > > 2) I'm also a bit confused by this code in vcl_fetch: > > > > if (beresp.ttl <= 0s || > > beresp.http.Set-Cookie || > > beresp.http.Vary == "*") { > > /* > > * Mark as "Hit-For-Pass" for the next 2 minutes > > */ > > set beresp.ttl = 120 s; > > return (hit_for_pass); > > } > > > > What is the purpose of "set beresp.ttl = 120 s;" ? So, the > > purpose is to mark as "Hit-For-Pass" for 2 minutes, but why is this > > done (what does it accomplish)? > > > > 3) I've noted that a number of the parameter values I used to set have > > become defaults. I also noted the change to make thread_pool_min and > > thread_pool_max agree better. Aside from these and some other changes > > (purge to ban, obj to beresp), are there particular changes I should > > look at closely to avoid problems when I update? > > > > 4) Is there additional doc I should review (besides > > https://www.varnish-cache.org/trac/browser/doc/changes.rst) that would > > help me avoid problems and understand what has changed? > > > > Thanks for any suggestions. > > > > Jim > > > > _______________________________________________ > > 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: From bjorn at ruberg.no Sun Feb 19 09:42:29 2012 From: bjorn at ruberg.no (=?ISO-8859-1?Q?Bj=F8rn_Ruberg?=) Date: Sun, 19 Feb 2012 10:42:29 +0100 Subject: Need some help to speed up varnish In-Reply-To: References: Message-ID: <4F40C405.6000605@ruberg.no> On 02/17/2012 10:55 AM, Jewel Nuruddin wrote: > Hello All > Here I attached my default.vcl file and /etc/sysconfig/varnish file > I check with varnish and without varnish but found without varnish is > faster then with varnish. > Can any one please help me whats wrong with my configuration. > I am new in varnish. > My basic criteria I want to cache every thing except logged > users.(This is working as my configuration) > So I need to up varnish speed. https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html -- Bj?rn From geoff at uplex.de Sun Feb 19 10:03:25 2012 From: geoff at uplex.de (Geoff Simmons) Date: Sun, 19 Feb 2012 11:03:25 +0100 Subject: Need some help to speed up varnish In-Reply-To: References: Message-ID: <4F40C8ED.5090508@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2/17/12 10:55 AM, Jewel Nuruddin wrote: > > Here I attached my default.vcl file and /etc/sysconfig/varnish > file I check with varnish and without varnish but found without > varnish is faster then with varnish. Just a couple of comments about your vcl_recv(), although I don't know if these things explain your performance problem. ### To check URL we have jp.test12.com and img/static.test12.com, if (req.http.host ~ "^(www)?jp.test12.com$") { set req.backend = web; } else { set req.backend = static; } Unless your host might really be named wwwjp.test12.com, then you probably want that to be "^(www\.)?jp.test12.com$". ### For caching all if (req.url ~ "^/"){ return (lookup); } ### Over ried default cache item if (req.url ~ "\.(png|gif|jpg|swf|css|js|html|htm)$") { return (lookup); } The first regex matches everything (unless you get a malformed request in which the path doesn't begin with '/', in which case it should be rejected with 400). The second clause never gets executed, although the same thing happens with those media types. But if you're trying to have Varnish handle them differently from other URLs, it isn't happening. HTH, 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/ iQIcBAEBCAAGBQJPQMjsAAoJEOUwvh9pJNURhEkP/2QUcgBzYHieco4wh0cdR9wx Qy5Gw99BvqM6PaaqD/f/3gkmuy5EEpqDJN0/AQpD70MvkcVocPlhHueM71FwyJOt Jq9FhRExWLA+SdkITnekSvB5WNoE8bL9xaHzn1nNaHMnWS6ep23JOfkyDhRLdsUH +88WxKy3kqsW4HaEIVDeJjiONuk84KpO9AO1csFCKeSll5e3mBrQqw6CIwVXAlSv pPRcQCAuB6sdZLeGc59zmu+I7+lMwH7ciAl/wzN/8OGpjAd4UXe/RnLNfIpHc08T 2ZnEjWBKZ35IKQVq9/oM96ivpXQiaB+5gju+n6hKrIyA9lkm8APBLfXZBJ4jYRFW ikX7FIaYQMZatJ+oTIunpcTsVsZ7XMPv16qhA37AdYZQLkzOt4C0OlJ474JX1NFq VEfaxcH+IXrhx/UcygSgXsRYuzM9XOgf+L67e38s73nHjDGdpMYVl0JBv9SfIr5t u3T7hBlJiHxhLBLzyiDJtN+lzY+cpooH1vo7Jvv058IA/LoRC1MD437TX71uYUo/ hONGi+ArXI9RH6lns9B85cwrdBs592mtgXa4cR6+fEHR5aEQlR9frmw5B1gmPlPd phbiGCsHx6H62BbuzCggF1eToGK6M4eAE01BDb+/IDJ4YCwB7CRvu/3KYUFZzDSf b0GCGp00vGC7SxtxuSHz =n1is -----END PGP SIGNATURE----- From jim.hayter at gmail.com Mon Feb 20 17:14:45 2012 From: jim.hayter at gmail.com (Jim Hayter) Date: Mon, 20 Feb 2012 12:14:45 -0500 Subject: Updating from 2.0.5 to 3.0.0 - some questions In-Reply-To: References: Message-ID: Thank you both for your responses. The list of parameter and syntax changes at xcir.net were very helpful. Lee, I appreciate the warning about the headers. ?I was already worried about that as I had to build 2.0.5 with '--with-max-header-fields=200' due to the amount of headers our pages sometimes use. Thanks again, Jim On Fri, Feb 17, 2012 at 11:44 PM, Lee Trout wrote: > Jim, > > Make sure you adjust the new run time?http_req_hdr_len and?http_resp_hdr_len > if you're site (or clients) send large headers. We discovered that our > headers were averaging 8-12kb which is 2-3x the default 4096 bytes. > > That was a tricky one for us to sort out since only certain clients had the > large cookie headers and the 413 errors were intermittent in varnishlog. > > Lee > > > 2012/2/17 kokoniimasu >> >> Hi Jim, >> >> you're working varnish is 2.0.5? 2.1.5? >> >> if varnish is 2.0.X. refer to this url.(sorry Japanese. but I put an >> English comment) >> >> >> ?http://wiki.xcir.net/index.php?title=Versuin2.0.x%E2%86%922.1.x%E3%81%B8%E3%81%AEVUP >> >> -- >> Syohei Tanaka(@xcir) >> http://xcir.net/ >> >> (:3[__]) >> >> >> 2012?2?18?2:37 Jim Hayter : >> > I am working on upgrading from Varnish 2.0.5 running on Ubuntu 9.10 to >> > Varnish 3.0.0 running on Ubuntu 11.10. >> > >> > I have a few questions based on my reading of >> > https://www.varnish-cache.org/trac/browser/doc/changes.rst >> > >> > 1) Changes from 2.1.5 to 3.0 beta 1 states: >> > >> > ? - The -l (shared memory log file) argument has been changed, please >> > see the varnishd manual for the new syntax. >> > ? ? 'man varnishd' for 2.0.5 states: >> > >> > ? ? -l shmlogsize >> > ? ? ? ? ? ? ? ? Specify size of shmlog file. ?Scaling suffixes like 'k', >> > 'm' >> > ? ? ? ? ? ? ? ? can be used up to (e)tabytes. ?Default is 80 Megabytes. >> > ? ? ? ? ? ? ? ? Specifying less than 8 Megabytes is unwise. >> > >> > ? ?'man varnishd' for 3.0.0 states the same thing. ?And it appears to >> > be working. ?What changed? >> > >> > >> > 2) I'm also a bit confused by this code in vcl_fetch: >> > >> > ? ?if (beresp.ttl <= 0s || >> > ? ? ? ?beresp.http.Set-Cookie || >> > ? ? ? ?beresp.http.Vary == "*") { >> > ? ? ? ?/* >> > ? ? ? ? * Mark as "Hit-For-Pass" for the next 2 minutes >> > ? ? ? ? */ >> > ? ? ? ?set beresp.ttl = 120 s; >> > ? ? ? ?return (hit_for_pass); >> > ? ?} >> > >> > ? ?What is the purpose of "set beresp.ttl = 120 s;" ? ?So, the >> > purpose is to mark as "Hit-For-Pass" for 2 minutes, but why is this >> > done (what does it accomplish)? >> > >> > 3) I've noted that a number of the parameter values I used to set have >> > become defaults. ?I also noted the change to make thread_pool_min and >> > thread_pool_max agree better. ?Aside from these and some other changes >> > (purge to ban, obj to beresp), are there particular changes I should >> > look at closely to avoid problems when I update? >> > >> > 4) Is there additional doc I should review (besides >> > https://www.varnish-cache.org/trac/browser/doc/changes.rst) that would >> > help me avoid problems and understand what has changed? >> > >> > Thanks for any suggestions. >> > >> > Jim >> > >> > _______________________________________________ >> > 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 jewel.nuruddin at eastbeam.co.jp Tue Feb 21 02:50:40 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Tue, 21 Feb 2012 11:50:40 +0900 Subject: varnish caching issue Message-ID: Hello Is varnish are able to cache the both URL pages http://www.abcd.com/news/ http://www.abcd.com/toppage.html Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From apj at mutt.dk Tue Feb 21 08:15:37 2012 From: apj at mutt.dk (Andreas Plesner Jacobsen) Date: Tue, 21 Feb 2012 09:15:37 +0100 Subject: varnish caching issue In-Reply-To: References: Message-ID: <20120221081537.GN12685@nerd.dk> On Tue, Feb 21, 2012 at 11:50:40AM +0900, Jewel Nuruddin wrote: > Is varnish are able to cache the both URL pages > http://www.abcd.com/news/ > http://www.abcd.com/toppage.html Yes. Did you read the tutorial? -- Andreas From pablo at thenextweb.com Tue Feb 14 14:15:05 2012 From: pablo at thenextweb.com (=?ISO-8859-1?Q?Pablo_Rom=E1n?=) Date: Tue, 14 Feb 2012 15:15:05 +0100 Subject: Assert error in vfp_esi_bytes_gg() Message-ID: I'm experiencing the same issue described above. It seems to happen only when certain urls return a 404 error. Feb 10 21:43:47 nextweb varnishd[17427]: Child (25119) Panic message: Assert error in vfp_esi_bytes_gg(), cache_esi_fetch.c line 273:#012 Condition(i >= VGZ_OK) not true.#012thread = (cache-worker)#012ident = Linux,2.6.24-23-xen,x86_64,-smalloc,-smalloc,-hcritbit,epoll#012Backtrace:#012 0x42c7a6: /usr/sbin/varnishd [0x42c7a6]#012 0x41b877: /usr/sbin/varnishd [0x41b877]#012 0x41c278: /usr/sbin/varnishd [0x41c278]#012 0x421a75: /usr/sbin/varnishd(FetchBody+0x875) [0x421a75]#012 0x4153e8: /usr/sbin/varnishd [0x4153e8]#012 0x417ab6: /usr/sbin/varnishd(CNT_Session+0x9f6) [0x417ab6]#012 0x42efb8: /usr/sbin/varnishd [0x42efb8]#012 0x42e19b: /usr/sbin/varnishd [0x42e19b]#012 0x7fe6cac2485a: /lib64/libpthread.so.0 [0x7fe6cac2485a]#012 0x7fe6ca98e22d: /lib64/libc.so.6(clone+0x6d) [0x7fe6ca98e22d]#012sp = 0x7fe6bfa7a008 {#012 fd = 19, id = 19, xid = 184766452,#012 client = 81.0.234.33 38058,#012 step = STP_FETCHBODY,#012 handling = deliver,#012 err_code = 404, err_reason = (null),#012 restarts = 0, esi_level = 0#012 flags = do_esi is_gzip#012 bodystatus = 4#012 ws = 0x7fe6bfa7a080 { #012 id = "sess",#012 {s,f,r,e} = {0x7fe6bfa7ac90,+664,(nil),+65536},#012 } Does anyone have an idea about how to fix it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From savetheinternet at tinyboard.org Wed Feb 15 06:22:06 2012 From: savetheinternet at tinyboard.org (Savetheinternet) Date: Wed, 15 Feb 2012 17:22:06 +1100 Subject: Can varnish listen 80 and 443 port at the same time In-Reply-To: References: Message-ID: On Wed, Feb 15, 2012 at 2:22 PM, Jewel Nuruddin wrote: > Hi > Is it possible to run varnish 80 and 443 port at the same time? > If yes then how? > My site is running both http:// and https:// > Please help me. > > Thanks > Jewel > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc Hi, Although Varnish doesn't do SSL, you could put a minimal httpd in front of it to handle HTTPS connections. I use nginx and HttpProxyModule for this. Thanks, Michael From kotti.sasikanth at gmail.com Thu Feb 16 07:22:01 2012 From: kotti.sasikanth at gmail.com (Sasikanth Kotti) Date: Thu, 16 Feb 2012 01:22:01 -0600 Subject: Header error for Varnish Install in CentOS Message-ID: <3F17F0C2-5E81-4081-89FA-B60181DAD033@gmail.com> Hello, It appears we are receiving header errors when installing Varnish on CentOS. Please find below the messages [root at localhost yum.repos.d]# rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm [root at localhost yum.repos.d]# yum install varnish Setting up Install Process Setting up repositories varnish-3.0 100% |=========================| 951 B 00:00 Reading repository metadata in from local files primary.xml.gz 100% |=========================| 8.9 kB 00:00 varnish-3.: ################################################## 33/33 Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for varnish to pack into transaction set. varnish-3.0.2-1.el5.x86_6 100% |=========================| 501 kB 00:01 http://repo.varnish-cache.org/redhat/varnish-3.0/el5/x86_64/varnish-3.0.2-1.el5.x86_64.rpm: [Errno -1] Header is not complete. Trying other mirror. Error: failure: varnish-3.0.2-1.el5.x86_64.rpm from varnish-3.0: [Errno 256] No more mirrors to try. [root at localhost yum.repos.d]# [root at localhost yum.repos.d]# uname -a Linux localhost.localdomain 2.6.9-103.ELsmp #1 SMP Fri Dec 9 04:43:08 EST 2011 x86_64 x86_64 x86_64 GNU/Linux Thanks?.. From benjamin.jorand at gmail.com Tue Feb 21 17:08:39 2012 From: benjamin.jorand at gmail.com (Benjamin Jorand) Date: Tue, 21 Feb 2012 18:08:39 +0100 Subject: Assert error in vfp_esi_bytes_gg() In-Reply-To: References: Message-ID: Hello, Same issue here with varnish 3.0.2. Syslog output : Feb 21 15:28:15 xo varnishd[11230]: Child (16362) died signal=6 Feb 21 15:28:15 xo varnishd[11230]: Child (16362) Panic message: Assert error in vfp_esi_bytes_gg(), cache_esi_fetch.c line 273: Condition(i >= VGZ_OK) not true. thread = (cache-worker) ident = Linux,2.6.35.13,x86_64,-smalloc,-smalloc,-hcritbit,epoll Backtrace: 0x42e678: /usr/sbin/varnishd() [0x42e678] 0x41d315: /usr/sbin/varnishd() [0x41d315] 0x41d45b: /usr/sbin/varnishd() [0x41d45b] 0x4237ab: /usr/sbin/varnishd(FetchBody+0x98b) [0x4237ab] 0x417ff0: /usr/sbin/varnishd() [0x417ff0] 0x418f95: /usr/sbin/varnishd(CNT_Session+0x5d5) [0x418f95] 0x430e28: /usr/sbin/varnishd() [0x430e28] 0x42fff9: /usr/sbin/varnishd() [0x42fff9] 0x7f245a5928ba: /lib/libpthread.so.0(+0x68ba) [0x7f245a5928ba] 0x7f245a2fa02d: /lib/libc.so.6(clone+0x6d) [0x7f245a2fa02d] sp = 0x7f1c75f2e008 { fd = 72, id = 72, xid = 1178213161, client = xxxxx 51138, step = STP_FETCHBODY, handling = deliver, err_code = 206, err_reason = (null), restarts = 0, esi_level = 0 flags = do_esi do Feb 21 15:28:15 xo varnishd[11230]: Child cleanup complete Feb 21 15:28:15 xo varnishd[11230]: child (29746) Started Feb 21 15:28:15 xo varnishd[11230]: Child (29746) said Child starts Thanks, Le 17 f?vrier 2012 14:50, Pablo Rom?n a ?crit : > Hi there, > > I'm having the same issue described above regarding Vanish dying with the > error: Panic message: Assert error in vfp_esi_bytes_gg(), > cache_esi_fetch.c line 273:#012 Condition(i >= VGZ_OK) not true. > > In my case, it happens only when a certain url pattern is met. This > pattern should normally resolve with a 404, but instead the server responds > with an Error 324 (net::ERR_EMPTY_RESPONSE) and then Varnish dies, > throwing the aforementioned error. I'm using Varnish 3.0.2 with ESI. Has > someone experienced this before or have any tips on how to debug it? > > Thanks, > > -- > --- > > Pablo Rom?n > http://thenextweb.com > > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Benjamin Jorand (benjamin.jorand at gmail.com) +33.681460331 -------------- next part -------------- An HTML attachment was scrubbed... URL: From benjamin.jorand at gmail.com Tue Feb 21 17:25:51 2012 From: benjamin.jorand at gmail.com (Benjamin Jorand) Date: Tue, 21 Feb 2012 18:25:51 +0100 Subject: Assert error in vfp_esi_bytes_gg() In-Reply-To: References: Message-ID: We have been able to solve this issue : vcl lacked a library include for some C code. Check that vcl can be loaded without warning (varnishadm vcl.load) Le 21 f?vrier 2012 18:08, Benjamin Jorand a ?crit : > Hello, > > Same issue here with varnish 3.0.2. > > Syslog output : > > Feb 21 15:28:15 xo varnishd[11230]: Child (16362) died signal=6 > Feb 21 15:28:15 xo varnishd[11230]: Child (16362) Panic message: Assert > error in vfp_esi_bytes_gg(), cache_esi_fetch.c line 273: Condition(i >= > VGZ_OK) not true. thread = (cache-worker) ident = > Linux,2.6.35.13,x86_64,-smalloc,-smalloc,-hcritbit,epoll Backtrace: > 0x42e678: /usr/sbin/varnishd() [0x42e678] 0x41d315: /usr/sbin/varnishd() > [0x41d315] 0x41d45b: /usr/sbin/varnishd() [0x41d45b] 0x4237ab: > /usr/sbin/varnishd(FetchBody+0x98b) [0x4237ab] 0x417ff0: > /usr/sbin/varnishd() [0x417ff0] 0x418f95: > /usr/sbin/varnishd(CNT_Session+0x5d5) [0x418f95] 0x430e28: > /usr/sbin/varnishd() [0x430e28] 0x42fff9: /usr/sbin/varnishd() [0x42fff9] > 0x7f245a5928ba: /lib/libpthread.so.0(+0x68ba) [0x7f245a5928ba] > 0x7f245a2fa02d: /lib/libc.so.6(clone+0x6d) [0x7f245a2fa02d] sp = > 0x7f1c75f2e008 { fd = 72, id = 72, xid = 1178213161, client = xxxxx > 51138, step = STP_FETCHBODY, handling = deliver, err_code = 206, > err_reason = (null), restarts = 0, esi_level = 0 flags = do_esi do > Feb 21 15:28:15 xo varnishd[11230]: Child cleanup complete > Feb 21 15:28:15 xo varnishd[11230]: child (29746) Started > Feb 21 15:28:15 xo varnishd[11230]: Child (29746) said Child starts > > Thanks, > > Le 17 f?vrier 2012 14:50, Pablo Rom?n a ?crit : > >> Hi there, >> >> I'm having the same issue described above regarding Vanish dying with the >> error: Panic message: Assert error in vfp_esi_bytes_gg(), >> cache_esi_fetch.c line 273:#012 Condition(i >= VGZ_OK) not true. >> >> In my case, it happens only when a certain url pattern is met. This >> pattern should normally resolve with a 404, but instead the server responds >> with an Error 324 (net::ERR_EMPTY_RESPONSE) and then Varnish dies, >> throwing the aforementioned error. I'm using Varnish 3.0.2 with ESI. Has >> someone experienced this before or have any tips on how to debug it? >> >> Thanks, >> >> -- >> --- >> >> Pablo Rom?n >> http://thenextweb.com >> >> >> _______________________________________________ >> varnish-misc mailing list >> varnish-misc at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >> > > > > -- > Benjamin Jorand (benjamin.jorand at gmail.com) > +33.681460331 > -- Benjamin Jorand (benjamin.jorand at gmail.com) +33.681460331 -------------- next part -------------- An HTML attachment was scrubbed... URL: From TFigueiro at au.westfield.com Thu Feb 23 04:21:40 2012 From: TFigueiro at au.westfield.com (Thiago Figueiro) Date: Thu, 23 Feb 2012 04:21:40 +0000 Subject: varnishlog 2.1.5 record limit Message-ID: <22F96A574165AA4482FF290947347774208544DE@AUPDC00-MBX01P.au.ad.westfield.com> 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). ______________________________________________________ From jewel.nuruddin at eastbeam.co.jp Thu Feb 23 06:29:42 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 23 Feb 2012 15:29:42 +0900 Subject: About response header and request header condition Message-ID: Hello all I have one questions in my VCL configuration sub vcl_recv { ### pass if http hearder response is "SMARTPHONE:1" if (req.http.SMARTPHONE ~ "1") { return (pass); } } in my page I set the above header response so if the responses match it will not cache but it always cache? can some one help me why ? One more question, can varnish identified for caching or not caching both in http header "response" and "request"? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From varnish at mm.quex.org Thu Feb 23 07:22:20 2012 From: varnish at mm.quex.org (Michael Alger) Date: Thu, 23 Feb 2012 15:22:20 +0800 Subject: About response header and request header condition In-Reply-To: References: Message-ID: <20120223072220.GA9130@grum.quex.org> On Thu, Feb 23, 2012 at 03:29:42PM +0900, Jewel Nuruddin wrote: > in my VCL configuration > > sub vcl_recv { > > ### pass if http hearder response is "SMARTPHONE:1" > if (req.http.SMARTPHONE ~ "1") { > return (pass); > } > } > > in my page I set the above header response so if the responses match it > will not cache > but it always cache? can some one help me why ? The "req" object refers to the headers sent in the client request. It's unlikely the browser on any device sends a header named "SMARTPHONE", so that's the reason it won't be matching. > One more question, can varnish identified for caching or not caching both > in http header "response" and "request"? Yes it can. The response object is generally called "beresp". However you can't access it in vcl_recv, since vcl_recv is called when the client request is initially received - there hasn't been a response from the backend at this point. vcl_recv is used to rewrite the request and tell Varnish whether it should try to look up the object in cache or go direct to the server, as well as selecting which backend to use. When you return (lookup) you instruct Varnish to look the object up in its cache, and if it fails to try to fetch it from the backend. You'll therefore want to make your determination as to whether or not to cache the response in vcl_fetch, which is called immediately after Varnish has fetched an object from the backend server. From here you can access the "beresp" object and decide whether or not you want to cache the response based on any attribute of it, including the response HTTP headers. However: It will still be possible for smartphones to have a page served to them from the cache. For example if the index page of www.example.com returns different content based on the user-agent, if a regular (non-smartphone) browser accesses the site, Varnish will cache the response. If a phone then requests it, Varnish will just serve the previously generated response from its cache. This is because you haven't told Varnish that requests from "smartphones" need to be treated differently - only that responses sent to a device the backend identified as a smartphone should not be cached. If you're able to, I'd suggest moving whatever logic the backend uses to determine if a device is a smartphone out of the backend and into Varnish, using VCL if possible. This way, Varnish can determine what it's supposed to do with the request, serving everything it can from cache and only going to the backend if it really needs to. If the determination can _only_ happen on the backend, then you're going to be forced to send every request that might _possibly_ be from a smartphone or other "special" device back to the backend, largely negating the benefits of having Varnish in the first place. From jewel.nuruddin at eastbeam.co.jp Thu Feb 23 07:47:12 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Thu, 23 Feb 2012 16:47:12 +0900 Subject: About response header and request header condition In-Reply-To: <20120223072220.GA9130@grum.quex.org> References: <20120223072220.GA9130@grum.quex.org> Message-ID: Nice explanation. Thank you very much. This really clear some of my though about some vcl function. Thanks Jewel On Thu, Feb 23, 2012 at 4:22 PM, Michael Alger wrote: > On Thu, Feb 23, 2012 at 03:29:42PM +0900, Jewel Nuruddin wrote: > > in my VCL configuration > > > > sub vcl_recv { > > > > ### pass if http hearder response is "SMARTPHONE:1" > > if (req.http.SMARTPHONE ~ "1") { > > return (pass); > > } > > } > > > > in my page I set the above header response so if the responses match it > > will not cache > > but it always cache? can some one help me why ? > > The "req" object refers to the headers sent in the client request. > It's unlikely the browser on any device sends a header named > "SMARTPHONE", so that's the reason it won't be matching. > > > One more question, can varnish identified for caching or not caching both > > in http header "response" and "request"? > > Yes it can. The response object is generally called "beresp". However > you can't access it in vcl_recv, since vcl_recv is called when the > client request is initially received - there hasn't been a response > from the backend at this point. vcl_recv is used to rewrite the > request and tell Varnish whether it should try to look up the object > in cache or go direct to the server, as well as selecting which > backend to use. When you return (lookup) you instruct Varnish to look > the object up in its cache, and if it fails to try to fetch it from > the backend. > > You'll therefore want to make your determination as to whether or not > to cache the response in vcl_fetch, which is called immediately after > Varnish has fetched an object from the backend server. From here you > can access the "beresp" object and decide whether or not you want to > cache the response based on any attribute of it, including the > response HTTP headers. > > However: > > It will still be possible for smartphones to have a page served to > them from the cache. For example if the index page of www.example.com > returns different content based on the user-agent, if a regular > (non-smartphone) browser accesses the site, Varnish will cache the > response. If a phone then requests it, Varnish will just serve the > previously generated response from its cache. This is because you > haven't told Varnish that requests from "smartphones" need to be > treated differently - only that responses sent to a device the backend > identified as a smartphone should not be cached. > > If you're able to, I'd suggest moving whatever logic the backend uses > to determine if a device is a smartphone out of the backend and into > Varnish, using VCL if possible. This way, Varnish can determine what > it's supposed to do with the request, serving everything it can from > cache and only going to the backend if it really needs to. > > If the determination can _only_ happen on the backend, then you're > going to be forced to send every request that might _possibly_ be from > a smartphone or other "special" device back to the backend, largely > negating the benefits of having Varnish in the first place. > > _______________________________________________ > 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 arboeglin at herffjones.com Tue Feb 21 18:45:02 2012 From: arboeglin at herffjones.com (Boeglin, Adam R) Date: Tue, 21 Feb 2012 18:45:02 +0000 Subject: Varnish Maximum Cache Size Message-ID: We're currently looking into our options in regards to caching data for a new application. Varnish seems to be a good solution, but I haven't found much information in regards to the maximum cache size. We will be serving 10's of thousands of users with potentially 800GB-1TB of "hot" data in millions of files. How does varnish scale with large cache sizes, both in terms of the amount of files, and the size of the total cache? This is assuming the hardware to support such an operation is in place. Thanks, Adam From phk at phk.freebsd.dk Thu Feb 23 11:26:23 2012 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Thu, 23 Feb 2012 11:26:23 +0000 Subject: Varnish Maximum Cache Size In-Reply-To: Your message of "Tue, 21 Feb 2012 18:45:02 GMT." Message-ID: <12204.1329996383@critter.freebsd.dk> In message , "Boeglin , Adam R" writes: >We will be serving 10's of thousands of users with potentially >800GB-1TB of "hot" data in millions of files. I have heard of several sites with that kind of workload. It's not just plug-and-play, but it shouldn't give you any trouble. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From arboeglin at herffjones.com Thu Feb 23 13:47:59 2012 From: arboeglin at herffjones.com (Boeglin, Adam R) Date: Thu, 23 Feb 2012 13:47:59 +0000 Subject: Varnish Maximum Cache Size In-Reply-To: <12204.1329996383@critter.freebsd.dk> References: Your message of "Tue, 21 Feb 2012 18:45:02 GMT." <12204.1329996383@critter.freebsd.dk> Message-ID: <9419C6AEECF0024C9DDAF77FFA28815713560B@INUCEX1.herffjones.hj-int> >It's not just plug-and-play, but it shouldn't give you any trouble. Glad to hear. I had read something where varnish had scaling issues with objects counts ~ 1 million, but I can no longer find it. Also, it looks like that may have been resolved in the 2.1.3 release: https://www.varnish-software.com/blog/varnish-213-released From perbu at varnish-software.com Thu Feb 23 15:09:51 2012 From: perbu at varnish-software.com (Per Buer) Date: Thu, 23 Feb 2012 16:09:51 +0100 Subject: Varnish Maximum Cache Size In-Reply-To: <9419C6AEECF0024C9DDAF77FFA28815713560B@INUCEX1.herffjones.hj-int> References: <12204.1329996383@critter.freebsd.dk> <9419C6AEECF0024C9DDAF77FFA28815713560B@INUCEX1.herffjones.hj-int> Message-ID: On Thu, Feb 23, 2012 at 2:47 PM, Boeglin, Adam R wrote: > >It's not just plug-and-play, but it shouldn't give you any trouble. > > Glad to hear. > > I had read something where varnish had scaling issues with objects counts > ~ 1 million, but I can no longer find it. Also, it looks like that may > have been resolved in the 2.1.3 release: > https://www.varnish-software.com/blog/varnish-213-released 1M objects should not cause any trouble in itself. We routinely see 10s of millions of objects. Per. -- 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 jewel.nuruddin at eastbeam.co.jp Fri Feb 24 08:32:46 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 24 Feb 2012 17:32:46 +0900 Subject: Is it possible to take cache decision from response header Message-ID: Hi all, I set a response header in my application(VARNISH-CACHE), so I want varnish to cache only those which have that response header. Is it possible by varnish ? Please help me. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugues.alary at gmail.com Fri Feb 24 08:37:35 2012 From: hugues.alary at gmail.com (Hugues Alary) Date: Fri, 24 Feb 2012 00:37:35 -0800 Subject: Is it possible to take cache decision from response header In-Reply-To: References: Message-ID: Yes. In your vcl_fetch: vcl_fetch { if(beresp.http.X-DoNotCache) { set beresp.ttl = 0; } } On Fri, Feb 24, 2012 at 12:32 AM, Jewel Nuruddin < jewel.nuruddin at eastbeam.co.jp> wrote: > Hi all, > > I set a response header in my application(VARNISH-CACHE), so I want > varnish to cache only those which have that response header. > Is it possible by varnish ? > Please help me. > > Thanks > Jewel > > _______________________________________________ > varnish-misc mailing list > varnish-misc at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Hugues ALARY -------------- next part -------------- An HTML attachment was scrubbed... URL: From jewel.nuruddin at eastbeam.co.jp Fri Feb 24 09:38:19 2012 From: jewel.nuruddin at eastbeam.co.jp (Jewel Nuruddin) Date: Fri, 24 Feb 2012 18:38:19 +0900 Subject: About logging user information is viewed by another user Message-ID: Hello Today i faced one problem that through my varnish I checked if user is log in then nothing will be cached--> this is working fine. But the problem that I logged in by user1 and browse some pages. And user2 is also logged in from another pc and browse some pages. When user1 log out and click Back Button(Browser back button) this user get users2 information. why this is happen? Can any one have some Idea? My scenario is Default cache is working. Log in user(I set HTTP response header) --> check this header and do not cache---> this is also working. Thanks Jewel -------------- next part -------------- An HTML attachment was scrubbed... URL: From roberto.fernandezcrisial at gmail.com Fri Feb 24 10:10:48 2012 From: roberto.fernandezcrisial at gmail.com (=?utf-8?B?Um9iZXJ0byBPLiBGZXJuw6FuZGV6IENyaXNpYWw=?=) Date: Fri, 24 Feb 2012 10:10:48 +0000 Subject: About logging user information is viewed by another user In-Reply-To: References: Message-ID: <1645535052-1330078251-cardhu_decombobulator_blackberry.rim.net-1889352864-@b26.c27.bise6.blackberry> Jewel, does BE response contain "set-cookie" header? If cached object contains set-cookie header, maybe you're setting it to all users. You can.. "Pass" the "logged" pages, or think about use ESI boxes for user's information. Best regards, Roberto @rofc -----Original Message----- From: Jewel Nuruddin Sender: varnish-misc-bounces at varnish-cache.org Date: Fri, 24 Feb 2012 18:38:19 To: Subject: About logging user information is viewed by another user _______________________________________________ varnish-misc mailing list varnish-misc at varnish-cache.org https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc From vedad at kigo.net Wed Feb 29 13:16:17 2012 From: vedad at kigo.net (Vedad KAJTAZ, Kigo Inc.) Date: Wed, 29 Feb 2012 14:16:17 +0100 Subject: File served without vcl_fetch() being invoked. Message-ID: <4F4E2521.7040606@kigo.net> 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). The request doesn't appear in varnishlog/varnishncsa either, but the file IS requested from the backend by the varnish server, and IS being served to end client on nearly every request (with the exception of few requests where it actually does go through vcl_recv() and the cache). Environment: Back-end Apache server, Varnish 3.0.2 on FreeBSD 8.2 (amd64), Chrome client on Windows 7 with client cache disabled. No other proxy in between. The varnish cache listens on 87.98.213.163 port 80. The "page" being tested is http://marais-apartments.com/le_marais.html. I've altered the "hosts" file on the client to point the domain name to the above varnish IP address. Only one client is testing at a time. The varnish config file: http://pastebin.com/ZqM7A5LP Sample /var/log/syslog excerpt: http://pastebin.com/YiWfCqtJ Note that the GET request to the file /img/4aa49f0874eb11168795c4f9a904c62d2b33d4cc947b3207a9d43e7c4a6e963d.png does not appear in syslog (hence does not go through vcl_fetch), nor does it appear in varnishlog/varnishncsa. However, the file IS being requested from the backend. This is the excerpt from the back-end server related to the above request: http://pastebin.com/kmUghduu Is this normal behavior, a misconfiguration, or a bug? I will gladly provide more information upon request. Regards, -- Vedad KAJTAZ -------------- 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 sahmed1020 at gmail.com Wed Feb 29 22:27:39 2012 From: sahmed1020 at gmail.com (S Ahmed) Date: Wed, 29 Feb 2012 17:27:39 -0500 Subject: invalidating a page using ruby Message-ID: How would you go about invalidating a cache with ruby? 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?) -------------- next part -------------- An HTML attachment was scrubbed... URL: