Which I talked at Rubykaigi 2013 is: https://speakerdeck.com/mirakui/high-performance-rails
JVMã¯ãããã¡ã¤ãªã³ã°ãå©ç¨ãã¦ã³ã¼ãã®æé©åãè¡ãã¾ãã対象ã¯é »ç¹ã«å©ç¨ãããã³ã¼ããã¹ã®ã¿ã§ããï¼å¾¹åºçã«è¡ããã¨ã§å¤§ããªå¹æãä¸ãã¦ãã¾ããJITã³ã³ãã¤ã«ãããã³ã¼ãã«é¢ãã¦ã¯ï¼ç¾å¨ã§ã¯å¤ãã®å ´é¢ã«ãã㦠(ãã®å²åãå¢ãã¤ã¤ããã¾ã) C++ã®å®è¡é度ãåé§ãã¦ãã¾ãã ãã®ãããªäºå®ã«ãé¢ãããJavaãä»ã§ãä½éãªãã©ãããã©ã¼ã ã¨ãã¦èªèããã¦ããã®ã¯ï¼ããããã¯åæãã¼ã¸ã§ã³ã®Javaãã©ãããã©ã¼ã ã§ã®çµé¨ãï¼æ´å²çãªè² ã®ãã¤ã¢ã¹ã¨ãã¦åãã¦ããããã§ãããã æ©ã¾ã£ãçµè«ãåºãåã«ï¼å®¢è¦³çãªè¦å°ã«ç«ã£ã¦ï¼ææ°ã®ããã©ã¼ãã³ã¹çµæãè©ä¾¡ããããã«ãå§ããã¾ãã 2. Java ã³ã¼ãã®ï¼è¡ã«ã¯ããèªä½ã§æå³ããã 次ã®çãã³ã¼ãè¡ãèãã¦ã¿ã¦ãã ããï¼ MyObject obj = new MyObject(); Javaéçºè ãªãã°èª°ã§ãåããããã«ï¼ãã®ã³ã¼ãã¯ãª
ã¡ããã©ï¼å¹´åã«ãé«è² è·ãµã¤ãã®ããã«ããã¯ãè¦ã¤ããã«ã¯ãã¨ããè¨äºãæ²è¼ãã¦ãã¾ããããã®æã®ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ã£ã¦çµæ§å¤§å¤ã§æ©ã¾ããã§ããããã¯ããã¾ãã¦ãæ°å ¥ãã®@pandax381ã§ãã ãã°ããã¯è¦ãã¦ããªããã® ããµã¤ãã®å¿çãé ããã¨ããåé¡ãçºçããå ´åããã®åå ã¯ã©ãã«ããã§ããããã Webã¢ããªã±ã¼ã·ã§ã³ã®å¦çã«æéãæãã£ã¦ãã DBãµã¼ãã«æããã¯ã¨ãªã¼ã®å¿çãé ã ãµã¼ãã®å¦çè½åãè¶ ãã¦ãã ãªã©ãªã©ãããã¤ãã®å¯è½æ§ãããã¾ããé常ãä¸ã«æãã¦ãããããªåé¡ã¯ãã¢ããªã±ã¼ã·ã§ã³ããµã¼ãã®ãã°ã調æ»ãããã¨ã§ãåå ãçªãæ¢ãããã¨ãã§ãã¾ãã ä¸æ¹ã§ããããã£ããã°ã®èª¿æ»ã ãã§ã¯ããã®åå ã«ãã©ãçããã¨ãã§ããªãã£ãããç¸å½ãªè¦å´ãä¼´ãã±ã¼ã¹ãããã¾ãã ãããµã¤ãã®ããæ¥ã®åºæ¥äº ã¤ãå æ¥ã®ãã¨ã§ãããKLabã®éå¶ãã¦ããæã½ã¼ã·ã£ã«ã²ã¼ã ã«ã¦ããµ
Make a note of it: Web tech, montaineering, and so on. Note: ãã®è¨äºã¯ã3年以ä¸åã«æ¸ããã¦ãã¾ããWebã®é²åã¯éãï¼æ å ±ã®æ£ç¢ºæ§ã¯èªå·±è²¬ä»»ã§å¤æãã¦ãã ããã ã¡ã¢æ¸ãã社å 説å¾ç¨ããHTTPãªã¯ã¨ã¹ããæ¸ããã¨é«éåã§ãããï¼ãã¦ã®ã¯ããèããã©ãããããã©ããã¦ããã£ã¦ã®ã(èªè¾¼å¾ æ©æéã¾ããã§)å ·ä½çãªæ°åãåºãã¦ããã¨ãæå¤ã¨å°ãªãã£ãã®ã§ã詳ããã¯åèãªã³ã¯ã«Go! Webãµã¤ããåæããWebã¢ã㪠PageSpeed Insights WebPagetest åèè³æãªã© Webããã©ã¼ãã³ã¹æé©åã®ããã®ã³ã¼ãã£ã³ã°ææ³, MOL @importã使ãã¹ãã§ãªãçç±, Screw-Axis ã¾ãHTTPãªã¯ã¨ã¹ããã³ã¹ããé«ãçç±ã§ãããã¾ãåæèªè¾¼ã§ããªãããã§ããããèªè¾¼ã«1ç§æããç»åA,B,Cãããã¨
Twitterãããã³ãã¨ã³ãã®ã¢ã¼ããã¯ãã£ãè¦ç´ããWebãã¼ã¸ã®èªã¿è¾¼ã¿é度ãæ¹åãããã¨ãããã°ã§æããã«ãã¦ãã¾ãã æ°ããã¢ã¼ããã¯ãã£ã§ã¯ãããã¾ã§Webãã©ã¦ã¶ä¸ã§JavaScriptã®å¦çã«ãã£ã¦è¡ã£ã¦ããWebãã¼ã¸ã®ã¬ã³ããªã³ã°ãè¦ç´ãããµã¼ãå´ã§ã¬ã³ããªã³ã°æ¸ã¿ã®HTMLãã¼ã¸ãéä¿¡ã表示ãããã¨ã«ãã¦ãã¾ããããã«ãã£ã¦Webãã¼ã¸ã®èªã¿è¾¼ã¿ããæåã®ãã¤ã¼ãã®è¡¨ç¤ºã¾ã§ã®æéãå¤§å¹ ã«ç縮ããããã¨ã«ãªãã¾ããã When we shipped #NewTwitter in September 2010, we built it around a web application architecture that pushed all of the UI rendering and logic to JavaScript running on our usersâ
ããã«ã¡ã¯ãéçºã»éç¨é¨ã®å·å£ã§ãã æè¿ã¯åå人ã¨ãã¦ç¹å¿æãéããã®ã§ä»ã®ãã¡ã«ã¨æè¡æ¤è¨¼ã«æãæ®ãã¦ããæ¯æ¥ãéããã¦ãã¾ããä»ã¾ã§æ©è½ã®ã¿ãç¥ã£ã¦ãã¦ãªããªãæãåºããªãã£ãå¤ãã®æ©è½ã«è§¦ãã¦ãããã³ã«æ°ããªçºè¦ãæããããã£ã¨æ©ãæ¤è¨¼ãã¦ããã°æ¥½ãã§ããã®ã«ã»ã»ã»ãã¨æããã¨ãããã§ãã ãã¦ãç¾å¨æ¤è¨¼ãã¦ããã®ã¯AmazonAutoScalingæ©è½ã«ã¤ãã¦ã§ããçºè¡¨å½æã¯è©±é¡ã«ãªãå¤ãã®äººãå®éã«ã¹ã±ã¼ãªã³ã°æ©è½ã試ããããã§ããããæè¿ã§ã®æ¤è¨¼ã»å®è¨¼ä¾ãå°ãªãã 2010/08/1以éã«è¡ãããAPIãã¼ã¸ã§ã³ã¢ãã以éã®æ¥æ¬èªã®æ å ±ã¯ç¹ã«å°ãªãã£ãçºã®ã§ä»åã®æ¤è¨¼ãè¡ãã¾ããããªãã以éã®æ¤è¨¼å 容ã«é¢ãã説æã«ã¤ãã¦ã¯åºæ¬çã«ãEC2ã¤ã³ã¹ã¿ã³ã¹ãAPIçµç±ã§æä½ã§ããç¨åº¦ã®AWSçµé¨è ããåºæºã¨ãã¦ãã¾ãã®ã§åºç¤çãªèª¬æã¯ããã¤ãçããã¦ããã ãã¦ãã¾ãã ãªããEC2
ããã ãè¦ãã°å¤§ä¸å¤«ï¼ã¼MySQLããã©ã¼ãã³ã¹ç£è¦ã®ããï¼ã¯ã¨ãªç·¨ï¼ ããã«ã¡ã¯ãã¤ã³ãã©æ å½æ°äººã® nob ã§ãã ãµã¼ãã¼ç£è¦ãã¼ã«ã§ MySQL ãç£è¦ãã¦ããã®ã«ãã¼ã¿ãå¤ããã¦æ´»ç¨ãã¦ããªããã¨ããæ¹ã¯ãã¾ãããï¼ãã®è±å¯ãªãã¼ã¿ãããã©ã¼ãã³ã¹ã»ãã¥ã¼ãã³ã°ã«æ´»ç¨ããªãæã¯ããã¾ãããä»åã¯ãµã¼ãã¼ç£è¦ãã¼ã«ã®ã°ã©ããèªã¿è§£ããå®æ¦çµé¨ãå ã«ããããã ãè¦ãã°å¤§ä¸å¤«ãã¨ãããããã¾ã¨ãã¦ã¿ã¾ããã ããã ãè¦ãã°å¤§ä¸å¤«ï¼ãã¯ã¨ãªç·¨ãï¼ã¤ã®ã¤ã¼ã¨ï¼ã¤ã®ã°ã©ã ï¼ãã®ï¼ï¼ç£è¦ãã¼ã«ãä½ãè¦ã¦ããã®ãç¥ã ï¼ãã®ï¼ï¼ç£è¦ã®ãã¢ãã°ã©ãï¼ç¹ã»ãã (Questions, Lock Waits 㨠Transaction Handler) ï¼ãã®ï¼ï¼ã°ã©ãã§ãã§ãã¯ãã SQL ãã¥ã¼ãã³ã° ( Select Type 㨠Handler) ã·ã³ãã«ã§ãå§ãããµã¼ãã¼ç£è¦ã°ã©ãåãã¼ã«
2012å¹´2æ16æ¥ããDevelopers Summit 2012ãã«ããã¦ã±ã³ãããã¸ã¿ã«ã¨ã³ã¿ãã¤ã³ã¡ã³ãã®ãã©ã³ã¬ã¹ã¿ã¸ãªæ¦ç¥å®¤ããã¼ã¸ã£ã¼ã®å»£ç°ç«å¹³æ°ãã大ãããã½ã¼ã·ã£ã«ã¢ããªããã©ã´ã³ã³ã¬ã¯ã·ã§ã³ãã®è£å´ï½è¶ é«ãã©ãã£ãã¯ãæ¯ããã¢ããªã»ã¤ã³ãã©ã®âææ¥ãã使ãããã¯ããã¯â éå®ç´¹ä»ï¼ãã¨ããã»ãã·ã§ã³ãè¬æ¼ãã¾ããã 廣ç°æ°ã¯å¤§å¦åæ¥å¾ãKONAMIã®ã¢ãã¥ã¼ãºã¡ã³ãæ©å¨é¨éã«å ¥ç¤¾ãããã©ã ããã¢ã»ã®ã¿ã¼ããªã¼ã¯ã¹ããã¯ã¤ãºãã¸ãã¯ã¢ã«ããã¼ãã·ãªã¼ãºãªã©ã®ããã°ã©ã ãæãããå¾ããªã³ã©ã¤ã³ã²ã¼ã ã»ã¢ãã¤ã«ã²ã¼ã ã®é¨éã«ç°åããããã¤ãã®ã¿ã¤ãã«ã®ãã£ã¬ã¯ã·ã§ã³ããããã¥ã¼ã¹ãæ å½ããçµæ´ã®æã¡ä¸»ããã©ã³ã¬ã§ã¯ãæè¡é¢ã®è²¬ä»»è ã¨ãã¦ã¢ããªã»ã¤ã³ãã©ã®ä¸¡é¢ããã®æ¹é決å®ã課é¡è§£æ±ºãæ å½ãã¦ãã¾ãã ãã©ã³ã¬ã¯ããã¯ã説æããå¿ è¦ããªãã»ã©ã®æ®åãæãããã½ã¼ã·ã£ã«ã²ã¼ã ãS
ãµã¼ãã¼ã®ãªã½ã¼ã¹ãè¦ãã«ã¯ã°ã©ãåã¯éè¦ã§ãããæ¨ç§»ã§ã¯ãªããªã¢ã«ã¿ã¤ã ãªç¶æ³ãä¾ãã°ç§åä½ã®ã¹ãã¤ãã¼ãªè² è·ãè¦ãã«ã¯ããµã¼ãã¼ä¸ã§vmstatãiostatãªã©ã®*statãã¡ããªã¼ãå©ãå¿ è¦ãããã¾ãã ãã¦ãvmstatã¯ã¡ã¢ãªã®ç¶æ³ããããã¯æ°åä½ã®I/Oç¶æ³ã¯è¦ããã¾ããããã¤ãåä½ã®I/Oç¶æ³ããããã¯ã¼ã¯ã®éä¿¡ãåä¿¡ãã¤ãæ°ãè¦ããã¨ã¯ã§ãã¾ããã # vmstat 1 procs -----------memory---------- ---swap--- -----io----- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 3 1 0 4724956 355452 726532 0 0 54 484 3 3 1 0 99 0 0 2 0 0 47
ãPerlMagick ã OpenMP æå¹ã ã¨é«è² è·ã«ãªã件 :: drk7jpãã®ä»¶ ã©ããããPerlã«éãããã«ãããã»ã¹ã§OpenMPãæå¹ãªImageMagickãåããã¨ããã©ã¼ãã³ã¹ãæªããªãããã§ãã Enabling OpenMP for most algorithms creates 8 threads (1 per core). If your process creates 8 threads thatâs a total of 64 threads and that is a whole lot of contention and possible misuse of your processor cache. ãImageMagick ⢠View topic - Multi Process Contention?ããã ã¨ãããã¨ã§ãsmall_light
æè¿Androidã¨ã®æäºãæ¿åãã¦ããagoï¼@kyo_agoï¼ã§ãã jQueryã¯CSSã»ã¬ã¯ã¿ãå¤ç¨ããç¹å¾´ãããã¾ãããjQueryå ã§ã¯å®è¡ãã©ã¦ã¶ãCSSã»ã¬ã¯ã¿ã®è¨è¿°ã«ãã£ã¦å¼ã³åºããããã©ã¦ã¶APIãå¤ãããããã«ãã£ã¦å®è¡é度ã«ãå½±é¿ãåºã¾ãã ãã®è¨äºã§ã¯ãã»ã¬ã¯ã¿APIã¨ã¯ãªã«ããããCSSã»ã¬ã¯ã¿ã®è¨è¿°ã«ãã£ã¦å¼ã³åºãããã»ã¬ã¯ã¿APIã®ç¨®é¡ãããé«éãªã»ã¬ã¯ã¿APIã使ç¨ããããã®æ¹æ³ãããé«éãªã»ã¬ã¯ã¿APIã使ããããã©ãã確èªããæ¹æ³ããªã©ãç´¹ä»ãããã¨æãã¾ãã ï¼â»ãã®è¨äºã¯JavaScript Advent Calendar 2011 (ãã¬ã¼ã ã¯ã¼ã¯ã³ã¼ã¹) : ATNDã®1æ¥ç®ã®è¨äºã§ãï¼ ã»ã¬ã¯ã¿APIã¨ã¯ãªã«ã ã»ã¬ã¯ã¿APIã¨ã¯ã#hoge .hugaãã®ãããªCSSã»ã¬ã¯ã¿ãããDOMä¸ã«åå¨ããè¦ç´ ãåå¾ããããã®APIã§ãã jQue
æè¿ã¯ãã¯ãããã§ã¯ãã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã®å¤§åã Rails 2.3 ãã Rails 3 ã«ç½®ãæãã£ãã®ã§ãã*1ããªãªã¼ã¹åã®ãã³ããã¼ã¯ã®æç¹ã§ã¯ãã¾ãããã©ã¼ãã³ã¹ãåºãåè¦å «è¦ãã¦ãã¾ãããå ·ä½çã«ã¯ Rails 2.3 ã®æã¨æ¯ã¹ MRI 1.8.7 ã ã¨ã¬ã¹ãã³ã¹ã¿ã ã200%ãããé ãçµæã§ãããRails 3 ã«ãªã£ã¦å®è£ ã Merb core ãåãå ¥ãççµåã§ç¶ºéºã«ãªã£ãåé¢ãããå¤ãã®ãªãã¸ã§ã¯ãã¨ã»ã¡ã¢ãªãå©ç¨ããæ§ã«ãªã£ãå½±é¿ãã¨æãã¾ãã ãã㧠Ruby ã¤ã³ã¿ããªã¿ã®å¤æ´*2ãè¡ãæ¤è¨¼ãããã¨ãã MRI 1.8.7 (Rails 2.3ã¨æ¯ã¹) ç´200%é ã MRI 1.8.7 -> Ruby Enterprise Edition 1.8.7 2011.03 (tcmalloc ç¡å¹) ç´180%ä½é MRI 1.8.7 -> Ruby Ente
å æ¥ã®ããã¯ãããã«ã½ã³ã§åºä¼ã£ã wantedly ãä½ã£ã¦ã仲ããã ã¨è¨ã£ã¦ãã®ã§ãé¢ç½ãããªã®ã§ wantedly ãéããã¦ã¿ã¾ããã wantedly ã¡ãªã¿ã«ãã¼ã¿ãæ°ç¾ä¸ãªã¼ãã¼ããªããããªã®ã«ãã©ã®ãã¼ã¸ããã°ã¤ã³ããã¨2-5ç§ãããããã£ã¦ããã®ã§ã確å®ã«éãã§ãããã ãªãã¨ããæè¦ã¯ããåããããã¾ããã ã¢ããªã±ã¼ã·ã§ã³ãµã¤ãã®ãã¥ã¼ãã³ã° åå¿è *1ã«ãããã¡ãªåé¡ã¨ã㦠SQL ã«é©åã«ã¤ã³ããã¯ã¹å¼µã£ã¦ãªã ãã£ãã·ã¥ãã¹ãå ´æããã£ãã·ã¥ãã¦ããªã ç¡é§ãªãã¼ã¿ãå¼ãããã¦ã ãã¨ãããããã¾ããã®ã§é ã«å®è£ ãè¦ã¦ããã¾ããã SQLã«é©åãªã¤ã³ããã¯ã¹ãå¼µã£ã¦ãªã å¼µã£ã¦ããã¾ããï¼ã³ã£ããï¼ï¼¼(^o^)ï¼ ãã£ãã·ã¥ãã¹ãå ´æããã£ãã·ã¥ãã¦ããªã Facebook API ãå©ç¨ããã¢ããªã±ã¼ã·ã§ã³ãªãã§ãããã¦ã¼ã¶ã®ãã¼ã¿ã®åå¾ãæ¯å馬鹿æ£ç´ã« HT
ãã£ããæ¦è¦ ãã¼ã¯ã§3000req / sec æ¯åã³ã³ãã³ãæ´æ°è¦æ± ã³ã³ãã³ãæ´æ°ã®éã¯ä»æãããã¼ã¿ãapiçµç±ã§åãåã ã³ã³ãã³ãæ´æ°ã«ã¯TheSchwartzãä½¿ç¨ ãªã³ã³ãã³ããè²ã ãã¦ãããã°ã å°ãããã«æ¸ãæè¡ã¯å¤§åãå¨å²ã®ã®ã¼ã¯ãªæ¹ã ã«ãµãã¼ããã¦ããã£ããã®ã§ãåèªèº«ãä½ãããããã§ã¯ãªããæ®å¿µãããã æ§æ internet -> www(squid -> apache) -> app(memcached -> app) -> db ããã³ãã¨ã³ã wwwãµã¼ããapacheã¨squidãåããã¦ãããapacheããªã¯ã¨ã¹ããåããsquidã®ãã£ãã·ã¥ãæãã°ãããè¿ããç¡ããã°ããã¯ã¨ã³ãã®appãµã¼ãã¸proxyã ããã¯ã¨ã³ã appãµã¼ããmemcachedã¨ã¢ããªãåããã¦ããã ããããåé·åãã¦ããã©ããªã¯ã¨ã¹ãæ°ã®å²ã«å°æ°ã¯å°ãªãã æè¡ãã
ãªãã§ãããã®Webã¢ããªã±ã¼ã·ã§ã³é«éåããã«ã#isucon ã«ä¼ç¤¾ã®åå @Songmu @sugyan ã¨3人ã§ãfujiwaraçµã¨ãã¦åæ¦ãã¦ãã¾ãããçµæã幸ãã«ãåªåãåã¡åããã¨ãåºæ¥ã¾ããã ãããªã«æ¥½ããã¤ãã³ããä¼ç»ãéå¶ãã¦ããã ãã Livedoor ã®çæ§ãæ¬å½ã«ãããã¨ããããã¾ãï¼ï¼ ãã¦ããã£ã¨ãã¥ã¼ãã³ã°ããçµéãªã©ãè¨é²ãã¦ããã¾ãã [追è¨] ãã£ã¨è©³ããã¬ãã¼ãã @Songmu ãä¸ãã¦ããã®ã§ãã¡ããã覧ãã ãã ããããã¯ãããããå¹³å¡ãªæ¥ã : #isucon ã§åªåããã¦ããã£ã¦ãã¾ãã [ããã«è¿½è¨] #isucon ã§ã¯ã©ããªãã¨ãèããªããä½æ¥ãã¦ããã - é æ¥è¨ ã¯ã¦ãªæ¯åº èªåã§ãããå°ã詳ããæ¯ãè¿ãã¨ã³ããªæ¸ãã¾ããã ã¾ã説æãèãã¦ãç°å¢ãä½ãã¨ãããããIPã¢ãã¬ã¹ã§ã¯ä½æ¥ããã«ãããäºæ ãèµ·ãããããªã®ã§ãhost
Webãã¶ã¤ãã¼ã§ãã§ããããµã¤ãã®ããã©ã¼ãã³ã¹ãããã5ã¤ã®æ¹æ³ 2011-08-28 Webãã¶ã¤ãã¼ããWebãµã¤ãã®ããã©ã¼ãã³ã¹ãéè¦ããå¾åã¯ãã¾ãç¡ãããã«æãã¾ããéè¦ãªãã¨ã§ãã Googleã§ã¯ã0.5ç§é ããªãã¨ãæ¤ç´¢æ°ã20%æ¸å°ãã amazonã§ã¯ã0.1ç§é ããªãã¨ã売ãä¸ãã1%æ¸å°ãã ã¨ããå ±åãããããã§ããWebãµã¤ãã®ããã©ã¼ãã³ã¹ã¯ã³ã³ãã¼ã¸ã§ã³ã«ãå½±é¿ãã大åãªé¨åã ä»åã¯Webãµã¤ãã®ããã©ã¼ãã³ã¹ãä¸ããæ¹æ³ãåãä¸ãã¾ãã ããã©ã¼ãã³ã¹ã¢ããã®åã« å¿çæéã®éç 0.1ç§ã¾ã§ãªããçµæã¯ã³ã³ãã¥ã¼ã¿ã¼ã§ã¯ãªããã¦ã¼ã¶ã¼ã«ãã£ã¦å¼ãèµ·ããããããã«æããã 1ç§ã¾ã§ãªãã"é ãã¦ãã"ã¨æããããã¦ã¼ã¶ã¼ã®æèã¯éåããã«ãèªç±ã«åãã¦ããã¨æããã 10ç§ã¾ã§ã«ãªãã¨ãã¦ã¼ã¶ã¼ãã³ã³ãã¥ã¼ã¿ã¼ã«æ¯ãåããã¦ããæ°æã¡ã«ãªããã¹ãã¬
ãããã¤ã³ã¹ãã¼ã«ä»£è¡¨ã®ã©ã¤ãããã¯ããã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}