- 10:00 競æéå§
- 17:00 ãªãŒããŒããŒãã®æŽæ°åæ¢
- 18:00 競æçµäº
- 19:30 çµæçºè¡š(äºå®)
ISUPipe ã®ä»æ§ã«ã€ããŠã¯ISUPipe ã¢ããªã±ãŒã·ã§ã³ããã¥ã¢ã«ãåç §ããŠãã ããã
ISUCON13 ã®ç«¶æã§ã¯äžèšã®ãŠã§ããµã€ããå©çšããŸããäºåã«ç»é²ããæ å ±ãçšããŠãã°ã€ã³ããŠãã ããã ãªãããã®ããŒãžã¯ç«¶æéå§æå»ãŸã§ã¢ã¯ã»ã¹ããããšã¯ã§ããŸããã
https://portal.isucon.net/contest/
ããŒã¿ã«ã§ã¯ãè² è·èµ°è¡ïŒãã³ãããŒã¯ïŒã®å®è¡/çµæ確èªã質å/ãµããŒãäŸé Œã®éä¿¡ããªãŒããŒããŒãã®ç¢ºèªãã§ããŸãã
ããŒã¿ã«äžã®ãªãŒããŒããŒãã¯ã競æçµäº 1 æéåã«ä»ããŒã ã®æ å ±ãæŽæ°ãããªããªããèªããŒã ã®æ å ±ã®ã¿æŽæ°ãããŸãã
ISUCON13 ãµããŒã Discord ãµãŒããŒã¯ç«¶æäžãªãã³ã«ãã®ååŸã®æéã¯ãã¹ãŠã®ãã£ã³ãã«ãçºèšäžå¯ãšãªããŸãã 競ææéäžã¯ããŒã¿ã«ãéããŠè³ªå/ãµããŒãäŸé Œãéä¿¡ããããšãã§ããŸãã®ã§ããã¡ããå©çšããŠãã ããã
ãã ããåå è ïŒä»¥äžéžæïŒã¯ç«¶ææéäžã Discord ã®ç¢ºèªãå¯èœãªç¶æ ãéç¥ãåãåããç¶æ ãç¶æããŠãã ããã ããã¯äž»å¬è ãéžæãšãªã¢ã«ã¿ã€ã ã§ã®ãã£ãããå¿ èŠã ãšå€æããå Žåãäž»å¬è ã Discord äžã§ãã©ã€ããŒããã£ã³ãã«ãäœæãã¡ã³ã·ã§ã³ã®äžãåŒã³ãããè¡ãå Žåãããããã§ããåŒã³ããã«å¿ããªãå Žåã競æã«æ¯éããããå¯èœæ§ããããããå¿ ãå¿çå¯èœãªç¶æ ãç¶æããŠãã ããã
ãŸããäž»å¬è ããã®ã¢ããŠã³ã¹çã Discord ã§å®æœãããŸãã
éžæã¯äž»å¬è ãžè³ªåãéä¿¡ããããšãã§ããŸãã質åã¯ç«¶æå 容ã»ããã¥ã¢ã«ã»ã¬ã®ã¥ã¬ãŒã·ã§ã³çã«å¯Ÿããçåç¹ã®ç¢ºèªãããµãŒããŒé害ãªã©ã®ãã©ãã«å ±åã»ãµããŒãäŸé Œã«å©çšããããšãã§ããŸãããããã«éããŸããã
äž»å¬è ã¯è³ªåãããå 容ã競æã®äžç°ã§ããå Žåã¯ãåçã§ããªãæšãè¿çããããšããããŸãã
競ææéäžã®è³ªåã«ã€ããŠãäž»å¬è ããã®åçã¯å šéžæãžå ¬éããããã¯åå¥ã«åçãããŸããå šéžæãžå ¬éãããå Žåã質åå 容ã®åæããããã¯äž»å¬è ã«ããå 容ã®èŠçŽãå ¬éãããŸããæªåçã®è³ªåã»æªå ¬éã®åçã«ã€ããŠã¯è³ªåããéžæããã³ãã®ããŒã ã¡ã³ããŒãäž»å¬è ã®ã¿ã確èªã§ããŸãã質åãžã®åçã»æŽæ°ã¯ããŒã¿ã«äžã«ãŠéžæããã³ãã®ããŒã ãžéç¥ãããŸãã
äž»å¬è ã¯ç«¶ææéäžã®è³ªåãžã®åçããååãšããŠå šéžæãžå ¬éããŸãããã ããéè€ãã質åããéžæããã³ããŒã åå¥ã®åé¡ã«å¯Ÿãã察å¿ã®å Žåããã®éãã§ã¯ãããŸããã
äž»å¬è ãäºåã« Discord ãµãŒããŒçã§åç¥ããŠããéããäžèšã¯ãµããŒã察象å€ãšãªããŸãã
競æç°å¢ç¢ºèªãäºåã«è¡ã£ãŠããªãããŒã ããã®ç«¶æç°å¢ã«é¢ãã質å/ãµããŒãäŸé Œ
- AWS ã¯ãŒãã³ã«é¢ãã質å/ãµããŒãäŸé Œ
- ã¹ãã³ãµãŒå瀟ãæäŸããŠãããµãŒãã¹ã«ã€ããŠã®è³ªå/ãµããŒãäŸé Œ
競æã«åå ããã«ããããåããŒã ãçšæãã AWS ã¢ã«ãŠã³ãã§ç«¶æç°å¢ãäžèšã®æé ã«åŸã£ãŠæ§ç¯ããŠãã ããã
ãŸããç°å¢æ§ç¯ã«ã¯ AWS CloudFormation ãå©çšãããããããŒã ã¯ããŒã¿ã«äžãã AWS CloudFormation ã®ãã³ãã¬ãŒããããŠã³ããŒãããŸãã ãã³ãã¬ãŒãã¯ããŒã ããšã«åºæã®ãã®ãšãªã£ãŠããããå ±æå³çŠã§ãã
https://portal.isucon.net/contest/
ãã®ãã³ãã¬ãŒãã§ã¯ä»¥äžã®ãªãœãŒã¹ãäœæããŸãã
- EC2 ã€ã³ã¹ã¿ã³ã¹ ïŒc5.largeïŒx 3
- EBSïŒgp3 40GBïŒx 3
- EIP x 3
- VPC x 1
- VPC ãµãããã x 1
- VPC ã«ãŒãããŒãã« x 1
- ã€ã³ã¿ãŒãããã²ãŒããŠã§ã€ x 1
- ã»ãã¥ãªãã£ã°ã«ãŒã x 1
- Availability Zone æ å ±ååŸã«å©çšãã Lambda é¢æ° x 1
- IAM ããŒã« x 2
- EC2 ã€ã³ã¹ã¿ã³ã¹ãããã¡ã€ã« x 1
ãã³ãã¬ãŒãããäœæããã IAM ããŒã«ã¯ãEC2 ã€ã³ã¹ã¿ã³ã¹ããã³ Lambda é¢æ°ã§äžèšãªãœãŒã¹ã®æ å ±ååŸãè¡ãããã«å©çšããŸãã èš±å¯ãããŠããã¢ã¯ã·ã§ã³ã¯ AWS ã®ä»æ§äžãã¢ã«ãŠã³ãã«ååšããä»ã®ãªãœãŒã¹ã®æ å ±ãé²èŠ§ã§ããèšå®ã«ãªã£ãŠããŸãããäž»å¬è ã¯äžèŠãªæ å ±ã®ååŸã¯è¡ããŸããã
- AWS ãããžã¡ã³ãã³ã³ãœãŒã«ã® CloudFormation ãéããããŒãžå³äžã«è¡šç€ºãããŠãããªãŒãžã§ã³åãã¢ãžã¢ãã·ãã£ãã¯ïŒæ±äº¬ïŒïŒap-northeast-1ïŒã«ãªã£ãŠããããšã確èªããŸãã
- ãã¹ã¿ãã¯ã®äœæããã¯ãªãã¯ããŸãã æ¢åã®ã¹ã¿ãã¯ãããå Žåã¯ãã¹ã¿ãã¯ã®äœæããããæ°ãããªãœãŒã¹ã䜿çšïŒæšæºïŒããéžæããŸãã
- ãã¹ã¿ãã¯ã®äœæãããŒãžããããã³ãã¬ãŒãã®æºåå®äºããããã³ãã¬ãŒããã¡ã€ã«ã®ã¢ããããŒãããéžæããäžèšã§ããŠã³ããŒããããã³ãã¬ãŒãã®ã¢ããããŒããè¡ãã次ãžããã¯ãªãã¯ããŸãã
- ãã¹ããã 2 ã¹ã¿ãã¯ã®è©³çŽ°ãæå®ãã§ã¯ä»»æã®ã¹ã¿ãã¯åãèšå®ããã次ãžããã¯ãªãã¯ããŸãã
- ãã¹ããã 3 ã¹ã¿ãã¯ãªãã·ã§ã³ã®èšå®ãã§ã¯å€æŽãè¡ããã次ãžããã¯ãªãã¯ããŸãã
- ãã¹ããã 4 ã¬ãã¥ãŒãã«ãããŠãããŒãžæäžéšãã¹ã¿ãã¯ã®äœæããã¿ã³ã®äžã«è¡šç€ºãããŠãããAWS CloudFormation ã«ãã£ãŠ IAM ãªãœãŒã¹ãäœæãããå Žåãããããšãæ¿èªããŸããã«ãã§ãã¯ãå ¥ããäžã§ããã¹ã¿ãã¯ã®äœæããã¯ãªãã¯ããŸãã
- äœæããã¹ã¿ãã¯ã®ç¶æ
ã
CREATE_COMPLETE
ïŒäœæå®äºïŒã«ãªããŸã§åŸ æ©ããŸãã
ãããžã¡ã³ãã³ã³ãœãŒã«ããæ¥æ¬èªãã®å Žåæé ã§ããä»ã®èšèªã§åæ§ã®æé ã«åŸã£ãŠãã ããã
ã¹ã¿ãã¯ã®äœæå®äºåŸãæ°åçšåºŠã§ SSH æ¥ç¶ã§ããããã«ãªããŸãããµãŒããŒã«ã¯éžæã GitHub ã«ç»é²ããŠãã SSH éµãå©çšããŠããŠãŒã¶å isucon 㧠SSH æ¥ç¶ãã§ããŸãã
ãŸããAWSãããŒãžã¡ã³ãã³ã³ãœãŒã«ããã»ãã·ã§ã³ãããŒãžã£ãŒã«ããæ¥ç¶ãå¯èœã§ããã»ãã·ã§ã³ãããŒãžã£ãŒã§æ¥ç¶ããå Žå㯠ssm-user ãšãããŠãŒã¶ãŒã«ãªããããsudo su - isucon
㧠isucon ãŠãŒã¶ãŒã«åãæ¿ããŠãã ããã
ãµãŒããŒã® IP ã¢ãã¬ã¹ã¯ããŒã¿ã«ããAWS ãããžã¡ã³ãã³ã³ãœãŒã«ã® EC2 ã€ã³ã¹ã¿ã³ã¹ããŒãžãã確èªã§ããŸãã
ãµãŒããŒãžæ¥ç¶åŸãäžèšã®ã³ãã³ããå®è¡ããããšã§æ£ããèµ·åããŠãããæ€èšŒãè¡ããŸãã
$ sudo /opt/isucon-env-checker/envcheck
ãµãŒããŒèµ·ååŸã«ããŒã¿ã«ã®ãµãŒããŒãªã¹ãã«è¡šç€ºãããªãå Žåã¯ããµãŒããŒã«ãSSH(ãŸãã¯ã»ãã·ã§ã³ãããŒãžã£)ãã°ã€ã³ããäžèš envcheck ã³ãã³ããå®è¡ãã詳现ã確èªããŠãã ããã
ISUPipe ã«ã¯ããµãŒããŒã®Web ãã©ãŠã¶ãã HTTPS ã§ã¢ã¯ã»ã¹ã§ããŸãã
ISUPipe ã¯ãã¹ãåã«äŸåããæåãããããããã©ãŠã¶ã«ãµãŒããŒã®IPã¢ãã¬ã¹ãçŽæã¡ãã圢ã§ã®é²èŠ§ã¯ã§ããŸããã以äžã®æé ã§hostsãã¡ã€ã«ãç·šéããåäœç¢ºèªã®ããã®ãã¹ãåã競æãµãŒããŒã®IPã¢ãã¬ã¹ã«ã€ãªããããã«ããŸãã
Mac ã Linux ã§ããã° /etc/hosts
ã«ã Windows ã§ããã° C:\Windows\System32\drivers\etc\hosts
ã«ä»¥äžã®è¡ãè¿œèšããŸãã{ãµãŒã㌠IP ã¢ãã¬ã¹}
ã¯ãµãŒããŒã® IP ã¢ãã¬ã¹ã«èªã¿æ¿ããŠãã ããã
{ãµãŒã㌠IP ã¢ãã¬ã¹} pipe.u.isucon.dev
{ãµãŒã㌠IP ã¢ãã¬ã¹} test001.u.isucon.dev
ãã®ã»ãã¢ããªã±ãŒã·ã§ã³ã®ç¢ºèªã®ããã«ãµããã¡ã€ã³ãè¿œå ããããšããããŸãã
{ãµãŒã㌠IP ã¢ãã¬ã¹} ãµããã¡ã€ã³.u.isucon.dev
äžèšå€æŽã®åæ ã«ã¯ãã©ãŠã¶ã®åèµ·åãå¿ èŠãªå ŽåããããŸãã
ISUPipe ãžã®ãã°ã€ã³ã¯ä»¥äžã®ã¢ã«ãŠã³ãæ å ±ãçšããããšãã§ããŸãã
ãŠãŒã¶å | ãã¹ã¯ãŒã |
---|---|
test001 | test |
åæå®è£ ã§ã¯ãã©ãŠã¶ããã®ã¢ã¯ã»ã¹ã«ããããµãŒãã®è² è·ãé«ããªãããšãèããããŸãã
è² è·èµ°è¡ãžã®åœ±é¿ãé¿ããããããã³ãããŒã«ãŒã®å®è¡äžã¯ãã©ãŠã¶ã§ã®è¡šç€ºã¯è¡ããªãã®ãæšå¥šãããŸãã
è² è·èµ°è¡ã¯ããŒã¿ã«äžãããªã¯ãšã¹ãããŸãã
ããŒã¿ã« ã«ã¢ã¯ã»ã¹ãããJob Enqueue Formããããåå解決ãè¡ãã察象ã®ãµãŒããŒãéžæããEnqueueããã¯ãªãã¯ããããšã§è² è·èµ°è¡ã®ãªã¯ãšã¹ããè¡ãããé 次éå§ãããŸãã
ãªããè² è·èµ°è¡ãåŸ
æ©äžïŒWAITING
ïŒãããã¯å®è¡äžïŒRUNNING
ïŒã®éã¯è¿œå ã§ãªã¯ãšã¹ããè¡ãããšã¯ã§ããŸããã
ãã³ãããŒã«ãŒãäžæ£ã«çµäºããå Žåãçµæãããã«è¡šç€ºãããªãå ŽåããããŸãã6å以äžãã®ç¶æ
ãç¶ãå Žåã¯èªå㧠ABORT
ç¶æ
ãšãªãã次ã®è² è·èµ°è¡ã®ãªã¯ãšã¹ããè¡ãããšãã§ããŸãã
ãµãŒããŒèµ·åïŒåèµ·åãå«ãïŒæã«ç«¶æç°å¢ãäž»å¬è ã®æå®ããç°å¢ã§æ§ç¯ãããŠãããã確èªãããµãŒã㌠IP ã¢ãã¬ã¹ãå«ãç°å¢æ å ±ãããŒã¿ã«ã«éä¿¡ããåŠçãå®è¡ãããŸãã
ããŒã¿ã«ã¯éä¿¡ãããç°å¢æ å ±ãå ã«ãããŒã¿ã«äžã«è¡šç€ºããããµãŒã㌠IP ã¢ãã¬ã¹çã®ãµãŒããŒæ å ±ãæŽæ°ããŸãããªããããã¯ãµãŒããŒåäœã§æŽæ°ãããŸãã
ãã®åŠçã¯ãµãŒããŒèµ·åæ以å€ã«ã以äžã®ã³ãã³ãã§éžæèªããè¡ããŸãã
$ sudo /opt/isucon-env-checker/envcheck boot
ãµãŒãç°å¢ã«ç¢ºèªãå¿ èŠãªäºé ãããã°ãç»é²ã¯ãããŸããã
éžæèªããèšå®å€æŽçã«ãã競æç°å¢ãç Žå£ãããªã©ããŠãåæç¶æ ã«æ»ãå¿ èŠãããå Žåã¯äžèšã競æç°å¢æ§ç¯ãšæ¥ç¶ããåèã«éžæèªãã AWS CloudFormation ã§æ°ãã«ç«¶æç°å¢ã®æ§ç¯ãè¡ãããšã«ãªããŸããåæ§ç¯ä»¥åã®ç«¶æç°å¢äžã§å€æŽãå ãããœãŒã¹ã³ãŒããèšå®ãã¡ã€ã«çã®ç§»è¡ãå¿ èŠãªå Žåã¯ãåããŒã ã®è²¬ä»»ã§è¡ã£ãŠãã ããã
ãªãããµãŒããŒã®èµ·åã»åæ¢ã»åèµ·å㯠AWS ãããžã¡ã³ãã³ã³ãœãŒã«ã API ããéžæãè¡ã£ãŠãæ§ããŸããã
åŸè¿°ãããè€æ°ã¹ã¿ãã¯ãã®åé¡ãåé¿ãããããåæ§ç¯äœæ¥å®äºåŸã¯ä»¥åã® AWS CloudFormation ã¹ã¿ãã¯ãåé€ããããšãããããããŸãã
ãµãŒããªã¹ãã¯ããŒã ãããæ倧3å°ãŸã§ã®ç»é²ãšãªããŸãã以åã®ãµãŒããŒãäžèŠ§ã«æ®ã£ãŠãããšåæ§ç¯åŸã®ãµãŒãã¯ç»é²ãããŸããã
åæ§ç¯ãè¡ãéã¯ãäœæ¥éå§åã«ãµãŒããŒãªã¹ãããåé€ããŠãã ããã
ããåæ§ç¯ãå ã«è¡ãªã£ãŠãµãŒããŒãè¿œå ãããªãå Žåã¯ããµãŒããŒãªã¹ããã䜿çšããªããµãŒããŒãåé€ããå šãŠã®æ°ãããµãŒããŒãåèµ·åãè¡ãªã£ãŠãã ããããµãŒããŒæ å ±ã®æŽæ°ã¯ãµãŒããŒãèµ·åïŒåèµ·åãå«ãïŒãããéã«è¡ãããŸãã
ããŒã¿ã«ããããŠã³ããŒããããã³ãã¬ãŒããå©çšã㊠AWS CloudFormation ã¹ã¿ãã¯ãè€æ°äœæããŠãæ§ããŸããããã ãã以äžã®ç¹ã«çæããŠãã ããã
ãŸãããç°å¢æ å ±ã®ç¢ºèªãšéä¿¡ãã§èšåããéãããµãŒããŒæ å ±ã®æŽæ°ã¯ãµãŒããŒåäœããã€ãµãŒããŒãèµ·åïŒåèµ·åãå«ãïŒãããã³ã«å®æœãããŸãã ãã®ãããè€æ°ã®ã¹ã¿ãã¯ã§äœæããããµãŒããŒãåæã«ååšããŠããæãéžæã®æäœã«ãã£ãŠã¯ãããŒã¿ã«äžã®ãµãŒããŒæ å ±ãè€æ°ã®ã¹ã¿ãã¯ã«è·šã£ãŠããŸãå ŽåïŒæ··åšïŒããããŸãã
競ææéäžã¯æ··åšããç¶æ ã«ãªã£ãŠããŸã£ãŠãåé¡ãããŸãããã競æçµäºæç¹ã§ããŒã¿ã«äžã®ãµãŒããŒæ å ±ãæ··åšããŠããå Žåã¯å€±æ ŒãšãªããŸãã
äž»å¬è ã¯ããŒã¿ã«ã«ç»é²ãããç°å¢ä»¥å€ã®ãµããŒãããæ··åšããç¶æ ã§ã®ãµããŒãã¯è¡ããŸããã
ãªããæ··åšããŠãããã®å€æã¯ããŒã¿ã«ãšã¹ã¿ãã¯ã®ãªãœãŒã¹ã«è¡šç€ºãããŠãã IP ã¢ãã¬ã¹ãå ã«è¡ã£ãŠãã ããã
éžæã競æãé²ããã«ããã£ãŠæ°ããªããŒã解æŸãå¿ èŠãªå Žåãã»ãã¥ãªãã£ã°ã«ãŒãã®å€æŽã¯è¡ãªã£ãŠãæ§ããŸããã
ãã ããSSH(TCP/22)ãHTTPS(TCP/443) ããã³ DNS(UDP/53) ã«ã€ããŠã¯ç«¶æã«åœ±é¿ãããå€æŽããªãã§ãã ããã
äžèšã»ãã¥ãªãã£ã°ã«ãŒãã®å€æŽã«ããããã³ãããŒã¯ãå®è¡ã§ããªãå Žåã¯å€±æ ŒãšãªããŸãã
- 競æçµäºåŸã¯äž»å¬è
ããã¢ããŠã³ã¹ããããŸã§ç«¶æç°å¢ã®ã·ã£ããããŠã³ãåæ¢ãªã©ã¯è¡ããã3 å°ãšãèµ·åããç¶æ
ãç¶æããŠãã ããã
- 競ææéäžã®åèµ·åãäžæçãªåæ¢ã«é¢ããŠã¯åé¡ãããŸããã
- 競æã«å©çšã§ããèšç®æ©è³æºã¯äž»å¬è
ãå
¬éãã CloudFormation ãã³ãã¬ãŒãã®å
容ã«æ²¿ã£ãŠèµ·åããã EC2 ã€ã³ã¹ã¿ã³ã¹ã®ã¿ã§ãã
- äŸãã°ããã³ãã¬ãŒãã§äœæããããªãœãŒã¹ãããã®å 容ã«æ²¿ããªããªãå€æŽïŒäŸïŒ ã€ã³ã¹ã¿ã³ã¹ã¿ã€ãã®å€æŽïŒãè¡ã£ãç¶æ ã§ã競æã«å©çšãããšå€±æ ŒãšãªããŸãã
- 競æçµäºæç¹ã§ ç°å¢æ å ±ã®ç¢ºèª ã«å€±æããç¶æ ã®å Žåãå€±æ ŒãšãªããŸãã
- 競æçµäºæç¹ã§ããŒã¿ã«äžã®ãµãŒããŒæ å ±ã«è€æ°ç°å¢ïŒã¹ã¿ãã¯ïŒãæ··åšããç¶æ ã®å Žåãå€±æ ŒãšãªããŸãã
- ã¬ã®ã¥ã¬ãŒã·ã§ã³ã«èšèŒããéããã¢ãã¿ãªã³ã°ããã¹ããéçºã«ãããŠå€éšã®è³æºãçšããŠãæ§ããŸãããïŒäŸïŒ ã¡ããªã¯ã¹èšæž¬ãµãŒãã¹ïŒãã¹ã³ã¢ãåäžããããããªãå¹æãæã€ãã®ã§ãã£ãŠã¯ãããŸãããããã¯åè¿°ããŠããè€æ°ç°å¢ã®å©çšãå«ã¿ãŸãã
- 競æçµäºåŸã¯ãäž»å¬è
ã远詊ãè¡ããŸããDiscord ãµãŒã㌠ããã³ https://isucon.net ã«ãŠäž»å¬è
ãã¢ããŠã³ã¹ããããŸã§ã競æç°å¢ã®æäœã¯ããªãã§ãã ããã
- 競æçµäºåŸãå¥éã¢ããŠã³ã¹ããããŸã§ã®äœæ¥ãæäœïŒåé€ãå«ãïŒã¯å€±æ ŒãšãªããŸãããªããã¢ããŠã³ã¹ã¯çµæçºè¡šåŸã®äºå®ã§ãã
- 競æç°å¢ã®åé€ã¯ãåããŒã ã§è¡ãå¿ èŠããããŸããåé€ãè¡ããªãã£ãããã«çºçããäžå©çã«ã€ããŠãäž»å¬è ã¯äžåã®è²¬ä»»ãè² ããŸãããåé€ãè¡ã£ãŠããã¿ã€ãã³ã°ã«ã€ããŠããçµæçºè¡šåŸã«ã¢ããŠã³ã¹ã®äºå®ã§ãã
äžèšã¯è¿œè©Šãç°å¢ç¢ºèªã«å©çšãããããå€æŽããå Žåã¯å€±æ ŒãšãªããŸãã
- envcheck.serviceã«é¢ãããã¡ã€ã«
/etc/systemd/system/envcheck.service
/etc/systemd/system/multi-user.target.wants/envcheck.service
/opt/isucon-env-checker
å ã®ãã¡ã€ã«ããã€ããªãã¡ã€ã«
- aws-env-isucon-subdomain-address.service ã«é¢ãããã¡ã€ã«
/etc/systemd/system/aws-env-isucon-subdomain-address.service
/etc/systemd/system/multi-user.target.wants/aws-env-isucon-subdomain-address.service
/opt/aws-env-isucon-subdomain-address.sh
- isuadmin ãŠãŒã¶ã«é¢ãããã¡ã€ã«ããã³ãã°ã€ã³æ å ±
- ãã®ä»ãäž»å¬è ã«ãã远詊ã劚ããå€æŽïŒäŸïŒ ãµãŒããŒäžã® isucon 以å€ã®ãŠãŒã¶ã«é¢ããããŠãŒã¶åé€ãæ¢åã®å ¬ééµã®åé€ããµãŒããŒã®åèµ·åã®åŠšå®³ïŒ
æ åãšãµã ãã€ã«ç»åã®é
ä¿¡ã¯äž»å¬è
ãæäŸããã³ã³ãã³ãé
ä¿¡ãµãŒãã¹ media.xiii.isucon.dev
ããè¡ãããŸãã
media.xiii.isucon.dev
ã«é害çãçºçããå Žåããã©ãŠã¶äžã§ã®æ åé
ä¿¡ã»ãµã ãã€ã«è¡šç€ºããããããªããŸããããã³ãããŒã«ãŒã®åäœãæ¡ç¹ã«ã¯äžå圱é¿ãããŸããã
äžèšã®èšèªã§ã®å®è£ ãæäŸãããŠããŸãã
- Go
- Node.js
- Perl
- PHP
- Python
- Ruby
- Rust
åæç¶æ ã§ã¯ Go ã«ããå®è£ ãèµ·åããŠããŸãã
åèšèªå®è£ 㯠systemd ã§å®è¡ã管çãããŠããŸãã åèå®è£ ã Go ããä»ã®èšèªã«åãæ¿ããã«ã¯ä»¥äžæé ãå®è¡ããŸãã
$ sudo systemctl stop isupipe-go.service
$ sudo systemctl disable isupipe-go.service
以äžã®ã³ãã³ã㧠stop ãš disable ãäž¡æ¹è¡ãããšãã§ããŸã
$ sudo systemctl disable --now isupipe-go.service
{åèšèª}
ã®ãšããã«ã¯ perlãrubyãã¯ãããŸãã
$ sudo systemctl start isupipe-{åèšèª}.service
$ sudo systemctl enable isupipe-{åèšèª}.service
以äžã®ã³ãã³ã㧠start ãš enable ãäž¡æ¹è¡ãããšãã§ããŸã
$ sudo systemctl enable --now isupipe-{åèšèª}.service
ãã ããPHP ã䜿ãå Žåã®ã¿ãsystemd ã®èšå®å€æŽã®ä»ã«ã次ã®ããã« nginx ã®èšå®ãã¡ã€ã«ã®å€æŽãå¿ èŠã§ãã
$ sudo ln -s /etc/nginx/sites-available/isupipe-php.conf /etc/nginx/sites-enabled/
$ sudo systemctl restart nginx.service
äžéšèšèªã§ã¯è² è·èµ°è¡çµäºåŸãåŠçãèµ°ãç¶ãããã³ãããŒã«ãŒããã®ãªã¯ãšã¹ãã¯æ¢ãŸã£ãŠããã«ãããããããè² è·ãäžãããªãããšããããŸãã
æéçµéã«ãã解æ¶ããŸãããäœæ¥äžã®é害ãšãªãå Žåã¯ãã¢ããªã±ãŒã·ã§ã³ã®åèµ·åãªã©ãè¡ãªã£ãŠãã ããã
åèå®è£ ã§ã¯ãPowerDNS ãDNSãµãŒããŒãšããŠåäœããŠããŸãã
ããŒã¿ã«ããè² è·èµ°è¡ãå®è¡ããå Žåãæå®ãããµãŒããŒ(IPã¢ãã¬ã¹)ã®DNSãµãŒããŒ(53/UDP)ã«åå解決ãè¡ããåŸãããIPã¢ãã¬ã¹ã«å¯ŸããŠHTTPSã§ã¢ã¯ã»ã¹ãè¡ããŸããDNSãµãŒããŒãåäœããŠããªãå ŽåããããŒã¿ã«ã«ç»é²ããããµãŒããŒ3å°ã®IPã¢ãã¬ã¹ä»¥å€ãåå解決ã®çµæãšããŠåŸãããå Žåããã³ãããŒã«ãŒãèµ°è¡ããããšã©ãŒãšãªããŸãã
åå解決ã®ç¢ºèªã¯ dig ã³ãã³ããå©çšããããšã§è¡ããŸãã
察象ãµãŒããŒã«å ¥ã
$ dig pipe.u.isucon.dev @127.0.0.1
ãããã¯ãã®ä»ã®ç°å¢ãã
$ dig pipe.u.isucon.dev @{ãµãŒãã®ã°ããŒãã«IP}
ãšå®è¡ããããšã§ãåå解決çµæã確èªã§ããŸãã
è² è·èµ°è¡ãäžæ£ã«çµäºããåå解決ãæ£ããè¡ãããªãå ŽåãDNSãµãŒããŒã®ãŸãŒã³æ å ±ã®åæåãè¡ãªã£ãŠãã ããã
$ pdnsutil delete-zone u.isucon.dev
$ sudo rm -f /opt/aws-env-isucon-subdomain-address.sh.lock
$ sudo reboot # åèµ·åããŸã
åèµ·ååŸããµãŒããŒã®ã°ããŒãã«IPã確èªããããŸãŒã³æ å ±ãåäœæãããŸãã
åèå®è£ ã§ã¯ PowerDNS 㯠MySQL ãããã¯ãšã³ãããŒã¿ããŒã¹ãšããŠåäœããŠããŸãã
ããŒãã«ã®å®çŸ©ã¯ãµãŒããŒäžã® /usr/share/doc/pdns-backend-mysql/schema.mysql.sql
ãåèã«æ§æãããŠããŸãã
åå解決㯠UDP/53 ãéããŠè¡ãããŸããTCPãžã®ãã©ãŒã«ããã¯ã¯ãµããŒãããŠããŸããã
Aã¬ã³ãŒãã®åãåããã«å¯ŸããŠãAã¬ã³ãŒãã®ã¿ãè¿ãããã«ããŠãã ãããCNAMEã®ååž°åãåããã¯è¡ããŸããã
DNSã©ãŠã³ãããã³ã«ã€ããŠãè€æ°ã®Aã¬ã³ãŒããè¿ãããå Žåãæåã®IPã¢ãã¬ã¹ãæ¡çšããŸããIPã¢ãã¬ã¹ã«å¯ŸããŠæ¥ç¶ã§ããªãã£ãå Žåã«æ¬¡ã®ãµãŒããŒãåç §ããåäœã¯èŽããŸããã
åå解決ã§åŸãããIPã¢ãã¬ã¹ããããŒã¿ã«ã«ç»é²ãããŠãããµãŒããŒã®IPã¢ãã¬ã¹ä»¥å€ã®å Žåããã³ãããŒã«ãŒã¯ãšã©ãŒãšããŠèªèããŸãã
ãã³ãããŒã«ãŒã®åå解決ã®ã¿ã€ã ã¢ãŠãã¯2ç§ã§èšå®ãããŠããŸããã¿ã€ã ã¢ãŠããDNSãµãŒããŒã«æ¥ç¶å€±æããéã®ãªãã©ã€ã¯æ倧5åãŸã§è¡ããŸãããã ããè² è·èµ°è¡äžã¯ãªãã©ã€ãè¡ããŸããã
ãŸããTTLãèšå®ããããšã§ãã³ãããŒã«ãŒã¯æå®ãããç§æ°ãŸãã¯ãã³ãããŒã«ãŒçµäºã®ã©ã¡ããçãæéãŸã§ãçµæã®IPã¢ãã¬ã¹ããã£ãã·ã¥ããŸãã
è² è·èµ°è¡äžãDNSãµãŒãã«å¯ŸããŠãããããDNS氎責ãæ»æããè¡ãããŸãã
DNS氎責ãæ»æã¯ã©ã³ãã ãªãµããã¡ã€ã³ãçæãã倧éã®ã¢ã¯ã»ã¹ãè¡ãããšã§DNSãµãŒãã®å¿çã«åœ±é¿ãäžããããšãç®çãšããæ»æææ³ã§ãã
ãã³ãããŒã«ãŒã¯DNS氎責ãæ»æããã³ã¹ã¯ã¬ã€ãã³ã°ãè¡ããåå解決ãã§ãããš HTTPS ã«ããã¢ã¯ã»ã¹ãè©Šã¿ãåäœãè¡ããŸãã倱æ(NXDOMAINãå¿çãªã)ã§ã¯æ¥ãŸããã
åæå®è£ ã§ã¯ããŒã¿ããŒã¹ãšã㊠MySQL ãå©çšããŠããŸãã
åèå®è£ ã®MySQLã«ç®¡çè æš©éã§æ¥ç¶ããã«ã¯ä»¥äžã®ããã«ããŸãã
$ sudo mysql {ããŒã¿ããŒã¹å}
åèå®è£
ã§ã¯ãåæååŠçïŒPOST /api/initialize
ïŒã«ãããŠããŒã¿ããŒã¹ã®ããŒã¿ããã³DNSãŸãŒã³æ
å ±ããã³ãããŒã«ãŒãæ³å®ããŠããç¶æ
ã«æ»ããŸãã 以äžã®ã³ãã³ãã§ãããŒã¿ããŒã¹ã®ããŒã¿ãåæåã§ããŸãã
$ ~/webapp/sql/init.sh
DNSãŸãŒã³æ å ±ã®ã¿ãåæåããå Žåã以äžã®ã³ãã³ããå®è¡ããŸã
$ ~/webapp/pdns/init_zone.sh
åæååŠçã¯çšæãããç°å¢å ã§ããã³ãããŒã«ãŒãèŠæ±ããç¯å²ã®æŽåæ§ãæ ä¿ããŸãã ãµãŒããŒãµã€ãã§åŠçã®å€æŽã»ããŒã¿æ§é ã®å€æŽãªã©ãè¡ãå Žåããã®åŠçãè¡ã£ãŠããå 容ãæŒããªãæäŸããŠãã ããã
åèå®è£ ã§ã¯2ã€ã®ããŒã¿ããŒã¹ããããŸãã
- isupipe ã¢ããªã±ãŒã·ã§ã³ãå©çšããããŒã¿ããŒã¹
- isudns PowerDNSã®ãŸãŒã³æ å ±ãæ ŒçŽããããŒã¿ããŒã¹
isupipe ããŒã¿ããŒã¹ã®ã¹ããŒãã¯åæå®è£ ã«å«ãŸããŠããŸã
- webapp/sql/initdb.d/00_create_database.sql ããŒã¿ããŒã¹ããã³ãŠãŒã¶ã®äœæ
- webapp/sql/initdb.d/10_schema.sql isupipe ããŒã¿ããŒã¹ã®ã¹ããŒã
isupipe ããŒã¿ããŒã¹ãåæåããã«ã¯ããŒã¿ããŒã¹ã DROP DATABASE isupipe
ããã³ CREATE DATABASE isupipe
ã§åäœæãã
$ cat webapp/sql/initdb.d/10_schema.sql | sudo mysql isupipe
ãšããã®ã¡ãããŒã¿ã®åæåãè¡ãªã£ãŠãã ããã
ãµãŒããŒã«ã¯ *.u.isucon.dev
ããã³ u.isucon.dev
ã®TLS蚌ææžãèšå®ãããŠããŸãã
ãã®ãã¹ãå㧠HTTPS æ¥ç¶ãè¡ããšTLS蚌ææžã®æ€èšŒãšã©ãŒã¯çºçããŸããããã³ãããŒã«ãŒã¯ãããæåŸ ããŸãã
ãã³ãããŒã«ãŒã«ããè² è·èµ°è¡ã¯ä»¥äžã®ããã«å®æœãããŸãã
- åæååŠçã®å®è¡ POST /api/initializeïŒ42ç§ã§ã¿ã€ã ã¢ãŠãïŒ
- ã¢ããªã±ãŒã·ã§ã³æŽåæ§ãã§ãã¯ïŒæ°ç§ïœæ°åç§ïŒ
- è² è·ãã¹ãïŒ60 ç§ïŒ
- æçµãã§ãã¯ïŒæ°ç§ïœæ°åç§ïŒ
åæååŠçãããã¯ã¢ããªã±ãŒã·ã§ã³æŽåæ§ãã§ãã¯ã«å€±æãããšãè² è·èµ°è¡ã¯å³æ倱æïŒfailïŒã«ãªããŸãã
è² è·ãã¹ãçµäºæç¹ã§ HTTP ã¬ã¹ãã³ã¹ã®åŠçãæã¡åããŸããæªå®äºã®ãªã¯ãšã¹ããªã©ã¯åŒ·å¶çã«åæãããŸããè² è·ãã¹ãçµäºä»¥éã«åŒ·å¶çã«åæããããªã¯ãšã¹ãã¯ã¹ã³ã¢ãæ€èšŒã«ã¯åœ±é¿ããŸãã
ãã³ãããŒã«ãŒã®ã¿ã€ã ã¢ãŠãã¯ãããã以äžã®ããã«èšå®ãããŠããŸãã
- åæååŠçã®å®è¡: 42ç§
- ã¢ããªã±ãŒã·ã§ã³ã®æŽåæ§ãã§ãã¯: 20ç§
- è² è·ãã¹ã: 20ç§
- æçµãã§ãã¯: 10ç§
è² è·ãã¹ãå®è¡äžã«åæ¢ããããšã¯ãããŸããã
äžéšAPIã®ããŒã¿ã¯ãªã¯ãšã¹ããžã®åæ ãŸã§ã«èš±å®¹ãããç¶äºæéããããŸãã
ISUPipe ã¢ããªã±ãŒã·ã§ã³ããã¥ã¢ã«ãåç §ããŠãã ããã
ã¹ã³ã¢ã¯äžåã®è² è·èµ°è¡äžã«ISUPipeã®æãé(Tip)æ©èœã«ãããééã»å¯ä»ãããéé¡(ISUCON)ã®åèšãšãªããŸãã
ã¹ã³ã¢ã®åèšé¡ããµãŒããšãã³ãããŒã«ãŒãšã§å·®åãããå Žåããã³ãããŒã«ãŒã§èšæž¬ããŠããå€ãã¹ã³ã¢ãšããŸãã
競æäžã®ã¹ã³ã¢ããæåã« 50,000 ISUCON(ç¹)ã«å°éãã 1 ããŒã ãç¹å¥è³ãšããŸãã
ãããã€ã³ã¿ãŒãããã®äŒæ¥è³ã®æ¡ä»¶ã¯ãäžäœ30ããŒã äžã§ãæçµè² è·èµ°è¡ã®DNSã®ãåå解決æåæ°ããæãå€ãã£ãããŒã ãšãªããŸãã
競æäžã®æçµèšæž¬ãæçµã¹ã³ã¢ãšããŸãã以äžã«è¿°ã¹ã远詊ã§failã«ãªã£ãããŒã ãåãé€ããæçµã¹ã³ã¢ã«åºã¥ããŠé äœã決å®ããŸãã
競æçµäºåŸãäž»å¬è ã¯å šãµãŒããŒã®åèµ·ååŸã«è² è·èµ°è¡ãå®æœãåçŸã¹ã³ã¢ãèšæž¬ããŸããäž»å¬è ã«ãã確èªäœæ¥ïŒè¿œè©ŠïŒãè¡ããŸããäžèšã®ç¹ã«ããŠã¯ãŸãå Žåã®æçµã¹ã³ã¢ã¯ fail ãšããŸãã
- åèµ·ååŸã®è² è·èµ°è¡ã§failããå Žå
- åçŸã¹ã³ã¢ãæçµã¹ã³ã¢ã®75%以äžã®å Žå
- envcheckãå©çšãããµãŒãç°å¢ã®ç¢ºèª
- è² è·èµ°è¡å®è¡æã«ã¢ããªã±ãŒã·ã§ã³ã«æžã蟌ãŸããããŒã¿ãããµãŒããŒåèµ·ååŸã«ååŸã§ããªãå Žå
POST /api/initialize
ã¬ã¹ãã³ã¹ã«ãŠãæ¬ç«¶æã§å©çšããèšèªãåºåããŠãã ãããåèå®è£
ã¯ãã®ããã«ãªã£ãŠããŸãããã®æ
å ±ã¯éèšã ISUCON å
¬åŒBlog ã§ã®å
¬è¡šããåèæ
å ±ãšããŠå©çšãããŠããã ããŸãã
POST /api/initialize
ã®ã¬ã¹ãã³ã¹ã¯ä»¥äžã®ãã㪠JSON ãšãªããŸãã
{
"lang": "å®è£
èšèª"
}
lang
ã®å€ãå®è£
ã«å©çšããèšèªãšãªããŸãã lang
ã空ã®å Žåã¯åæååŠçã倱æãšèŠãªãããŸãã
以äžã®è¡çºãç¹ã«çŠæ¢ãšããŸãã
- 競æçµäºæéãŸã§ã«ã競æã®å
容ã«é¢ããããããäºé
ïŒåé¡å
容ã»èšæž¬ããŒã«ã®èšæž¬æ¹æ³ãªã©ïŒãå
¬éã»å
±æããããšïŒå
容ãæšå¯ã§ããçºèšãå«ãïŒ
- äžç¹å®å€æ°ãžã®å ¬éã¯ãã¡ãããä»ããŒã ã®éžæãšé£çµ¡ãåããåé¡å 容çãå ±æããäºïŒçµèšè¡çºïŒãçŠæ¢ãšããã
- ãã ãäž»å¬è ã Twitter, Web ãµã€ãã«ãããŠå ¬éããŠããæ å ±ã¯é€ããããŒã¿ã«ã§ãã°ã€ã³ãèŠããããŒãžïŒéžæãåå ãã Discord ãå«ãïŒã«ãããŠèšèŒãããŠããå 容ã¯å ¬éæ å ±ã§ãªãæšçæããããš
- 競ææéäžãããŒã å€ã®äººç©ãš ISUCON13 åé¡ã«ãŸã€ããäºé ã®ãããšãïŒISUCON13 éžæã§ãããã©ãããåããªããSNS ã§ã®çºèšãå«ãïŒ
- äž»å¬è
ã®æ瀺以å€ã§å©çšãèªãããããµãŒããŒä»¥å€ã®å€éšãªãœãŒã¹ã䜿çšããè¡çºïŒä»ã®ã€ã³ã¹ã¿ã³ã¹ã«åŠçãå§è²ãããªã©) ã¯çŠæ¢ããã
- ã¢ãã¿ãªã³ã°ããã¹ããéçºãªã©ã«ãããŠã¯ãPC ãå€éšã®ãµãŒããŒãå©çšããŠãæ§ããªãã
- AIã«ããã³ãŒãåæãçæã«å¿ èŠãªãµãŒãã¹ã¯å©çšããŠãæ§ããªã
- ãããã€ã®ããã«å€éšã®ã³ã³ããã¬ãžã¹ã㪠(Amazon ECRãªã©) ãå©çšããããšãå¯èœããã ãã競æçµäºãŸã§ä»ã®ããŒã ã«å¯ŸããŠå ¬éãããªãããã«æ³šæããããš
- éžæãäž»å¬è ãããã®éžæãå±ããããŒã ãžæäŸãããŠããªããµãŒããŒã«ã€ããŠçŽæ¥ã®ã¢ã¯ã»ã¹ãè©Šã¿ãè¡çºããå€éšãžã®äžæ£ã¢ã¯ã»ã¹ãè©Šã¿ãè¡çºãå ·äœçã«ã¯ãã³ãããŒã«ãŒãžã®ãã°ã€ã³è©Šè¡çãïŒãªããäŸç€ºã®ãããããã«éããªãïŒ
- ä»ããŒã ãšçµèšããè¡çºïŒçšåºŠãåããïŒ
- äž»å¬è ãä»ããŒã ãžã®åŠšå®³ã競æãžã®æ¯éãšãªããšã¿ãªãå šãŠã®è¡çº
- æ¬ããã¥ã¢ã«ãã¬ã®ã¥ã¬ãŒã·ã§ã³ãããŒã¿ã«ã«ãããŠçŠæ¢ãšãããè¡çºïŒçŠæ¢äºé ïŒãžã®éåã¯ãå€±æ ŒãšããŸãã