CEOã®@uen0yamaã§ãã
ISUCON14ã«ååºå ´ï¼ååªåãçãã«è¡ã£ãã0ç¹ã§ããï¼
å¿ãã¬ãã¡ã«åå¿é²æ¸ãã¨ãã¾ãï¼
ã¡ã³ãã¼æ§æ
ã¡ã³ãã¼ | æ å½ |
---|---|
@tzm | bashã¹ã¯ãªããä½æãã¢ã«ã´ãªãºã æ¹å |
@qwav | DBãã¥ã¼ãã³ã°é¢é£ãN+1対ç |
@uen0yama | ã¤ã³ãã©ï¼ãããã¤ãSSEå®è£ |
å½æ¥ã®ã¿ã¤ã ã©ã¤ã³
ð9:30ï½10:00 æ©èµ·ãã¯ã¤ããã£ã
- ãªãã£ã¹ã«éåï¼åçæ®ã£ã¦ããã°ããã£ãï¼
- ã©ã¤ãé ä¿¡ã§åºé¡åç»è¦ããããããã
ð10:00ï½11:00 ããã¥ã¢ã«ææ¡ï¼åæãããã¤
- ãå ¨å¡ãããã¥ã¢ã«èªãã
- ã@uenoyamaãAWSã«ç°å¢ãããã¤ã
- ãå ¨å¡ãSSHæ¥ç¶ç¢ºèªã
- ã@tzmããããã¤ç¨ã®bashã¹ã¯ãªããç¨æãGitHubã®privateãªãã¸ããªã«ã½ã¼ã¹ç»é²ã
- ã@uenoyamaã1çºç®ã®ãã³ããã¼ã«ã¼ã1000ç¹ãããã
- ã@tzm, @qwavãã½ã¼ã¹ã³ã¼ãããããã«ããã¯ã調æ»ã
- ã@uenoyamaãnginxã§alpãã°åãç°å¢ãslow-queryãã°åãç°å¢ã®æ§ç¯ã
- ãå
¨å¡ãalpãã°ãã½ã¼ã¹ã³ã¼ã調æ»ãã対çã®æ¹éã以ä¸ã®ã¨ããåºããã
- ãµã¼ãã¼æ§æã®å¤æ´ãï¼@uenoyamaï¼
- 1å°ç®ãNginxã®ããã³ãã¨APIãµã¼ãã¼ã®
/api/chair
ã¨/api/matching
以å¤ã - 2å°ç®ãAPIãµã¼ãã¼ã®
/api/chair
ã - 3å°ç®ãMySQLã¨APIãµã¼ãã¼ã®
/api/matching
ã
- 1å°ç®ãNginxã®ããã³ãã¨APIãµã¼ãã¼ã®
/app
ã¨/chair
ã®/notification
ãSSEåãï¼@uenoyamaï¼/nearby-chair
ã®N+1対çãï¼@qwavï¼/api/matching
ã®ã¢ã«ã´ãªãºã æ¹åãï¼@tzmï¼- ãã¼ã¿ãã¼ã¹ã®ãã¼ãã«æ§é è¦ç´ããææ°å¤ã¨SUMå¤ãæ°ããã«ã©ã ã¨ãã¦æã¤æ¹éã«å¤æ´ï¼@uenoyamaï¼@qwavï¼
- ãµã¼ãã¼æ§æã®å¤æ´ãï¼@uenoyamaï¼
ð11:00ï½14:30 ãã³ããã¼ã«ã¼0ç¹æ代
- ã@uenoyamaããµã¼ãã¼æ§æã®å¤æ´ãã¤ãã§ã«
nginx.conf
ãè¦ç´ãã¦ããã©ã¼ãã³ã¹æé©åï¼ãããè£ç®ï¼ - ã@uenoyamaï¼@qwavããã¼ã¿ãã¼ã¹ã®ã«ã©ã 追å ãã¤ã³ããã¯ã¹ã®è¿½å ã
- ã@tzmãå¾è¿°ã®äºä»¶å¯¾å¿ã®ããããã¹ãç°å¢ã
docker
ã§åä½ããããã®æºåããããã³ã°æ¹åã®ãã¤ã³ããã³ã¼ã調æ»ã
ð¥äºä»¶åçºð¥
- ãã¤ã®éã«ããã³ããã¼ã«ã¼ã0ç¹ã«ãªã£ã¦ãã
- ã¨ã©ã¼ãã°ãããä½ãããã©ã¼ãã³ã¹ã®åé¡ãããªããã¨å®ç´ãªå¤æããã¦åèªèª¿æ»ãï¼ããã¾ãè£ç®ï¼
ð14:30ï½14:45 ã¹ã¿ã¼ãã©ã¤ã³ã«ãã©ã
- ã@uenoyamaãã½ã¼ã¹ã³ã¼ãã¨SQLæ§æãå
ã«ãã©ãã¦ãã¨ã©ã¼ãçºçãã¦ãã³ããã¼ã«ã¼ã0ç¹ã
- ã£ã¦ãã¨ã¯
nginx.conf
ããèãããã¸ãã gzip
ã¾ããã®è¨å®ãå ã«æ»ãããããã³ããã¼ã«ã¼å®èµ°ãããããåæè¨å®ã®1000ç¹ã«æ»ãããªãã¦ãã£ãã
- ã£ã¦ãã¨ã¯
ð14:45ï½16:30 SQLã³ãã¼ãã¹ã«æ°ä»ã
- ã@uenoyamaãSSEã®å®è£ ãé²ããã
- ã@qwavã
/nearby-chair
ã®N+1åé¡å¯¾å¿ - ã@tzmããdockerç°å¢ã§èµ°ããããã
init.sh
ã失æããããã¨ã®å ±åãå ¨å¡ã§èª¿æ»ã- ã«ã©ã ã追å ããããã§ãåæç»é²ãã¼ã¿ãåããªããã¨ã§ã¨ã©ã¼ã«ãªã£ã¦ããã
- ãï¼ãããããªãã§ãã³ããã¼ã«ã¼ãå®èµ°ãã¦ããï¼ãåæå失æãã¦ãã®ã«ã
- ð±ð±ð±ããããã¤ç¨ã®ã¹ã¯ãªããããã¹ã£ã¦ãï¼ãçµæãä¿®æ£ããSQLã³ã¼ããã¢ããã§ãã¦ãªãã£ããã¨ãå¤æï¼ã¤ã¾ãåææ§æã§åãã¦ããï¼
/webapp/sql
以ä¸ã«ã³ãã¼ããã¹ã¯ãªãããã/webapp/sql/sql
ã«ã³ãã¼ãã¦ãããªãã¦â¦â¦1å¹´çã®ãã¹ãâ¦â¦
- SQLãæ£ããã³ãã¼ããããã¹ã³ã¢ã4000ç¹ãçªç ´ðãããããã¹ã¿ã¼ãã©ã¤ã³ã«ç«ã£ãæ°ãããï¼
ð16:30-17:00 chairã®SSEåå®æãããã¦åã³0ç¹æ代ã¸
- ã@uenoyamaã
/chair/notification
ã®SSEåã®å®è£ å®äºã- ãããã¤ãã¦ã·ãã¥ã¬ã¼ã¿ã¼ã§ç¢ºèªããã¨ãç¸ãå¤ããããã¼ãªã³ã°åä½ãã¦ãã
- ã¯ã¦ï¼ãé常ã®ã¨ã³ããã¤ã³ãã¯åé¤ããã¯ããªã®ã«ï¼ãã¨ã©ã¼ãªãããããã©ããªãã§ã¬ã¹ãã³ã¹ãè¿ã£ã¦ãã¦ããï¼
- ð±ð±ð±ããããã¤ç¨ã®ã¹ã¯ãªãããã¹çºè¦ã¢ã²ã¤ã³ï¼
- æã ã¯è¨èªã«Nodeãé¸æãã¦ãã®ã«ããããã¤ã®éãTSã³ã¼ããã¢ãããã¦çµããã®æ°æã¡ã«ãªã£ã¦ããï¼
- ãã¤ãã©ã³ã¹ãã¤ã«ãã¦ãã ã£ããã£ã¦èª¿ã¹ãããµã¼ãã¹èµ·åæã«
npm run start
ãå©ãã¦ãã¦ãããã§ãã©ã³ã¹ãã¤ã«ãã¦ããä»é æ°ä»ããªãã¦ï¼ããã¯ï¼ - ã£ã¦ãã¨ã¯ã4000ç¹ã¯ãµã¼ãã¼ã®åæ£ã¨SQLã®ã¤ã³ããã¯ã¹ã ãã®å¹æã ã¨å¤æãã½ã¼ã¹ã³ã¼ããæ´æ°ãããï¼ãã£ããå®è£ ãã¦ãã®ã§ï¼ä½ç¹ã¾ã§ä¼¸ã³ãã®ãã¯ã¯ã¯ã¯â¨ãã ãã
- ãµã¼ãã¹åèµ·åãã¦ã·ãã¥ã¬ã¼ã¿ã¼ã§ç¢ºèªãããã
/chair/notification
ãæ£ããSSEã§åä½ãã¦ããï¼ãããã¯ãã³ããã¼ã«ã¼ãæå¾ ã§ããï¼ - ãã³ããã¼ã«ã¼ãèµ°ãããããã¾ããã®0ç¹ï¼ãã©ãã ãã©ãã§å£ããï¼
ð17:00-18:00 appãSSEåå®æããããã³ã°ã¢ã«ã´ãªãºã æ¹åã0ç¹ãã£ããã·ã¥ð
- ãã³ããã¼ã«ã¼ã®åé¡å¯¾å¿ã¯@qwavã«ã¾ããã¦ãåã¤ããã«ã¯å®å ¨SSEåã¨ãããã³ã°ã¢ã«ã´ãªãºã æ¹åãå¿ é ã¨å¤æã
- ã@uenoyamaãSSEåã17:30ã«å®æï¼
- ã@tzmããããã³ã°ã¢ã«ã´ãªãºã æ¹åã17:30ã«å®æï¼
- ã@qwav+å
¨å¡ããã³ããã¼ã«ã¼ã®ã¨ã©ã¼å¯¾å¿ï¼ããªãããªãï¼ã
chair
ãowner
ãã©ã£ã¡ããå£ããï¼ - 17:59ãæå¾ã®å¥è·¡ãä¿¡ãããã°åºåããã¹ã¦åã£ã¦æå¾ã®ãã³ããã¼ã«ã¼éå§ï¼ã0ç¹ï¼ããã¤ãããã¾ã§ããï¼
ð18:00-20:30 ã©ã¤ãé ä¿¡éè³ãã¤ã¤ðãã¶ã¨ðºãã¼ã«ã§æã¡ä¸ã
- å ¨å¡ãå®å ¨ã«çãå°½ããæãããã¤ã¤ãããä»æ¥å¸°ã£ã¦å¯ããã¿ã¤ã ãªã¼ããã¦ã¦ã9:30ããããç´ãããåã¦ãããã¨ããè² ãæãã¿ãåããªãã解æ£ï¼
ãµãããã
ð°æªãã£ããã¨
- åºç¤ãç¦ãéããããããã¤ã®ã¹ã¯ãªããæ¤è¨¼ããããã¡ããã¨ãµãããããã°è¯ãã£ãã
- ã¢ãããã¼ããããã¡ã¤ã«ã®ã¿ã¤ã ã¹ã¿ã³ããæ´æ°ããã¦ãããã
- Nodeã®ãã©ã³ã¹ãã¤ã«ãããJSã³ã¼ãã®ã¿ã¤ã ã¹ã¿ã³ããæ´æ°ããã¦ãããã
- 1ã³ãããï¼1ãããã¤ï¼1ãã³ããã¼ã«ã¼ãå¾¹åºãã¨ãã°ããã£ãã
- ä»åãéä¸ã§ãã©ã³ã¹ãã¤ã«ãã¦ãªãã£ããã¨ã«æ°ä»ãããã©ã³ã¹ãã¤ã«ãããã¨ã©ã¼ã¨ãªã£ãã
- ãã®æç¹ã§å¤æ°ã®ã³ããããéãã¦ããã®ã§ãã¨ã©ã¼ã¡ãã»ã¼ã¸ãããããããªï¼ãã¨ããããããããã°ã£ãããªä¿®æ£æ¹æ³ãéããã
- çµæããã¶ãä¿®æ£ããããã§å£ãããã¿ãããªã®ããã£ãã¨æãã
- 1å¹´çã¿ãããªãã°ã¬ã¼ããã
- æå¾ã«å®èµ°ããã³ãããã¾ã§æ»ãã¦ããã£ãã1åãã¤å ¥ãã¦ãããã¨ããå°éãªå¯¾å¿ããã¦ããã°è¯ãã£ãã
ðè¯ãã£ããã¨
- åºç¤ã«alpã®çµæ解æã¨ãå
¨ä½çãªã½ã¼ã¹ã³ã¼ãã®ããã«ããã¯èª¿æ»ãè¡ã£ãçµæãæ¹åãã¤ã³ãèªä½ã¯ããã¨ãããçããã¨æãã
- ä½å解説ãèããªããããããããããããã£ã¦ããã¼ï¼ãã¨è² ãæãã¿ãçãä¸ãã£ãã
- çãæãå®ãããã¨ãæ
å½ã決ããæã«ã¡ããã©ã¡ã³ãã¼ã®æè¡é åããããã³ã°ãã¦ããã
- ã¢ã«ã´ãªãºã ã¯AtCoderæ å½ã®@tzmãé©ä»»ã
- N+1åé¡ã¯æ°å¦çããã¯ãã¼ã³ã§@qwavãé©ä»»ã
- SSEã¯æ£ã å®è£ ãã¦ãã@uenoyamaãé©ä»»ã
- ðã¨ã«ãããã«ã楽ããã£ãðã8æéã¯é·ãããªã¼ã¨æã£ã¦ããã©ãå§ã¾ã£ããä¸ç¬ã ã£ãã
- ã¨ãã«17:30-18:00ã®æå¾ã®ä¿®æ£æéã¯ãçµæã¯å¤±æã ã£ããããããåãããä¸ä½è¡ããããããªãï¼ãã¨ããã¯ã¯ã¯ã¯æããã£ã¦ããæ¿å¯ãªæéã ã£ãã
- ISURIDEããããè¯ãã§ãã¦ãåé¡ã ãªã¼ã¨æã£ãããããã³ã°å¦çãsystemdããã®å¼ã³åºããªã®ã§ãããã ã¨ä¸¦åå¦çã§ã¯ãªãã¦ã¢ã«ã´ãªãºã ã®åé¡ã«ãªã£ã¦ãè¨èªéã®åªå£ãåºã«ããã ãããªã¼ãã¨æã£ãããã°ããããªã
éå¶ã®æ¹ã¯å¤§å¤ã ã¨æãã¾ãããã¾ãæ¥å¹´åå ããã¦ããã ããã¨æãã¾ãï¼
ãããã¨ããããã¾ããï¼ï¼