ã€ã¯ã³ã»ãããŒãšãïŒAGIMAïŒ
ä»æ¥ã¯ãã¬ããŒãã®ååãæ確ã«ãªãããã«ãæé©åã«ã€ããŠã話ããŸãã äžè¬çã«ããµã€ããæé©åããå¿ èŠããããŸãããïŒ å¿ èŠã§ããã ç解ã§ããªãã³ãŒããã©ã®ããã«ç§ãã¡ã«ãã£ãŠããã®ããããšãã°ã以åã®è«è² æ¥è ããããŸãã¯ãã®åŸåèããªããã°ãªããªãããªãèªèº«ã®ã³ãŒãããããã®éã§å€ãã®èå³æ·±ãããšãèµ·ãããŸãã
ããçš®ã®éçã®ããŒãã³ã¢ã®ããã«æ¥ãå Žåãæ®å¿µãªãããããªãã¯ãã®ã¬ããŒãã§ãããèŠãããšãã§ããŸããã ä»æ¥ã話ãããããšã¯ãäžè¬çã«ãRocket Scienceã¯ãããŸãããè€éãªããšã¯äœããããŸããããããã¯ãããšãã°ãé«è² è·ã§å ±æãã¹ãã£ã³ã°ã䜿çšããŠããå Žåãå ±æãã¹ãã£ã³ã°ã§ãå ¥æã§ããããŒã«ã§ãã ããŒã«ãäŒç€Ÿã§è¡ã£ãæé©åã®äŸãã¹ã±ãŒãªã³ã°ã«ã€ããŠå°ã觊ããŸãã ãããæé©åã«ãããã®ã§ãããå°ãç°ãªãã³ã³ããã¹ãã§è¡ãããŸãã
éçºã®æŽå²ã®éã®ãã§ç§ãæåã«äœã£ãæ²ããçµè«ã¯ãéã®åŒŸäžžã¯äžè¬ã«ã©ãã«ãååšããªããšããããšã§ãã ã€ãŸã æé©åãžã®éã®ãã§ééããé çãããã¹ãŠã®äººãæãæ®éçãªè§£æ±ºçãæ®éçãªã¢ãããŒãããŸãã¯ããŒã«ã¯ãããŸããã ãããã£ãŠãããã«ãã®ãããªçµè«ããããŸã-ç¹å¹è¬ã¯ãããŸããã
ãŸããçµéšãããæšæ¥æŽæ°ã®æ¥ããããæšæ¥ããªãã®ãµã€ããã¯ã©ãã·ã¥ããå Žåãç¹å¥ãªç§åŠãããã«ãªãããšã«æ°ä»ããŸãã-ããã¯æŽæ°äžã§ãã äœããŠãã®ïŒ ããŒã«ããã¯ããŠãäœãèµ·ãã£ãã®ãããªãªãŒã¹ã§äœãæªãã£ãã®ããææ¡ãå§ããŸãã ãããããã«ç解ããããšã¯éèŠã§ãã
å€ããå°ãªããçŸå®ã«è¿ãç¶æ³ã«ã€ããŠè©±ããŸãããã ããšãã°ãWebãµã€ãã®è² è·ãå¢å€§ããŠããŸãã ããããåçã«æé·ããŸãããã»ãšãã©ã®å Žåãäžåçã«æé·ããããŒã¯ã«ãã£ãŠæé·ããŸãã ãããŠããããã®ããŒã¯æã«ã¯ãããªãã®ãµã€ãã¯éåžžã«æªããªã£ãŠããŸãã ããŒãžã®ã¬ã³ããªã³ã°ãç¡éã«å§ãŸããã³ã³ãã³ãã®ä»£ããã«çœãç»é¢ã衚瀺ããã500çªã§ã¯ãªã500çªã®ããŸããŸãªã©ã³ãã ãšã©ãŒãçºçãããµãŒããŒããæ¥ç¶ãåæãããããšããããããŸãããŸãã¯ãäžè¬ã«ãããŒãžãååèªã¿èŸŒãŸããååã®ç»åãèªã¿èŸŒãŸããŸããã ãäžè¬çã«ãäœããã®èãèµ·ãã£ãŠããŸãã ãããã®ãã¹ãŠã®çç¶ã¯ãããŒã¿ã«ãŸãã¯ãµã€ãã®æé©åãæ€èšãããã§ã«æ¹åã«åããããã€ãã®æé ãéå§ããå¿ èŠãããããšã瀺ããŠããŸãã
ã¬ããŒããæ§é åããããã«ãã¢ããªã±ãŒã·ã§ã³ã®å žåçãªã³ã³ããŒãã³ããèæ ®ããŸã-ããã¯äœã§æ§æãããŠããŸããïŒ éåžžãã©ã®èšèªã§ãããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãçŽæ¥é 眮ãããŠããããã³ããšã³ãããããŸãã ãµã€ãã®å Žåãããã¯ãã©ãŠã¶ã§ãããã¢ããªã±ãŒã·ã§ã³ã®å Žåãããçš®ã®ã€ã³ã¿ãŒãã§ãŒã¹ã§ãã ã¢ããªã±ãŒã·ã§ã³ãå転ããŠããã¢ããªã±ãŒã·ã§ã³ãããããã¹ãŠã®ããžãã¹ããžãã¯ãå転ããŠããŸãã ãããŠãããŒã¿å±€ããããŸã-ããã¯DBMSã§ããå¯èœæ§ããããŸããããã¯ç¥ã®çŠããããXMLã§ããå¯èœæ§ããããŸããããã¯ã¢ããªã±ãŒã·ã§ã³ã§ã©ããªåœ¢ã§ããããªãã«æ¥ãã¹ãããŒã¿ã§ãã ãããŠããã®æ§é ãæã£ãŠãåé¡ã«æ»ããŸã-ç§ãã¡ã®ãµã€ãã¯æãã§ãé·ãéããŒãããŠãããããã€ãã®åé¡ããããŸãã ã©ãããå§ããŸããïŒ ãã®åé¡ã«ã¢ãããŒãããæ¹æ³ãç§ãã¡ã¯äœããã¹ãã§ããïŒ
æåã«é Œãã®ã¯ãããã³ããšã³ãã確èªããããšã§ããããã¯ãè€æ°ã®ãªãã·ã§ã³ãäžåºŠã«ããããããŠãã©ã®æ¹åã«é²ãã¹ãããå€æããã®ã«åœ¹ç«ã¡ãŸãã
ãã®æ®µéã§ã®äž»ãªåé¡ã¯ãæ£ç¢ºã«ãµã€ããã¹ããŒããŠã³ããçç±ã«é¢é£ããåé¡ã§ãã ããã¯ãããŒãžã®èªã¿èŸŒã¿ãäžé©åã«é·ããã€ãŸã ã¹ã¯ãªããã¯å¯èœãªéãè¿ éã«æ©èœããŸãããããã©ãŠã¶ãŒã§ã¯ã©ã€ã¢ã³ãã«ã³ã³ãã³ããé ä¿¡ããã«ã¯éåžžã«é·ãæéããããããšãç解ããŠããŸãã CSSã®å®è¡ããããã¯ãããŠããŸãã ããã¯ãããšãã°ããŠãŒã¶ãŒã«æåã«çœãç»é¢ã衚瀺ãããããããäœããã®åœ¢ã§åœŒã«ãšã£ãŠçŸãããã®ã«å€ãã£ãå Žåãããã¯è¯ãç¶æ³ã§ã¯ãªããšããäºå®ã§ã...ã³ã³ãã³ãã®éšåçãªèªã¿èŸŒã¿ãã€ãŸã åçãéçŸå®çã«é·ãèªã¿èŸŒãŸããŠããããŸãã¯ã¢ãã«ãéåžžã«é·ãæéæç»ãããŠãã-ãããããã»ã©ç¶æ³ã§ã¯ãããŸããã ãã¹ãŠã®Javaã¹ã¯ãªããã®ãªã¹ãã§80çªç®ã«æ¥ç¶ãããŠããäœããã®ã¹ã¯ãªããããããæ£åžžã«æ©èœããªãããšãããã£ãŠããå ŽåãJSã¹ã¯ãªããã®å®è¡ã®é 延ã¯ãããã§ãäœããæé©åããå¿ èŠããããŸãã
蚺æçšã«ã¯ããããããã©ãŠã¶ã§ã¯ãªãããã¹ãŠã®ãã©ãŠã¶ã«ããããªãåçŽãªããŒã«ããããŸãã
æåã«é Œãã®ã¯Firebugã§ãã 誰ããããã䜿çšããæ¹æ³ãç¥ã£ãŠããŸã-圌ãã¯F12ãã¯ãªãã¯ããŸããããããŠæãå€ããã®ã§ãããããã¯ééããªãããã«ãããŸãã 圌ãã¯ãããFirebugã«è²Œãä»ããããã«ã©ããªãªã¯ãšã¹ãããã£ãããã³ã³ãã³ããããŒãããããšãã«äœããŒãžãè¿ããããããããŠããçš®ã®ã¹ã¯ãªãããå®è¡ãããŠãããšãã«èª¿ã¹ãŸããã éåžžã¯ç¡æã§ãçµ±èšãèŠãã ãã§5åããããŸããããŸããF12ããŒã«å°éããã®ã«æ°åããããŸããã ããã ãã§ããããªãã¯ãã¹ãŠã®çµ±èšãæã£ãŠããŸããããªãã¯ãã§ã«ã©ã®æ¹åã«é²ãã¹ããã®äœããã®çš®é¡ã®ç解ãæã£ãŠããŸãã
éåžžã«èå³æ·±ãããŒã«ããããŸã-YSlowã 圌ã¯ãããã€ãã®ã¡ããªãã¯ã«å ããŠãä¿®æ£ããå¿ èŠããããã®ãèšèã§äŒããããšãã§ããŸãã ãã®ããŒã«ã¯ç§ã«ãšã£ãŠçºèŠã§ãã
ãŸããGoogle PageSpeedããããŸããããã¯ãæåç·ã§äœããå€æŽããå¿ èŠããããšããäºå®ã«åºã¥ããŠããµã€ãã®ã©ã³ãã³ã°ãäžããæ¹æ³ã瀺ããŸãã ããã§ããšããã§ãããã³ãã¯ãã©ãŠã¶ãšããŠã®ã¯ã©ã€ã¢ã³ãã®èŠ³ç¹ããèããããŸãã
ãããã£ãŠã圌ãã¯ãããã®ããŒã«ã貌ãä»ããå£ãããã®ãèŠãŠãç§ãã¡ã¯ãã§ã«äœããä¿®æ£ãå§ããŠããŸããã
ãããã®ã¡ããªãã¯ãèŠããšããäœãæ¢ãã¹ãã§ããïŒ
æåã®éèŠãªãã»ãšãã©ã®ã³ã³ãã³ããµã€ãã¯ããã«çœªãç¯ããŸã-ãããDOMã®ã¬ã³ããªã³ã°é床ã§ãã DOMã«å€ãã®èŠçŽ ïŒ1äžãè¶ ããèŠçŽ ïŒãå«ãŸããŠãããµã€ãããããŸããããã¯ããããã¬ã³ããªã³ã°ããããã«æ¢ã«åé¡ã«ãªãã€ã€ãããŸããã¹ã¯ããŒã«ãµã€ããéããªããšãé»è©±ã§éããšãããã«å€§ããªåé¡ã«ãªããŸãã ãã®ãããäžè¬çã«ã¬ã³ããªã³ã°ãã©ãã ãå°é£ããèŠã䟡å€ããããŸãã
2çªç®ã¯ãå€éšJSãšCSSã®ååšã§ãã äžè¬ã«ãããã¯å¥ã®ãããã¯ã§ãããµãŒããŒäžã«ãªãããçš®ã®JSãããå ŽåããããèŠæ±ãããæã«ã¯å€éšã©ã€ãã©ãªãããããã«æçµçã«ã©ã®ãµã€ãºã«ãªããããããªãããããããŠããããã¯ãã¹ãŠè€éã§ãã ãããŠãã¡ããããããã®ã¹ã¯ãªããã®èªã¿èŸŒã¿ã¯ãããã¯ãéå§ããŸãã 1ã€ã®ã¹ã¯ãªãããããŒãããããŸã§åŸ æ©ãããã®åŸãå¥ã®ã¹ã¯ãªããã®ããŒããéå§ããŸãã CSSã§ãåãããšãã€ãŸã ããã§ã¯ããã®ãããªã¹ã¯ãªãããæ£ããéžæããå¿ èŠããããŸããããããããã®JSãå©çšã§ãããµãŒãã¹ã®å¯çšæ§ã ãã§ãªãããããéèŠã§ãã
ããšãã°ãããªãæåãªãã£ãããã¹ã¯ã©ãã®ãµã€ããå±éãããšãã«ããã®ãããªã±ãŒã¹ããããŸããã æ¥ç¶ããŠããã€ãã®æäœãè¡ãç¹å®ã®å€éšã¹ã¯ãªããããããŸããã éçºè ã¯éçºããŸãããããã¹ãŠãã¯ãŒã«ã§ããã©ãŠã¶ã«ãã£ãã·ã¥ãããŠããããšã ããèæ ®ããŠããŸããã§ããã補åã«çµã¿èŸŒããšããã®ã¹ã¯ãªããã®ééã¯0.5ã¡ãŒãã«ã«ãªããŸããã ãã£ã¹ã¯éã®è»¢éã®äžéšãšããŠã®500 Kbãšã¯äœã§ããïŒ ãããã¯ããã»ã©å€§ããªæ°åã§ã¯ãããŸããããããŒããéå§ãããšããããªããŒããããŒãããç§æ°ã®ãšãã«ããŸãã¯ãŒã«ã§ã¯ãããŸããã ããã«ãéçºè ã«ãã£ãŠãã£ãã·ã¥ãããã°ã©ãã£ã«ã«ã³ã³ãã³ãããŸã å€ããããŸãããããã£ãã·ã¥ãèŠæ±ããããã«ã¯èŠããŸããã§ããã äžè¬ã«ãæçµçã«ã¯FirebugãèŠãããšãåé¡ã«ãªãå¯èœæ§ãããããšã«æ°ã¥ããŸã§ãå€ãã®ç 究ãè¡ãããŸãããããããã¹ãŠã§ãã
ããŠããµãŒããŒãžã®æ¥ç¶ã確ç«ããæéã ããã§ã¯ãã¹ãŠããããããããªããªãããªãã®åç·ãæ¬åœã«ã€ãŸããªãã®ãããããšãäœããã®åŒ±ãã€ã³ã¿ãŒããããã£ãã«ãããã®ãââãç解ããããšãéèŠã ããã ã ãã®ãããªåé¡ãçºçããŸããããã§ã¯ãã³ãŒããæãã®ã§ã¯ãªãããããã¯ãŒã¯ãããã€ããŒã«å¯ŸåŠããå¿ èŠããããŸãã
é©çšã§ããããã³ãæé©åã®æ¹æ³ã¯äœã§ããïŒ
çž®å°ãçµåãå§çž®-ãããã¯ãã¹ãŠãããŠã³ããŒãæã®ãã¡ã€ã«ã®ééãšæ°ãšãã2ã€ã®èŠå ã«ã®ã¿åœ±é¿ããŸãã 10åã®JavascriptãããŒããããã®ãã¡ã®ããã€ããå€éšãµãŒãã¹ããã®ãã®ã§ããå Žåãããã¯ããã³ããšã³ãã«ããŸã圱é¿ããŸããããã©ãŠã¶ãŒã¯ãç§ã®æèŠã§ã¯ã5ã€ã®åææ¥ç¶ïŒããŒãžã§ã³ã«ãã£ãŠç°ãªãïŒããµããŒãã§ããä»ã®ãã¹ãŠããããã¯ãããããã§ã ãã¡ãããåæã«åºè·ããå Žåã ããæç¹ã§çµã¿åããããšããããåé¿ã§ããŸãã10åã®ãã¡ã€ã«ã®ããããããããŸãã ãããŠåœç¶ã30 Kbã«1ã€ã¯1 Kbã«30ãããé«éã«ããŒããããŸãã ãããç解ããå¿ èŠããããŸãã
ããããããã«çž®å°ïŒç¹ã«CSSïŒã«é¢ãã次ã®ãã€ã³ãããããŸãã ãããã°ã®ç¬éãããå Žåããããã®äžéšã¯è£œåã®éçºããã«ãéããæ°å€ã®å€æŽãéå§ããŸããããã¯ãã¹ãŠå€æŽãããŠããããŸã ããã«ããè¡ã瀺ããŠããŸãã ãããã£ãŠãå§çž®ãã¡ã€ã«ã®å Žåããããã®ãããã¡ã€ã€ã«ãœãŒã¹ããããŒããªãå Žåãé€ããŠãè¡ã1ãã衚瀺ãããŸãã ããããããã§ã圌ãã«ãšã£ãŠã¯ããã»ã©ç°¡åã§ã¯ãããŸããããµã¯ãŒããããŒã®äžã«ã¯ãããªãã«ããã€ãã®ããŒããæã£ãŠããªããã®ããããããã¡ã€ã³èŠçŽ ãã©ãããå§ãŸããã瀺ããŠããŸãã ãããŠãã³ãŒãã®æ£ç¢ºãªå Žæã¯éåžžã«é£ããå ŽåããããŸãã ããã§ããéåžžã«æèœã«ã¢ãããŒããé©çšããå¿ èŠããããŸããããã¯ããããã°ã®éã«ããªãã«ããªãã¯ããããå¯èœæ§ãããããã§ãã
å§çž® ã¡ãã£ã¢ã³ã³ãã³ãã¯æ£ç¢ºã«å§çž®ããå¿ èŠããããäžéšã®Full HDç»åã¯100 x 100ãã¯ã»ã«ã®ã³ã³ãããŒã«ããŒãããªããããããã§ã¯ãããããã¹ãŠãéæã§ãã ä»ã§ãåçãå°ããããã«èŠããå Žåããããããã§ãã«HDãé§åããã¯ã©ã€ã¢ã³ãã¯ããªããããªã«é·ãã®ïŒããšèšããŸãã ãã®ç¹ãèæ ®ã«å ¥ããå¿ èŠããããŸãã
æé©åããŒã«ã®2çªç®ã®ã°ã«ãŒãã¯ãJSã³ãŒãã®ãªãã¡ã¯ã¿ãªã³ã°ã§ããããã¯ããã®ããã«æžãããŠããããã«æãã§ããããšãå€ãããã§ãã ç¹ã«ãå®å šã«ç解ããŠããªããã¬ãŒã ã¯ãŒã¯ã䜿çšããŠãããDOMãæ°åã®èŠçŽ ã§æ§æãããŠãããäœããã®jQueryã€ãã³ããªã©ãããå Žå èŠããã«ããã¹ãŠãå®éã«ã¯éåžžã«é«éã«åäœããŸããã
ãŸããDOMã®æé©åãéèŠã§ãã iPad 1ãŸãã¯2ãèšæ¶ãããŠããå Žåãããšãã°ãwoman.ruãªã©ã®ãã¥ãŒã¹ããŒã¿ã«ãªã©ãããããçš®é¡ã®ã³ã³ãã³ããµã€ããèªã¿èŸŒããšåé¡ãçºçããŸãã 圌ãã¯æŽå²çã«DOMãéåžžã«è€éã§ãããã€ãŸã ããããã®èŠçŽ ããããiPadã ãã§ã¯æ¶åã§ããŸããã§ããã ããªãã¯ãµã€ããéããŠããããã¬ã³ããªã³ã°ããã¬ã³ããªã³ã°ããã¬ã³ããªã³ã°ããããã«èŠããŸããããç¹å¥ãªããšã¯äœããªãã£ãã®ã§ããã®ãããã¯ã§éåžžã«æé©åããå¿ èŠããããŸããã ããããéåžžã«é·ãæéãããããŸããã
ãããã®ç¹ã¯ãã¹ãŠãåçŽã«Webãµã€ãã®ããã©ãŒãã³ã¹ãé«éåããããšã«ã€ãªãããŸãã
ãŸããç¡æã®ã¢ããã€ã¹ã¯ãã¯ã©ã€ã¢ã³ããšã¯é¢ä¿ããªããªããŸãããããããã·ãŸãã¯nginxãµãŒããŒã®åé¢ã«åãããããã®ã§ããnginxãéããŠstaticãæå®ããå¿ èŠããããŸãã ãããŸã§ãéçãnignxãééãããã£ã¹ã¯ã«ããŸã圱é¿ãäžããªããããªã±ãŒã¹ã«ééããŸããããããã£ãŠããµã€ããæãã§ãä»ã®ãã¹ãŠãæ£åžžã§ãããšæãå Žåã¯ãéçã確èªããŸã-nginxãä»ããŠãããååŸããŸãäžãããããã©ãã
ããã«èå³æ·±ãéšåã«ç§»ããŸãããããããã¯ã¢ããªã±ãŒã·ã§ã³ãšDBã§ãã ãšã©ãŒã®å€§éšåãå®éã«çºçããæé©åã®ãã¹ãã®å ŽãæäŸããéšåã
ããªãã®ããŒãžããã£ãããšåœ¢æãããŠãããã¹ã¯ãªãããã²ã©ãå®è¡ãããŠãããhtmlãçæãããŠããã500çªç®ã®ãšã©ãŒãé »ç¹ã«çºçããŠããããªã©... 500çªç®ã¯ãã§ã«éã§ãã ç£èŠã·ã¹ãã ãä»ããŠãµã€ãã®ããŠã³ã¿ã€ã ãç£èŠããŠããå Žåãã¢ã©ãŒã ã鳎ããå¿ èŠããªãå Žåã¯ãããã§ãã¹ãŠãåé¡ãªããã©ãããæ€èšãã䟡å€ããããŸãã ãããããã€ãã®åäžã®ã±ãŒã¹ã§ããå Žåãäžé£ã®ãã®ãããªã±ãŒã¹ã§ããå Žåã¯ãèããŠãèŠãŠãå解ããããšãã§ããŸããããã§ããã®ã¿ã¹ã¯ã«å æ¬çãªæ¹æ³ã§ã¢ãããŒãããå¿ èŠããããŸãã
ã¢ããªã±ãŒã·ã§ã³ãŸãã¯DBã®é床ãäœäžããå Žåã®ãªãã·ã§ã³ã¯äœã§ããïŒ å®éã次ã®3ã€ã®éèŠãªãããã¯ããããŸãã
- ãµãŒããŒããªãœãŒã¹ã䜿ãæãããŸããã
- ããã°ã©ããŒã¯éåžžã«é«å質ã§ã¯ãªãã³ãŒããäœæããŸããã
- ãŸãã¯ãããŒã¿ããŒã¹ã§äœãåé¡ãçºçããŠããŸãã
äžè¬çã«ãããããã¹ãŠç解ããæ¹æ³ã¯ïŒ
æåã«é ã«æµ®ãã¶ã®ã¯ããããã¡ã€ã©ãŒãããã«ã€ã³ã¹ããŒã«ããã®ã§ã¯ãªããå¥åŠãªãã®ãçºæããã®ã§ã¯ãªããåã«ç«¯æ«ã«å ¥ã£ãŠéåžžã®OSããŒã«ã䜿çšããããšã§ãã
ãµãŒããŒã«æ®ã£ãŠããã¡ã¢ãªã®éãç解ããã®ã«åœ¹ç«ã€topã³ãã³ãããããŸãã straceãlsofãªã©ããããŸãã ãããã®ã³ãã³ãã¯ãã¹ãŠLinux OSã«ãããWindowsã§ãåæ§ã®ã³ãã³ãããããŸãã ãã®ãããªããšã¯äœãããããã¹ãŠæå ã«ãããŸãããµãŒããŒã®çŸåšã®ã¹ããŒã¿ã¹ãèŠãã ãã§ãã ãããŠãå¿é ããããšã¯ãŸã£ãããããŸããã
ããå°å£²æ¥è ã®ã±ãŒã¹ããããŸããã ãããã¯ãã£ã¬ã¯ããªã®ãããªãã®ãæã£ãŠããŸãããã¶ããããªãã¯ç¥ã£ãŠããŸãã圌ãã¯pdfã«ãã³ãã§ããŸããŸãã ãããŠã圌ããæçš¿ããæ¥ã«ãäœããã®çç±ã§ãå€ãã®äººã ãããããããŠã³ããŒããå§ããã®ã¯èå³æ·±ãããšã§ãã ã©ã®ãããªç®çã§äœ¿çšãããã¯ããããŸãããããªãããã®çç±ã§å®éã«2,000人ããã®ããŒã¿ã«ã«ã¢ã¯ã»ã¹ããŠããã£ã¬ã¯ããªã®ããŠã³ããŒããéå§ããŠããŸãã ãããŠãç§ãã¡ã®ãµã€ãã¯å°ãå°çããŸããã 圌ãã¯ç解ãå§ããŸããã ã·ã¹ãã 管çè ã¯ã©ããããããã¹ã¿ãã¯ãããã¹ãŠã®ãã¡ã€ã«ãaccess_logsã®apacheãéããŠæäŸãããŠããããšã«æ°ä»ããŸããã ãããããã¡ãããApacheçµç±ã§PDFãã¡ã€ã«ãæäŸããããšã¯ããŸãè¯ããããŸããã configãnginxã«åãæ¿ããã ãã§ãïŒç¹°ãè¿ããŸãããã¢ããã€ã¹ãèŠããŠããŸããïŒ-nginxãä»ããçµ±èšïŒããã¹ãŠãé£ãã§ããŸãã ã€ãŸã ããã«æ確ãªäŸããããŸã-5åãããŠã©ããããããåºå®ãããã£ã¹ã¯ã§äœãèµ·ãã£ãŠããã®ããaccess_logãèŠãŠãããã ãã§ãã ãããŠããã¹ãŠãããã«æããã«ãªããä¿®æ£ãããŸããã
ããšããããããã«æ¶ŒãããŠã-ç£èŠã·ã¹ãã ãããã°ãOSã«è¡ãå¿ èŠãããªããããããã¹ãŠãç解ã§ããŸãã ã€ãŸã ãµãŒããŒãã©ãã§ãã©ãã§å°ããªå±æ©ã«é¥ãããç解ããããã®ããŸããŸãªã¡ããªãã¯ããããŸãã
2çªç®ã®ãã€ã³ãã¯ã¹ããŒãã°ã§ãã ã¹ããŒãã°ã¯ã»ãŒã©ãã«ã§ãããããã®èŠæ±ãŸãã¯ãã®èŠæ±ãçºçããå ŽæããŸãã¯ã¹ã¯ãªãããç°åžžã«é·ãæéå®è¡ãããå Žæãšæéãå€æããã®ã«åœ¹ç«ã¡ãŸãã é ããã°ãããããåé¡ããããã¯åé¡ã§ã¯ãªãããè°è«ããçç±ã«ãããªããšããäž»ãªãããã¯-ããã¯é ããªã¯ãšã¹ãã決å®ããæã§ãã ããã®ãã¹ãŠã¯å®éã«ã¯ããã«ç°¡åã§ãã ããªãã¯ã·ã¹ãã ã®ææè ã§ãããã¹ã¯ãªããå®è¡ãªã¯ãšã¹ãã®ã©ã®æéãæé©ã§ãããããŸãã¯ããªãã«ãšã£ãŠåãå ¥ããããããç¥ã£ãŠããŸãã ã¹ããŒãã°ãèšå®ããŠããã¹ãŠã®éèŠãªãªã¯ãšã¹ããæžã蟌ãŸãããã¹ãŠã®éèŠã§ãªããªã¯ãšã¹ããæžã蟌ãŸããªãããã«ããŸãã 2ã€ã®ãªã¯ãšã¹ãã3ç§ä»¥äžå®è¡ãããå Žåã«ã«ãŠã³ãããªãããã«ããã«ã¯ãã©ã®æéãéèŠã§ããããç解ããããšãéèŠã§ãã çµ±èšãèšç®ãã¬ããŒããªã©ãååšããããããªã¯ãšã¹ããå®äºããã®ã«5ç§ãããã®ã¯éåžžã®ããšã§ãã
å¥ã®ãã³ã-éçºã®éå§æã«ã¹ããŒãã°ãå«ããããšããå§ãããŸãã ããã«ãããäºæããªãè² è·ã®ããŒã¯ãšãã®åŸã®ãäœãèµ·ãã£ãã®ãããªã©ã®çµæå ±åããããªããæããŸãã åãæŽæ°ã§ã補åã«ããŒã«ã¢ãŠãããè² è·ããµãŒããŒäžã§éåžžã«äžåäžã«ãžã£ã³ããå§ãããšãããã«ããŒã«ããã¯ããŠç¶æ ãæ»ãå¿ èŠãããããã§ãã ãŸããã¹ããŒãã°ãæå¹ã«ãªã£ãŠããªãå Žåãçµ±èšãã¡ããªãã¯ãåéããã®ã¯éåžžã«å°é£ã§ãã ãªã³ã«ããå Žåã¯ãã¡ããªãã¯ã確èªããŠãããã¹ãŠã決å®ããäœããã®è² è·ãã¹ããè¡ãããšãã§ããŸãã ããã ãã§ãã
ãŸããããŸããŸãªãã°ããããŸã-ããã¯error_logãšaccess_logã§ãã ç§ãã¡ãèªç±ã«äœ¿çšã§ãããã¹ãŠã®ãµãŒããŒããŒã«ã¯ãè¿œå ã®ããŒã«ã䜿çšããã«äœ¿çšã§ããŸãã ããã¯ãOSããã¯ã¹ã«ãããã®ã«å ããŠãç£èŠã§ãã ãã ããã¢ãã¿ãªã³ã°ã¯ãã§ã«èšå®ãããŠããå¿ èŠããããŸãã
ããªãã®ã¢ããªã±ãŒã·ã§ã³ãããéãç解ããããã®æ¬¡ã®ã¹ãããã¯ããããããããªãã®ãã®ã§ãªããã°ããããã¡ã€ã©ãŒã§ãã ãããã¡ã€ã©ãŒã¯ã»ãšãã©ãã¹ãŠã®èšèªã«å¯Ÿå¿ããŠããŸããããã¹ãŠã®èšèªã«å¯Ÿå¿ããŠããããã§ãã ãããŠãåèªå°å¿ã®ãããã¡ã€ã©ãŒã«ã¯ãååãšããŠãã©ã®ãããã¡ã€ã©ãŒã§ãåãã§ããç¹å®ã®å©ç¹ããããŸãã ããã¯äœ¿ãããããã€ãŸã ã©ã®æç¹ã§éå§ã§ããããã©ãã§çµäºããå¿ èŠãããããèšå®ã«æžã蟌ãããäœãæžã蟌ãã¹ãããã©ã®ãããªåäœç¹æ§ãªã©ã決å®ããã ãã§ãã åºåã§ã¯ããããã¡ã€ãªã³ã°äžã«å®è¡ããããã¹ãŠã®é¢æ°ã®ã³ãŒã«ã¹ã¿ãã¯ãååŸããŸãã ã©ã®é¢æ°ãã©ãã ãå®è¡ãããããããããŸãããã®é¢æ°ãã©ãã ãå®è¡ããããããã¹ããããé¢æ°ãããã€å®è¡ããããããããæ¶è²»ããã¡ã¢ãªéãããããŸãã ãŸãããããã¡ã€ã©ãŒãã°ã䜿çšãããšã³ãŒã«ã°ã©ããäœæã§ãããããè² è·ãé«ãã¢ã¯ã·ã§ã³ïŒãã®å Žåã¯å®è¡æéãnç§ããé·ãïŒã®ã«ãŒãããã¬ãŒã¹ã§ããŸãã
ããšãã°ãXhprofããããŸãã PHPã§éçºããŠãããXhprofããããŸãã ããã¯åœŒãã©ã®ããã«èŠãããã§ãã å€ãã®ãããã¡ã€ã©ãŒãåæ§ã®ã€ã³ã¿ãŒãã§ãŒã¹ãæã£ãŠããããã«æããŸã-ã³ãŒã«ã¹ã¿ãã¯ã®ããç¹å®ã®ããŒãã«ããããããã€ãã®è€éãªã¯ãšãªãã©ãã§å§ãŸããã©ãã§çµãã£ããã瀺ãç¹å®ã®ã°ã©ãããããŸãã
Visual Studioãããã¡ã€ã©ãŒããããŸããããããšã¯ç°ãªããå€ãã®ãããã¡ã€ã©ãŒã¯å€ãã®èšèªã§ç°¡åã«ã°ãŒã°ã«æ€çŽ¢ãããŸãã
ããã«ãäœãããå¿ èŠãããããããããç解ããããã«ãå°ããªäŸãæ€èšããããšãææ¡ããŸãã çç¶ããå§ããŸãããã
ãµã€ããéåžžã«é ãããšã«çªç¶æ°ä»ããŸããã ãã®å Žåãã¹ã¯ãªããã®å®è¡æéãé·ãã®ã¯ãµãŒããŒäžã§ãã ãã¹ãŠã®ã«ãŒã«ãåé¢ã«ããããšã«æ°ä»ããŸããããã¹ã¯ãªããã®äœæã«ã¯ããã€ãã®åé¡ããããŸãã å¿ èŠãªã®ã¯ããããã¡ã€ã©ãŒãŸãã¯ã¹ããŒãã°ã§ã-奜ããªããã«ã誰ãäœãæã£ãŠãããã誰ãäœãèšå®ã§ãããã§ãã
ãããŠããã®ãããªå°ããªããšã¯EXPLAINããŒã ã§ãã å°æ¥ãããªãã¯ãã®çç±ãç解ããã§ãããã
ãããã¡ã€ã©ãŒã䜿ãç¶ãããšã1ç§ã§14åã®MySQL_queryåŒã³åºããè¡ãããããšãããããŸãã ããŸãè¯ãææšã§ã¯ãããŸããã
å°ãäžããã©ããšãgetNewUserNotificationCNTãšåŒã°ããé¢æ°ã640ããªç§ã§ãããã»ãšãã©ã®å Žåããã®640ã®ãã¡ããªã¯ãšã¹ããå®è¡ããããšãããããŸãã ã€ãŸã ãããã¡ã€ã©ãããã§æ©èœããŠããããšãç°¡åã«æ³å®ããŠç解ã§ããŸãããã®æ©èœãããã«ããã¯ã§ãã å¿ èŠãªã®ã¯ããã®é¢æ°ã«å ¥ã£ãŠãã©ã®ãããªãªã¯ãšã¹ããå®è¡ããããã確èªããããšã ãã§ãã
ãªã¯ãšã¹ãã¯éåžžã«ç°¡åã§ããããšãããããŸã-ããã¯ãæ°ããæªèªã®éç¥ã®æ°ã®éžæã§ãã , , , , , , EXPLAIN SELECT':
, SELECT, , . , . , , , - 10 , . , COUNT (*) â . , - . EXPLAIN, , .
. ALTER TABLE, INDEX USER_ID . ? . , 1 . .
, EXPLAIN, , , , - .
. EXPLAIN. EXPLAIN -, , , , EXPLAIN , , . , , , , . , .
- join' - , EXPLAIN , â where â . , , , , .
1 300 . , . , 2,5 , â 700 . ã€ãŸã , .
? :
, â . , - , , , , , , , join' - . - , get list, get list' - get list . .
â , .. - , while - , , . , .
( ) â . , - , , , . , .
ãããã©ãããŸããïŒ , , , - , code review .
, , . , , â . . - , real time , cron, , - , , - , .
. , , , . â , , , . , excel, , , . , .. , : « , 5 », . .
, , , , , , , , , , , .
, â . ã€ãŸã , , - .
:
- â , , ;
- , . â , .. - , , , , .. , , .
, , . - , 10 . - , , 100 1 . , 100 150. .
, , , , . - â . , , â , , .
, .. , - , , , .
, .. - , , , â .
â . , , , .
. , , , , , - , .
é£çµ¡å
» miheev@agima.ru
» Facebook
â HighLoad++ Junior . HighLoad++ Junior â HighLoad++ 2016 â HighLoad++ , 7 8 .
â Junior â . highload (, , ). HighLoad - â , nginx :)
- HighLoad.Guide-ããã¯ãç¹å¥ã«éžæãããæåãèšäºãè³æããããªã®ãã§ãŒã³ã§ããç§ãã¡ã®æç§æžã«ã¯ãã§ã«30以äžã®ãŠããŒã¯ãªè³æããããŸããæ¥ç¶ããŠãã ããïŒ