4/29ã«å ¨ä¸çåæã§Varnish4ã®ãªãªã¼ã¹ãã¼ãã£ã¼ãããã¾ãã¦ãæ±äº¬ããããã¼ã¨ãããã¨ã§ã¯ãã¯ãããæ§ã§ãã¶é£ã¹ãªããçºè¡¨ãã¦ãã¾ããã v4rpã®ã¿ã°ãçºãã¦ããã¨éå¤BBQããªãããããã¯å£ã«æå½±ãã¦ããã¨ããããã£ããã¨ãªããªãè¯ãæãã§ããã ã§ãååã¨åæ§ã«Varnish4ã§ã®æ°æ©è½ãå¤æ´ç¹ãçºè¡¨ãããã¨æãã¾ãã¦ãGWããããã¨è³æãã®ãã³ãæ¸ãã¦ã¾ãããçµå±å°»ã«ç«ãã¤ãã¦ãã¾ã£ã¦åæ¥ãããã¾ã§ã¬ãªã¬ãªæ¶ç®ã§æ¸ãã¦ãã¾ããã 2->3ã®æãæ¶ç®ã ã£ãè¨æ¶ãããã®ã§ãããä»åã¯å¤æ´ç¹ãããªãå¤ããã¨ãããã¾ãã¦ãéä¸ã§ããéã«åããããªã»ã»ã»ã¨ãããããäºãã»ã» ã¨ãããã¨ã§ãã¾ãçºè¡¨ç·´ç¿ãåºæ¥ãªãã£ãã®ã§ãèãè¦ããã¨ãããããã¾ãããç³ã訳ããã¾ããã§ããã ã§ãç§ã®çºè¡¨è³æã¯ãã¡ãã§ãã GoogleDocsç(ã¢ãã¡ã¼ã·ã§ã³ãã) ã¾ããçºè¡¨ã®éã«å¿ãã¦ãã¦è§¦ã
Shin x blog Advent Calendar 2013 ã® 6 æ¥ç®ã§ãã ã¨ãããµã¤ãã«ãVarnish ããªãã¼ã¹ãããã·ã¨ãã¦å°å ¥ãã¦ãåå¹´ãçµéãã¾ããã å°å ¥ããçµç·¯ããã®å¹æãªã©æ¸ãã¦ã¿ããã¨æãã¾ãã Varnish ã¨ã¯ Varnish ã¯ãHTTP ã¢ã¯ã»ã©ã¬ã¼ã¿ã§ããWeb ãµã¼ãã®ãªãã¼ã¹ãããã·ã¨ãã¦åä½ãããã£ãã·ã¥ãçããã¦é«ãããã©ã¼ãã³ã¹ãçºæ®ããã®ãç¹å¾´ã§ããã¾ããVCL ã¨ããç¬èªã®è¨å®è¨èªãæã¡ãããã«ããç¶æ³ã«å¿ããè¨å®ãæè»ã«è¡ããã¨ãã§ãã¾ãã å°å ¥ã®çµç·¯ ãã®ãµã¤ãã§ã¯ LAMP æ§æã® CMS ãå©ç¨ãã¦ãããã¤ã³ãã©ã«ã¯ AWS ãå©ç¨ãã¦ãã¾ããåºæ¬ãé²è¦§ãä¸å¿ãªã®ã§ãããã¤ãã³ãæã«å¤æ°ã®ã¢ã¯ã»ã¹ãããã¾ããS3 ã CloudFront ãæ¤è¨ããã®ã§ãããã³ã³ãã³ããæ°åããã«æ´æ°ããå¿ è¦ãããã®ã§ä»åã¯æ¡ç¨ãã¾ããã§ãã
æè¤ã§ããããã«ã¡ã¯ã ååããèªãã§ãããWhat Your CDN Won't Tell You: Optimizing a News Website for Speed and Stabilityãã®å¾åãè¦ç´ããç§ãªãã®ã¡ãã£ã¨ãã解éããç´¹ä»ãã¾ãã (ï¼ï¼ååã®è¨äºãèªãã§ã¿ã) â»è¬è¾ã¨åèæç®ã¯çç¥ãã¾ã â»èª¤è¨³ãããè¯ã解éãããçããã¾ããããtwitterã® @koemu ã¾ã§ãç¥ãããã ããã CDNãç¨ãã¦ä½ããã¹ãã --- ãªãªã¸ã³ãµã¼ããå®å®ãã¦ããæ çè ãã¯ãæèå®é¨ã®çµæã次ã®åªå é ä½ã§ãã¥ã¼ãã³ã°ã«ãããäºã«ãã¾ããã 1: ãªãªã¸ã³ãµã¼ãã®å®å®æ§ 2: ã³ã³ãã³ãã®é®®åº¦ã®ç¢ºä¿ 3: ã·ã¹ãã ã®è¤éãã®æ¹å 4: ã³ã¹ã 1ã«ã¤ãã¦ã¯ãã©ããªç¶æ³ã§ãããã¨ãããªãªã¸ã³ãµã¼ããæ¢ã¾ã£ã¦ãã¾ã£ã¦ã¯ãã©ãã£ãã¯ãæãã¾ããã2ã«ã¤ãã¦ã¯ãã§ããéãæ°é®®ãªã³
ã¯ããã¾ãã¦ããµã¼ãåºç¤ãã¼ã ã®ç°ä¸ç¥¥å¹³(@xcir)ã§ãã æè¿å ¥ç¤¾ãã¾ãã¦ããã¼ã ã§ã¯ãããªã¡ããã¨å¼ã°ãã¦ãã¾ãããããããé¡ããã¾ãã å ¥ç¤¾ãã¦ããGREEã®é ä¿¡ã·ã¹ãã ãVarnish Cacheï¼ä»¥ä¸Varnishï¼ã«ç½®ãæããä»äºããã¦ããã®ã§ãããå°ãåã«åé¡ãªãå±±ãè¶ ãã¾ããã ããã§ä»åå©ç¨ããVarnishã®ç¹ã«ãã¹ãæ©è½ã«ã¤ãã¦ç´¹ä»ãããã¨æãã¾ãã ãªããä»åã®èª¬æã«å©ç¨ããVersionã¯3.0.3ã§ãã Varnishã¨ã¯ VCLã¨ãããã¡ã¤ã³åºæè¨èªããã¡ããã£ãã·ã¥ãã§ããé«éãªãã¼ã¹ãããã·ã§ãã ifæãæ¸ããã®ã§æè»ã«è¨è¿°ããããã¨ããç¹å¾´ãããã¾ãã ãã¨ãã°/admin/以ä¸ã«è¨±å¯ããIP以å¤ããã®ã¢ã¯ã»ã¹ã¯å¼¾ãã¨è¨ã£ããã¨ã¯ä»¥ä¸ã®ããã«è¨è¿°ã§ãã¾ãã
å æ¥ã社å ã§åå¼·ä¼ãããæã«çºè¡¨ããè³æï¼ã¡ãã£ã¨æ¹å¤ï¼ã§ãã æåã¯VMODãä½ãã¨ãã«ç¥ã£ã¦ããã¨æ¥½ãããªãããªãçãªãã¤ã³ãã解説ãããã¨æã£ããã§ãã ããããVMODã®ã¯ã³ãã¤ã³ããªãã社å çã«èª°å¾æ¥µã¾ããªãã®ã§ å ¬å¼ã§ãªã¹ãåããã¦ãVMODãç´¹ä»ãã¦ã¿ã¾ããã ãµã¼ãã¹å´ããã使ã£ã¦ã¿ããã£ã¦ã®ãããã°ãããªãã¨èãã¦ãã¾ãã
Varnishã§ãªãã¤ã¬ã¯ããè¡ãã®ã¯çµæ§ããã©ãããã§ãã ãã¨ãã°user-agentã«iphoneãipodãå«ãå ´åã«ããç¨ã®ãã¼ã¸ã«ãªãã¤ã¬ã¯ãããå ´åã¯ä»¥ä¸ã®ããã«ãªãã¾ã sub vcl_recv { if (req.http.user-agent ~ "iP(hone|od)") { error 750 "Moved Temporarily"; } } sub vcl_error { if (obj.status == 750) { set obj.http.Location = "http://www.example.com/iphoneversion/"; set obj.status = 302; return(deliver); } } (via:Redirecting using VCL) ãã ãªãã¤ã¬ã¯ããããã ããªã®ã«äºç®æã®ã¢ã¯ã·ã§ã³ã§ã³ã¼ããæ¸ããªãã¦ã¯ã
æ ¡æ£ã¯ä»ãããªã®ã§ããå稿å®æãã¾ããï¼ ãããç²ãã¾ããã»ã»ã» ãã¼ã¸æ°ã¯ 42 44ã¨æ³å®ä»¥ä¸ã«è¨ãã¿ã¾ããã ç¸å¤ãããæéåãã§å ¥ããããªãã£ãå 容ããã£ãããã¾ãã å 容ã確å®ãã¾ããã®ã§ç®æ¬¡ãå«ãã¦ãå度ãµã³ãã«ãä½ãã¾ããã®ã§æ¯éè¦ã¦ã¿ã¦ãã ããã å人çã«ã¯VMODã®ãã©ã¤ãã¼ããã¤ã³ã¿ï¼PRIV_VCL/CALLï¼ã®èª¬æã ããããããã§ããããããªããã¨èãã¦ãã¾ãã ã¹ãã¼ã¹ã¯ãããªã¾ãã¾ã 3æ¥ç® æ±å°åº R-33aã§ãã ä¾¡æ ¼ã¯500åã§CDé å¸ã§ãã ãªããããã ããå¯ããã®ã§ã¸ã£ã±ããå°å·ãããã§ããã©ããã¦ãããªã£ãæãã»ã»ã» ã¾ãä¸äººã§æãã¦ãã¨æãã®ã§å·ãããã ãã§ããããããã§ãã売ãåããè¦ã¤ããã¾ããï¼ ã§ã¯å½æ¥ãä¼ããã¾ãããï¼
å¤ã³ãã§å人èªã§ã ããVarnishCacheå ¥éã§ããPDFã§å ¬éãã¾ãã å¹¾ã¤ãå ¬éãããã£ãçç±ã¯ãã£ãã®ã§ãããå®éã³ãã±ã¾ã§è¶³ãéãã§è²·ã£ã¦ããã ããæ¹ã«ã¡ãã£ã¨ç³ã訳ãªãããªã¨ é»ååºçã§ã®ææé å¸ãèãã¦ããã®ã§ãã 64Pç¨åº¦ã§å¤§ããããªã¨ããã®ã¨ãããä¸ã¶æçµã£ã¦3.0.1ãåºããããããªã¨æãå ¬éãã¾ãã å 容çã«ã¯åå¿è åãã¨ãªã£ã¦ãã¾ãã®ã§ãããã¾ã§é«åº¦ãªå 容ã«ã¤ãã¦ã¯è¨è¿°ãã¦ãã¾ããã ãªã3.0.1ãå ¬éããããããã¼ã¸æ°ãå¤ãããªãç¯å²ã§ããã®å 容ã«ã¤ãã¦ãä¸é¨å çãã¦ãã¾ããï¼fallback directorã¨ãï¼ Varnishã使ã£ã¦ã¿ããã¨èãã¦ããæ¹ã®åèã«ãªãã°ã¨èãã¦ãã¾ãã PDFã®ãã¦ã³ãã¼ã ã¡ãªã¿ã«ãæéã¨å°å·è²»ã®é¢ä¿ã§æ¸ããããªãã£ãäºãããããããã®ã§ãã(転è¨ãããªããã©ã¡ã¼ã¿ãããvarnishtestã¨ãã»ã»ã»ï¼ ãããããã¨
çæ§ã³ãã±ãç²ãæ§ã§ããã ä»åå§è¨ãã¾ãããVarnish Cacheå ¥éãã§ããç¡äºã«å®å£²ãã¾ããã æ£ç´å ¨é¨æããã¨æã£ã¦ããªãã£ãã®ã§ãããè²·ã£ã¦ãã ãã£ããããããã¨ããããã¾ããã ãã¨ãã¤ãã¿ã¼ã§é販ããªããã§ããï¼ã¨ãã話ãåããã®ã§ããã å®å£²ãããã¨ããããç³ã訳ãªãã§ãããç´åªä½ãã§ã®å販ã¯æããããªãã¨æãã¾ãã ãã PDFãªã©ã®é»ååªä½ã§ã®é å¸ã¯ã¡ããã£ã¨èãã¦ãã¾ãã ããæ¹ããã¾ãã¡åãããªãã®ã§ããã¤ãããã»ãæ¬å½ã«ãããã¨ã¯è¨ããªãã®ã§æå¾ ããªãã§å¾ ã£ã¦ããããã¨ãããããã§ãã ã¾ãä¸ç¹å 容çãªèª¤ããããã¾ããç³ã訳ããã¾ããã ä»å¾å¤æ次第以ä¸ã®ãã¼ã¸ã«è¿½å ãã¦ããã¾ãã Varnich Cacheå ¥éè¨æ£ å¬ããªããåºããããããªã¨èãã¦ãã¾ãã®ã§ããã®æã¯ãã²ãããããé¡ããã¾ãã ãã¨ææ³ã¨ãããããã¨å¬ããã§ãã
ä¸åãããªã¿ã¤ãã«ã§æ¸ãã¦ã¿ããã£ããããªã¡ããã§ãã å¥ã«ããã ã注æãã¨ãï¼ã¨ããããã§ã¯ãªãã®ã§ãããã¨ãããããããªãããã§ã¾ã注æãã¦ãããããã¤ã³ãã«ä»ãã¦è§£èª¬ãã¾ãã Varnish3ã®æ°ãã©ã¡ã¼ã¿ã« shortlived ã¨ããã¢ããããã¾ãã ããã¯æå®TTLããçãç§æ°ãããã£ãã·ã¥ããªãå ´åãã³ãã©ãªã¹ãã¬ã¼ã¸ï¼Transient storageï¼ã«ä¿åããã¨ãããã®ã§ãã ããã¯TTLãçãå ´åãã®ã¹ãã¬ã¼ã¸ã«ä¿åãããã¨ã§ããã©ã¼ãã³ã¹ãããããã¨ãããã®ã§ãï¼å¤åï¼ ããã©ã¼ãã³ã¹ãããããã¨ãããã®ãªã®ã§ããã¤ã¯ã¡ã¢ãªã¹ãã¬ã¼ã¸ã§ç¢ºä¿ããã¾ã storage.list 200 Storage devices: storage.Transient =â â malloc â â storage.s0 = malloc åé¡ ä»¥ä¸ã®è¨å®ã®æTransientã¹ãã¬ã¼ã¸
ã¿ãªãããããã«ã¡ã¯ã 2010å¹´9æå ¥ç¤¾ã®UDAGAWAã§ãã ä»åã¯ãreverse proxyã®varnishã«é¢ãã¦è¨äºã æ¸ããã¦ããã ãã¾ãã â varnishã¨ã¯ é«æ§è½HTTPã¢ã¯ã»ã©ã¬ã¼ã¿ã§ãã åããããªæ©è½ãæã£ãsquidãã10ï½20åé«éã ã¨ãããã¨ã 売ãã®ã²ã¨ã¤ã ããã§ãã â èæ¯ Amebaã®ç»åé ä¿¡ã·ã¹ãã ã¯ãreverse proxyã¨ã㦠squid2.7 STABLEã®COSSã使ã£ãã·ã¹ãã ãå©ç¨ãã¦ãã¾ãã squid2.7èªä½ãå¤ããã¼ã¸ã§ã³ãªã®ã§ãã§ããã°ãã¼ã¸ã§ã³ã¢ãããããã¨ãã ãªã®ã§ãããç¾ç¶ squid3ç³»ããã¯cossã使ç¨ã§ããªããã¨ããã varnishãæ¤è¨¼ãã¦ãããã¨èããã®ããã£ããã§ãã â ãã¹ãç°å¢ CentOS5.5 Kernel 2.6.18-194.3.1.el5 Varnish 2.1.3 â ã¤ã³ã¹ãã¼ã«
Varnishåå¼·ä¼ Tokyo.vcl : ATND äºæ³ã«åãã¦æºå¡å¾¡ç¤¼ã¨ãªãã¾ãã¦ãç»å£ãåå ãã¦ä¸ãã£ãæ¹ãã¯ããè£æ¬ ã«å ¥ã£ã¦ã¾ã§åå ãå¸æãã¦ä¸ãã£ã¦ããã¿ãªãããããã¨ããããã¾ãããAWSã ã£ããFusionIOã ã£ããã¤ã³ãã©ã«é¢ãã£ã¦ããã¨ä¼ã£ã¦è©±ããããªããããªæ¹ãå¤ãããã£ããã£ã¦ 以ä¸ãç°¡åã§ã¯ããã¾ãããµããªã¼ãã¾ã¨ãã¦ããããã¨æãã¾ãã é ä¿¡ å³å¸ã®ç°å¢ã§ã¯ããã¾ãããé ä¿¡ãè¡ã£ã¦ããã¾ãããé³å£°çãã¾ãæ°ã«ãããã¨ãåºæ¥ã¦ããã¾ããããé²ç»ãæ®ãã¦ããã¾ãã åå ãªã¼ããã³ã°ã@PENGUINANA_ ããã®éä¸ã¾ã§ http://www.ustream.tv/recorded/15453305 å¾å @PENGUINANA_ ããã®éä¸ ãçµäº http://www.ustream.tv/recorded/15453834 çºè¡¨ çããã®çºè¡¨ã®æ å ±ãã¾ã¨
ãã£ãããé°å²æ°ã¨åãèå³ãæã£ãé¨åã ãã¾ã¨ãã¦ãã¾ãâ¦ã see also togetter: http://togetter.com/li/151585 @xcir ãã varnish 2.1 -> 3.0 ã®æ©è½å¤æ´ãªã©ãã¡ã¤ã³ã®è©±é¡ å°éç¨èªé£çºã§åºç«¯æ«ããæ°å³â¦ varnish ã¯ã ESI ããµãã¼ããã ESI ã¨ã¯ http://www.akamai.com/html/support/esi.html ã¦ãã¦ã©ãããã«ãããµã³ãã« http://labs.unoh.net/2011/02/varnishesi.html @phji ãã ãã¯ã·ã ãã¨ã㨠Squid ã§ãã£ãã·ã¥ã NginX ã§ãã£ã¹ãããã£ãåãã¦ããã®ã ãã varnish ãªã両æ¹ãå ¼ãããã¦ããããã®ã§ã¯ãªããï¼ ã¨ ã¾ã㯠Squid ãä¸æ© varnish ã«ãã¦è©¦ãã¦ã¿ã -> ããã
6/16ã®Varnish3.0ã®æ£å¼ãªãªã¼ã¹ã«åããã¦ãã¯ãã¯ãããã®ãªãã£ã¹ã§Varnishåå¼·ä¼ãéå¬ããã¾ããã ä¸çåå°ã§è¡ãããVarnish3.0ãªãªã¼ã¹ãã¼ãã£ã®ã²ã¨ã¤ã¨ãã¦åå¼·ä¼å¾ã«ãã¢ããã·ã¥ããããªããã¾ããã http://v3party.varnish-cache.org/
qpstudy#05ã§ã¾ãã¾ãVarnishã®LTãã¦ãã¾ããã æ¬å½ã¯Varnishã¨ãã¼ã¸ã§ã³ãå¶ç¶ä¸è´ãã¦ããTrafficServerã®è©±ããããã¨ãã¦ããã®ã§ããæ¤è¨¼æéãåããªãçµå±ã¾ãã»ã»ã»ã¨ããæã㧠ï¼ä»ä¸¡æ¹ã¨ã2.1.5ã§ãï¼ è©³ããå 容ã«ã¤ãã¦ã¯ãã£ã¨èª°ããã¾ã¨ãã¦ããã¦ãã¨æãã®ã§åã®ææ³ãªã© â ã¡ã¤ã³ã»ãã·ã§ã³ ãã£ã¹ããªãã¥ã¼ã·ã§ã³æ(ãã£ã¹ã©ã)ãï½ä¿ºã®OSããããªã«å¯æãããããªã(Linuxãã£ã¹ããªãã¥ã¼ã·ã§ã³ç·¨)ï½ ã¿ãªããã®æãåããã¹ã´ã¤ããããããã¾ã ä»åã¯ä»äºã ã¨CentOSã使ã£ã¦ãã¾ãããããèãã¦ä»ã®ã触ã£ã¦ã¿ããã¨æãã¾ãã ã¾ãã¯Gentooã®ã¤ã³ã¹ãã¼ã«ããã£ã¦ã¿ã¦åå¿è ããæãåºãããã¨æãã¾ã â LTãã¤ã³ãã©ã¨ã³ã¸ãã¢ã®ããã®Ustreamå ¥é @H_Shinonome ãã ãã¤ãæ©æããããªã¼ã¨æã£ã¦ããã®ã§ããæå¤ã¨ãª
2. èªå·±ç´¹ä» â ãããªã¡ãã(@xcir) â Varnishã好ãããã¦å°ãã¾ãï¼ â å æ¬æ¨ã¨ãã«ãããã¾ã â æ¬å½ã¯ä»æ¥TrafficServerã®è©±ããããã¨æã£ãã® ã§ããæ¤è¨¼ãéã«åããªãã¦ï¼ï¼ 絡ãã§ãããã¨åã³ã¾ãï¼ 3. Varnishã®ãã°ã®ä»çµã¿ ãã¡ã¤ã« ãã¤ããªã© ããããMW ãªã¯ã¨ã¹ããå¦çæ¯ã«æ¸ãè¾¼ããããã£ã¹ã¯IOã«å·¦å³ãããããã¾ãã ããããã®ãªã¯ã¨ã¹ããæ¥ãã¨ãã¤ããéãã£ãã BufferedLogsãªãã¦ã®ãããã¾ããã»ã»ã» å ±æã¡ã¢ãª ãã¡ã¤ã«ãªã© varnishd varnishncsa ãªã¯ã¨ã¹ããå¦çããvarnishdã¯ãã°ãé«éãªã¡ã¢ãªã«åºåãããã ä½éãªãã£ã¹ã¯ã«å½±é¿ããããã¨ãªãã¬ã¹ãã³ã¹ãè¿å´ã§ãã¾ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}