ISUCON8äºé¸1æ¥ç®ã«ãã¼ã ãSELinuxã¯Enforcing以å¤ããå¾ãªããã§åå ãã¦æçµã¹ã³ã¢ã¯26,221ã§ãã
ãã¯ããã®ããã°ã¯ISUCONåå è¨ã«æãä¸ãã£ã¦ãã¾ã£ã¦ã¾ããã
ä»å¹´ã@ishikawa84g ã@netmarkjpã@matsuuã®3人ã§ISUCON8ã«æãã§ãã¾ããããã®ã¹ã³ã¢ããä»å¹´ãæ¬é¸é²åºã¯é£ãããã§ããããã£ããã
ãã¼ã åã®ã¨ãããDisabledã ã£ãSELinuxã¯Enforcingã«ãã¦ãã£ããã·ã¥ã§ãã
ãã£ããã¨
3人ã§ä½æ¥åæ ããã¦ãã®ã§ãåºæ¬çã«èªåããã£ããã¨ãã¾ã¨ãã¾ã
- ãã³ãåã®æºåã¹ã¯ãªããã¨ãã³ãå¾ã®éè¨ã¹ã¯ãªãã(kataribe, pt-query-digest)ãç¨æ
- getEventå ã®N+1ããã£ã¤ãã
- ORDER BY RAND()ãæ¶ãã¦ã¿ããã®ã®ã©ã³ãã ãããªãã¨æãããã®ã§å·®ãæ»ã
- sheetsã¯å¢æ¸ããªãä¸ã«sheet_idããç®åºã§ããã®ã§ãã§ããã ãå©ç¨ããªãããã«å®è£ å¤æ´(sheetsã²ã£ãºãã)
- /api/users/:id ã®N+1ããã£ã¤ãã
- æ®å¸æ°(remain)ã¯eventsã«ã«ã©ã ã追å ãã¦æ ¼ç´ããããã«å¤æ´ãããã®ã®ããããããã¯ãçºçããã®ã§remainsãã¼ãã«ãå¥éä½æãã¦æ ¼ç´ããããã«ï¼ãããæçµçã«failã«ãªãã®ã§å·®ãæ»ãï¼
- /api/events/:id/actions/reserve å ã® ORDER BY RAND() ããããªãããã«å ¨sheetã«ä¹±æ°ã®ã«ã©ã ã¨ã¤ã³ããã¯ã¹ã追å ãã¦ã½ã¼ãããããã«ï¼ãããæçµçã«failã«ãªãã®ã§å·®ãæ»ãï¼
- 1å°ç®ã®h2oã¨webappã¨mariadbã¯ãã®ã¾ã¾ã2å°ç®ã¨3å°ç®ã«webappã稼åããã/initializeã®ã¢ã¯ã»ã¹ä»¥å¤ã¯2å°ç®ã¨3å°ç®ã«æ¯ãããã«å®è£ å¤æ´ï¼ãããæçµçã«failã«ãªãã®ã§å·®ãæ»ãï¼
ã¾ã¨ã
ä¸è¨ã¹ã¯ãªã¼ã³ã·ã§ããã«ãããã¨ãããç´åã§ãsuccess/failãã¦ãããªããªãå³ããå
容ã§ããã
ä»åã¯ãã©ã³ã¶ã¯ã·ã§ã³ããã¡ãã¨æèããä¸ã§æ¹ä¿®ã§ããããèã ã£ãã¨ã®èªèãªã®ã§ãããããç¨åº¦æ§è½ãä¸ãã£ã¦ããã¨failãçºçãã¦ãã¾ããçµå±å¤ãã³ãããã«ã¾ã§å·®ãæ»ãã¦ï¼ããã§ããã¾ã«failãåºãï¼ç¡é£ãªã¹ã³ã¢ã§ãã£ããã·ã¥ããããå¾ãªãè¦ããå±éã§ãããã¤ããã
èªåã§å¤æ´ããå®è£ ã«åé¡ããã£ãå¯è½æ§ã9å²ä»¥ä¸ããã®ã§ãããããããããGoå®è£ ã§getEventså ã®getEventå¼ã³åºããåä¸ãã©ã³ã¶ã¯ã·ã§ã³ã«ãªã£ã¦ããªãã£ãã®ããã種ã®ç½ ã«ãªã£ã¦ããã®ã§ã¯ãªããã¨èãã¦ãã¾ããããããããgetEventsã®N+1ãéæ²»ããã°çµæã¨ãã¦è§£æ¶ããã®ã§ã¯ã¨æãã¨ããã¼ãæãããåé¡ãå ¬éãããã追試ãããã¨æãã¾ãã
æãæãå®è£ ã«ããããã£ãããã³ããã¼ã«ã¼ãæ¤ç¥ãã¦ã¦ã ã ã ãããªãã¨æããå¸ãè¯ãå®è£ ã ã£ãã¨æãã¾ãããã¹ã¦ã®ãµã¼ãã¼ãµã¤ãããã°ã©ãã¼ã¯ãã©ã³ã¶ã¯ã·ã§ã³å¦çã¨ã¯ã©ããããã¨ãã¨ããã®ãå¦ã¶è¯ãææã«ãªãã®ã§ã¯ãªãã§ãããããã¿ããªéå»åããããªã