èšäºã®èªã¿ãããã«ã€ããŠ
ãã®èšäºã¯ãããã«ç»å ŽããŠãããèšäºã®æåŸã§èšåããèªè ããã®ãã£ãŒãããã¯ã®ãããã§ãå€ãã®å€æŽïŒæŠå¿µçãªå€æŽãå«ãïŒãšè¿œå ãè¡ãããŸããã äœããç解ããã®ãé£ãããšæããããã³ã¡ã³ãã§ããã説æããŠãã ããããããŠãç§ãã¡ã¯ãããããç解ããããèšèªã§èšäºã«æžããŸãã
ããã©ãŒãã³ã¹ã«ã€ããŠ
twitter ã VKontakte ã facebookãªã©ã®ææ°ã®è² è·ã®é«ããµã€ãã¯ãPHP + Apache + NoSQLãŸãã¯Ruby on Rails + Unicorn + NoSQLã®åœ¢åŒã®ãã³ãã«ã§åäœãããŸã£ããé ããªããŸããã ãŸããSQLã§ã¯ãªãNoSQLã䜿çšããŸãã 次ã«ãå€ãã®åäžã®å®çšŒåãµãŒããŒã«ãªã¯ãšã¹ããåæ£ïŒ ããã©ã³ã¹ã ïŒããŸãïŒããããæ°Žå¹³ã¹ã±ãŒãªã³ã°ããšåŒã³ãŸãïŒã 第äžã«ãå¯èœãªãã¹ãŠããã£ãã·ã¥ããŸããããŒãžå šäœãããŒãžã®æçã Ajaxãªã¯ãšã¹ãçšã®Json圢åŒã®ããŒã¿ãªã©ã§ãããã£ãã·ã¥ãããããŒã¿ã¯ãéçãã§ããã NginXãªã©ã®ãµãŒããŒããçŽã¡ã«éä¿¡ãããŸããã¢ããªã±ãŒã·ã§ã³ã
å人çã«ã¯ãApache + PHPããNode.jsã«æžãæããå Žåã«ãµã€ããé«éã«ãªããã©ããã¯ããããŸããã ããŒãã€ã³ã¿ãŒãããã§ã¯ããéåæã€ãã³ãã¢ãã«ããããã·ã¹ãã ãããŒãé ããšèãã人ãšãå察ã®èŠ³ç¹ãå®ã人ã®äž¡æ¹ã«äŒãããšãã§ããŸãã
次ã®ãããžã§ã¯ããäœã«æžãããèããŠããã®ã¿ã¹ã¯ããå ã«é²ã¿ããããžã§ã¯ãã®ã¿ã¹ã¯ã«ããéãªãã¢ãŒããã¯ãã£ãéžæããå¿ èŠããããŸãã
ããšãã°ãããã°ã©ã ãå€æ°ã®åææ¥ç¶ããµããŒãããåžžã«ããããžã®æžã蟌ã¿ãšèªã¿åããè¡ãå Žåããã®å Žåã¯å¿ ããéåæã€ãã³ãã¢ãã«ãïŒNode.jsãªã©ïŒãæ€èšããå¿ èŠããããŸãã Node.jsã¯ããµãã·ã¹ãã ãWebSocketãããã³ã«ã«åãæ¿ãããå Žåã«æé©ã§ãã
ãéåæã€ãã³ãã¢ãã«ããããŸãããã·ã¹ãã ã®äŸïŒ
- åè»ã®åããç£èŠããä¹å®¢ã®æµããåé ããæé©ãªçµè·¯ãèšç®ãããã¿ã¯ã·ãŒé è»ã·ã¹ãã ã®ã·ã¹ãã
- æ£åšããå€ãã®ã»ã³ãµãŒããããŒã¿ã絶ããåéããååŠçµæã枩床ã湿床ãªã©ãå¶åŸ¡ããçåœç¶æã·ã¹ãã
- 人äœïŒ è³ -å¶åŸ¡ããžãã¯ã ç¥çµç³» -ããŒã¿äŒéãã£ãã«ïŒ
- ãã£ããã«ãŒã
- MMORPG
ããããã³ã°ããã³ãã³ããããã³ã°å ¥å/åºåãšã¯äœã§ããïŒ
ã€ã³ã¿ãŒããããŠãŒã¶ãŒããµã€ãã«æ¥ç¶ããã¢ãã¿ãŒã®ç»åãã¢ããããŒããããããã¯ãŒã¯ãœã±ãã ïŒããœã±ããã-æåéããæ¥ç¶ãã€ã³ããïŒã®äŸã䜿çšããŠãå ¥å/åºåã®ã¿ã€ããåŠçããŸãã ãã®èšäºã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã³ãŒãã®ãã¹ãŠã®å ¥å/åºåããåæãããã³ããããã¯ãã§ãããéåæã€ãã³ãã¢ãã«ããšã䜿ãæ £ãããã¢ãŒããã¯ãã£ãæ¯èŒããŸãã ãç¿æ £ã-以åã¯ã誰ãããããçš®é¡ã®ãããã¯ãã«æ©ãŸãããŠããªãã£ãããã誰ãããã®ããã«æžãã誰ããååã§ããã ãåæãããã³ããããã¯ãI / Oãšã¯äœã§ããïŒ ããã¯ãã»ãšãã©ã®ãµã€ããèšè¿°ãããŠããæãåçŽã§æãäžè¬çãªå ¥å/åºåã§ãã
- ãã¡ã€ã«ãéã
- èªã¿å§ãã
- æ€èšããããŸã§åŸ ã€
- ãã¡ã€ã«ãèæ ®ãããŸãã
- ãã¡ã€ã«ãéãã
- ç»é¢ã«æ¢èªã³ã³ãã³ãã衚瀺ãã
ãœã±ããã®å Žåãããã¯æ¬¡ã®ããã«ãªããŸãã
- ãœã±ããã®ãªãã¹ã³ãéå§ããŸã
- ç»åããŒã¿ã®æåã®éšåãèªã¿åããŸã
- ç»åããŒã¿ã®2çªç®ã®éšåãå°çãããŸã§åŸ ã€
- ç»åããŒã¿ã®2çªç®ã®éšåãèªã¿åããŸã
- ç»åããŒã¿ã®æ¬¡ã®ããããåŸ ã€
- ...
- åçãèæ ®ãããŸãã
- ãŠãŒã¶ãŒã«ã¢ãã¿ãŒã«åçã貌ã
åæã«ãããã°ã©ã ã®ã³ãŒãå ã§ãããããã³ã°ããçºçããŸãããã®éãã¹ã¬ããã¯ã¢ã€ãã«ç¶æ ã«ãªããŸãããäœãæçšãªããšãã§ããŸãã ãã®åé¡ã解決ããããã«ããåæãããã³ãéããããã³ã°ãI / OãçºæãããŸããã
- ãœã±ããã®ãªãã¹ã³ãéå§ããŸã
- æ°ããããŒã¿ããªãå Žåããœã±ããã®ãªãã¹ã³ãåæ¢ããŸã
- ç»åããŒã¿ã®äžéšããã§ã«å°çããŠããå Žå-ãã®ããŒã¿ãèªã¿åããŸã
- ãœã±ããã®ãªã¹ãã³ã°ãåæ¢ããŸã
ç»åããŒã¿ã®æåŸã®éšåãèªã¿åããããŸã§ãããã®ã¹ãããããµã€ã¯ã«ã§å®è¡ãããå ŽåãæåŸã«åã³ãå šäœåãå®å šã«ååŸããŸãã å¯äžã®éãã¯ããã®ãµã€ã¯ã«ã§ã¯ããœã±ããããã®ããŒã¿ã®èªã¿åãã«å ããŠããããã¯ãã®äžã§ã¢ã€ãã«ç¶æ ã«ãªããªãããã«ãä»ã®äŸ¿å©ãªããšãå®è¡ã§ããããšã§ãã ããšãã°ãå¥ã®ãœã±ããããããŒã¿ãèªã¿åãããšãã§ããŸãã ãã®ãããªãéããããã³ã°ãI / Oãµã€ã¯ã«ã¯ãèšäºã®äžå€®è¿ãã«åã³çŸããŸãã
ãéåæãI / OããããŸãã ãã®èšäºã§ã¯èæ ®ããŸããããäžè¬çã«ã¯ãã³ãŒããããã³ãŒã«ããã¯ãé¢æ°ãåæããŸããããã¯ãç»åããŒã¿ã®å¥ã®éšåããã®ãœã±ããã«æ¥ããã³ã«ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãã£ãŠåŒã³åºãããŸãã ãããŠããã®ãœã±ãããäžè¬çã«èããŠãä»ã®ããšãããããšããã§ã«å¿ããŠããŸãã ãéåæãI / Oã¯ããåæããšåæ§ã«ãããããã¯ããšãéãããã¯ãã«åããããŸãã ãããããã®èšäºã§ã¯ããããããã³ã°ããšããã³ããããã³ã°ããšããèšèã®äžã§ãæ£ç¢ºã«ãåæãå ¥åºåãæå³ããŸãã
ãããããã®èšäºã§ã¯ãã¢ããªã±ãŒã·ã§ã³ãã·ã¹ãã ã¹ã¬ããã䜿çšããŠãªãã¬ãŒãã£ã³ã°ã·ã¹ãã äžã§çŽæ¥å®è¡ãããã銎æã¿ã®ãããã¢ãŒããã¯ãã£ã®ã¿ãæ€èšãããã°ãªãŒã³ã¹ã¬ããããåããäœããã®ãä»®æ³ãã·ã³ãã§ã¯æ€èšããŸããã ãã°ãªãŒã³ã¹ã¬ããããåãããä»®æ³ãã·ã³ãå ã§ã¯ããåæããšæãããI / Oããéåæãã«å€ãããªã©ãããŸããŸãªå¥è·¡ãå®è¡ã§ããŸããããã«ã€ããŠã¯ãã代æ¿æ¹æ³ãã»ã¯ã·ã§ã³ã§è©³ãã説æããŸãã
èæ¯
æ°ããã¢ããªã±ãŒã·ã§ã³ã¢ãŒããã¯ãã£ã§ã®å®éšã®éªåŽ©ã¯ãåŸæ¥ã®ã¢ãŒããã¯ãã£ãéçºã®å€æãã«ã€ã³ã¿ãŒãããã®ããŒãºã解決ãããšããäºå®ã«ãã£ãŠåŒãèµ·ããããŸããããã¡ããããã¹ãŠãè³ããã§ããã2ãŠã§ãããŠã§ãã®é²åããããŒãºãæºããããã«èšèšãããŠããŸããã§ããã
é·å¹Žã«ããã£ãŠãã¹ããããäžé£ã®PHP + MySQL + Apacheã¯ã Internet 1.0ã§ããŸãæ©èœããŸããã ãµãŒããŒã¯ããŠãŒã¶ãŒèŠæ±ããšã«æ°ããã¹ã¬ããïŒãŸãã¯ããã»ã¹ã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®èŠ³ç¹ããã¯ã»ãŒåã ïŒãéå§ããŸããã ãã®ã¹ããªãŒã ã¯ããããPHPã«è¡ããããŒã¿ããŒã¹ã«è¡ããããã§äœããéžæãã HTTPãä»ããŠãŠãŒã¶ãŒã«éä¿¡ããå¿çã§æ»ãããã®åŸãããèªäœãç Žå£ããŸããã
ããããããªã¢ã«ã¿ã€ã ãã¢ããªã±ãŒã·ã§ã³ã®å ŽåãèŠéããå§ããŸããã ããŠãŒã¶ãŒãšã®10,000ã®æ¥ç¶ãåæã«ãµããŒãããããšããã¿ã¹ã¯ããããšããŸãã ãã®ããã«10,000åã®ã¹ã¬ãããäœæã§ããŸãã 圌ãã¯ãäºãã«ã©ããã£ãŠä»²è¯ããªããŸããïŒ ãããã¯ãã·ã¹ãã ãã¹ã±ãžã¥ãŒã©ãã«ãã£ãŠäºãã«å ±åããŸãããã®ã¿ã¹ã¯ã¯ãåã¹ã¬ããã«ããã»ããµæéã®ã·ã§ã¢ãäžããåæã«èª°ã奪ããªãããšã§ãã 圌ã¯ãã®ããã«æ¯ãèããŸãã 1ã€ã®ã¹ã¬ãããå°ãåäœãããšãã¹ã±ãžã¥ãŒã©ãŒãéå§ãããã®ã¹ã¬ãããäžæçã«åæ¢ããããµã€ããæºåããŠã次ã®ã¹ã¬ããïŒãã¥ãŒã§æ¢ã«åŸ æ©ããŠããïŒãéå§ããŸãã
ãã®ããµã€ãã®æºåãã¯ãã³ã³ããã¹ãã¹ã€ããã³ã°ããšåŒã°ããäžæåæ¢ããã¹ããªãŒã ã®ãã³ã³ããã¹ããã®ä¿åãããã³æ¬¡ã«èµ·åãããã¹ããªãŒã ã®ã³ã³ããã¹ãã®åŸ©å ãå«ãŸããŸãã ãã³ã³ããã¹ããã«ã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã èªäœã®ããã»ããµã¬ãžã¹ã¿ããã³ããã»ã¹ããŒã¿ïŒid'shnikiãã¢ã¯ã»ã¹æš©ããªãœãŒã¹ãšããã¯ãå²ãåœãŠãããã¡ã¢ãªãªã©ïŒãå«ãŸããŸãã
ã¹ã±ãžã¥ãŒã©ã®èµ·åé »åºŠã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã決å®ããŸãã ããšãã°ãLinuxã§ã¯ãããã©ã«ãã§ãã¹ã±ãžã¥ãŒã©ãŒã¯100åã®1ç§ã®ã©ããã§éå§ããŸãã ã¹ã±ãžã¥ãŒã©ã¯ãããã»ã¹ãæåã§ïŒããšãã°ãã¹ãªãŒãæ©èœã«ãã£ãŠïŒããããã¯ãããããšãããŸãã¯ãåæãããã³ããããã¯ãïŒã€ãŸããæãåçŽã§æãäžè¬çãªïŒI / OãèŠè¶ããŠåŒã³åºãããŸãïŒããšãã°ãããŒã¿ããŒã¹ãPHPã¹ããªãŒã ã®ãŠãŒã¶ãŒèŠæ±ãåŸ æ©ããŠãããšãïŒããŒã¿ã¯åœŒã«æ¯æã®è²©å£²ã¬ããŒããæäŸããŸãïŒã
äžè¬çãªã±ãŒã¹ã§ã¯ ãã·ã¹ãã ã¹ã¬ããéã®ãã³ã³ããã¹ãã¹ã€ããã³ã°ãã¯ããã»ã©é«äŸ¡ã§ã¯ãªãããã€ã¯ãç§ã®ãªãŒããŒã§ãããšèããããŠããŸãã
ã¹ã¬ãããRAMã®ããŸããŸãªé åãã¢ã¯ãã£ãã«èªã¿åãïŒããã³RAMã®ããŸããŸãªé åã«æžã蟌ãïŒå Žåãã¹ã¬ããã®æ°ãå¢ãããšãããã»ããµã®ãã»ã«ã³ãã¬ãã«ãã£ãã·ã¥ãïŒL2ïŒã倱ãããŸããããã¯ã¡ã¬ãã€ãåäœã§ãã ãã®å Žåã ã·ã¹ãã ãã¹äžã®ããŒã¿ã®RAMããããã»ããµãžã®é ä¿¡ãããã³ã·ã¹ãã ãã¹äžã®ããŒã¿ã®ããã»ããµããRAMãžã®èšé²ãæ¯ååŸ æ©ããå¿ èŠããããŸãã ãã®ãããªRAMãžã®ã¢ã¯ã»ã¹ã¯ãããã»ããµãã£ãã·ã¥ãžã®ã¢ã¯ã»ã¹ãããæ¡éãã«é ããªããŸãããã®ãã£ãã·ã¥ã¯ãã®ããã«èæ¡ãããŸããã ãããã®å Žåããã³ã³ããã¹ãåãæ¿ããæéã¯æ倧50ãã€ã¯ãç§ã«ãªããŸãã
ã€ã³ã¿ãŒãããäžã§ã¯ãå€æ°ã®åæã¹ããªãŒã ã«ããã絶ãéãªããã³ã³ããã¹ãã¹ã€ããã³ã°ãã«ãããã·ã¹ãã å šäœã®é床ãå€§å¹ ã«äœäžããå ŽåããããŸãã ãã ãããã®ä»®èª¬ã®æ確ã§è©³çŽ°ãªæ°å€ç蚌æ ã¯èŠã€ãããŸããã§ããã
ãŸãããã«ãã¹ã¬ããã¢ãã«ãã¢ããªã±ãŒã·ã§ã³ã®ã¡ã¢ãªæ¶è²»ã«äžãã圱é¿ãæ€èšããŠã¿ãŸãããã ãã¹ã¿ãã¯ãã¯ãåã·ã¹ãã ã¹ã¬ããã«é¢é£ä»ããããŠããŸãã ã¹ã¬ãããåŒæ°ä»ãã®ç¹å®ã®é¢æ°ãåŒã³åºããšããã®é¢æ°ã®åŒæ°ã¯ãã¹ã¿ãã¯ãã«çœ®ãããã³ãŒãå ã®çŸåšã®ã¢ãã¬ã¹ã¯ãæ»ãã¢ãã¬ã¹ããšåŒã°ããŸãïŒåŒã³åºãããé¢æ°ã®å®è¡ãçµäºãããšããã«æ»ãããïŒã ãã®é¢æ°ãããèªäœã®å éšã§å¥ã®é¢æ°ãåŒã³åºããšã察å¿ããããŒã¿ãåã³ãã¹ã¿ãã¯ãã«æžã蟌ãŸãããã§ã«ããã«æžã蟌ãŸããŠããããŒã¿ã«å ããŠããã€ãã®ããã«èŠããŸãã
ã·ã¹ãã ã¹ã¬ãããäœæãããšãããã¹ã¿ãã¯ãã¯ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ãã£ãŠRAMå ã§å šäœãšããŠããã«å²ãåœãŠãããã®ã§ã¯ãªãã䜿çšæã«ãããŒã¹ãã«ãã£ãŠå²ãåœãŠãããŸãã ããã¯ãä»®æ³ã¡ã¢ãªããšåŒã°ããŸã ã ã€ãŸããåã¹ã¬ããã¯ããã«ãã¹ã¿ãã¯ãã®äžã®ãä»®æ³ã¡ã¢ãªãã®å€§ããªéšåã«å²ãåœãŠãããŸãããå®éã«ã¯ããã®ãä»®æ³ã¡ã¢ãªãã¯ãã¹ãŠãã¡ã¢ãªããŒãžããšåŒã°ãããéšåãã«åå²ããããã§ã«ãããã®ãã¡ã¢ãªããŒãžãã¯ãå®éã®ã »RAMã¯ãå¿ èŠãªå Žåã«ã®ã¿äœ¿çšããŸãã ã¹ã¬ããããå®éã®ãRAMã«ãŸã å²ãåœãŠãããŠããªããã¡ã¢ãªããŒãžãã«è§ŠãããšïŒããšãã°ãããã»ããµã«äœããæžã蟌ãããã«ããã»ããµã«æ瀺ããããšãããšïŒãããã»ããµã®ãã¡ã¢ãªç®¡çãããã¯ãããã®ã¢ã¯ã·ã§ã³ãæ€åºãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã§ã äŸå€ ããåŒãèµ·ãããŸãã ããŒãžãã©ãŒã«ã ãããå®éã®ãRAMã«ãã®ãã¡ã¢ãªããŒãžããå²ãåœãŠãããšã§å¿çããŸãã
Linuxã§ã¯ãããã©ã«ãã®ã¹ã¿ãã¯ãµã€ãºã¯8ã¡ã¬ãã€ãã§ããã¡ã¢ãªããŒãžãã®ãµã€ãºã¯4ãããã€ãã§ã ïŒ1ã€ãŸãã¯2ã€ã®ãã¡ã¢ãªããŒãžããããã«ãã¹ã¿ãã¯ãã«å²ãåœãŠãããŸãïŒã åæã«èµ·åããã10,000ã®ã¹ã¬ããã«é¢ããŠãçŽ80ã¡ã¬ãã€ãã®ãå®éã®ãRAMã®èŠä»¶ããããŸãã ããã¯å°ãã®ããã«æãããå¿é ããçç±ã¯ãªãããã§ãã ãã ãããã®å Žåã«å¿ èŠãªã¡ã¢ãªã®ãµã€ãºã¯OïŒnïŒã«ãªããŸããããã¯ãè² è·ãããã«å¢å ãããšã ãã¹ã±ãŒã©ããªãã£ãã«åé¡ãããããšã瀺åããŠããŸããææ¥ããµã€ãããã§ã«100,000ã®åæãŠãŒã¶ãŒã«å¯Ÿå¿ãã100ãç¶æããå¿ èŠãããå Žå000åææ¥ç¶ïŒ ãããŠæåŸæ¥-1,000,000ïŒ ãããŠæåŸæ¥ã®åŸ-ããã¯ãŸã äžæã§ã...
ã·ã³ã°ã«ã¹ã¬ããã®ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã«ã¯ãã®æ¬ ç¹ã¯ãªããåææ¥ç¶æ°ã®å¢å ã«äŒŽãæ°ããã¡ã¢ãªã¯å¿ èŠãããŸããïŒããã¯OïŒ1ïŒãšåŒã°ããŸãïŒã Apache Web ServerãšNginXã®ã¡ã¢ãªäœ¿çšéãæ¯èŒãããã®ã°ã©ããèŠãŠãã ãã ïŒ
ææ°ã®WebãµãŒããŒïŒææ°ã®Apacheãå«ãïŒã¯ãå®å šã«ãèŠæ±æã®ãããŒãã®ã¢ãŒããã¯ãã£ã§ã¯ãªããããæé©åãããã¢ãŒããã¯ãã£äžã«æ§ç¯ãããŠããŸããå°çãããã¹ãŠã®èŠæ±ãåŠçããäºåæºåã¹ã¬ããã® ãããŒã«ãããããŸãã ããã¯ã10é ã®éŠ¬ãš100人ã®ã©ã€ããŒãä¹ãã¢ãã©ã¯ã·ã§ã³ãšæ¯èŒã§ããŸããåã圢æãããæåã®10人ã®ã©ã€ããŒãããã¡ãã¡ãã«ä¹ããŸã§ã次ã®10人ã®ã©ã€ããŒã䞊ãã§åŸ æ©ããŸãã ãã®å Žåãã¢ãã©ã¯ã·ã§ã³ã¯ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã§ããã銬ã¯ããŒã«ããã®ã¹ã¬ããã§ãããã©ã€ããŒã¯ãµã€ãã®ãŠãŒã¶ãŒã§ãã
ãã®ãããªã·ã¹ãã ãããŒã®ãããŒã«ãã䜿çšããå Žåãåæã«ããŠãŒã¶ãŒæ°ããããŒã«å ã«ããã¹ã¬ããã®æ°ããã€ãŸã10,000ã ãã§ã¯ãªãããµãŒãã¹ãæäŸã§ããŸãã
ãã®ã»ã¯ã·ã§ã³ã§èª¬æããå°é£ã¯ãéåžžã«å€æ°ã®åææ¥ç¶ãåŠçããããã®ãã«ãã¹ã¬ããã¢ãŒããã¯ãã£ã®é©åæ§ã®åé¡ãåžžã«å¿µé ã«çœ®ããŠããããŸãšããŠThe C10K problemãšåŒã°ããŠããŸããã
éåæã€ãã³ãã¢ãã«
ãã®ã¯ã©ã¹ã®ã¢ããªã±ãŒã·ã§ã³ã«ã¯ãæ°ããã¢ãŒããã¯ãã£ãå¿ èŠã§ããã ãããŠããã®ç¶æ³ã§ã¯ã念ã®ããããéåæã€ãã³ãã¢ãã«ããç»å ŽããŸããã ããã¯ã ãã€ãã³ããµã€ã¯ã«ããšãã³ãã¬ãŒãããªã¢ã¯ã¿ãŒãã«åºã¥ããŠããŸã ïŒãåå¿ããããšããèšèãã-å¿çããïŒã
ãã€ãã³ãã«ãŒãããšã¯ããã€ãã³ãã®ãœãŒã¹ãïŒèšè¿°åïŒãããŒãªã³ã°ããŠããã®äžã«ããçš®ã®ãã€ãã³ãããåºçŸãããã©ããã調ã¹ãç¡éã«ãŒãã§ãã ããŒãªã³ã°ã¯ã ãåæã I / Oã©ã€ãã©ãªã䜿çšããŠè¡ãããŸãããããã¯åæã«ãéããããã³ã°ãã«ãªããŸã ïŒO_NONBLOCKãã©ã°ãã·ã¹ãã I / Oé¢æ°ã«æž¡ãããŸãïŒã
ã€ãŸãããã€ãã³ããµã€ã¯ã«ãã®æ¬¡ã®ã©ãŠã³ãã§ãã·ã¹ãã ã¯ãã¹ãŠã®èšè¿°åãé çªã«ééããããããããã€ãã³ããã®èªã¿åããè©Šã¿ãŸããèªã¿åãæ©èœã«ãã£ãŠã·ã¹ãã ã«è¿ãããŸãã èšè¿°åã«æ°ããã€ãã³ãããªãå Žåãããããã¯ãããŠãã€ãã³ããã衚瀺ãããã®ãåŸ æ©ããŸããããããã«ãæ°ããã€ãã³ãã¯ãããŸããããšããåçãè¿ããŸãã
ãã€ãã³ãããšã¯ã ãããã¯ãŒã¯ãœã±ããäžã®æ¬¡ã®ããŒã¿éšåã®å°çïŒããœã±ããã-æåéããæ¥ç¶ã®å ŽæãïŒããŸãã¯ããŒããã£ã¹ã¯ããã®ããŒã¿ã®æ°ããéšåã®èªã¿åãïŒäžè¬ã«ãä»»æã®å ¥åºåïŒã®ããšã§ãã ããšãã°ããã¹ãã£ã³ã°ã«åçãã¢ããããŒããããšãããŒã¿ãæççã«ãªãããã®ãã³ã«ãç»åããŒã¿ã®æ°ããéšåãåä¿¡ãããŸããããšããã€ãã³ããããªã¬ãŒãããŸãã
ãã®å Žåããã€ãã³ãã®ãœãŒã¹ãã¯ããããã¯ãŒã¯çµç±ã§ãµã€ãã«æ¥ç¶ããTCPãœã±ããã®ãèšè¿°åã ïŒããŒã¿ã¹ããªãŒã ãžã®ãã€ã³ã¿ãŒïŒã«ãªããŸãã
æ¢ã«è¿°ã¹ãããã«ãæ°ããã¢ãŒããã¯ãã£ã®2çªç®ã®ã³ã³ããŒãã³ãã¯ããªã¢ã¯ã¿ãŒãã³ãã¬ãŒãã§ãã ãããŠããã·ã¢äººã«ãšã£ãŠãããã¯åååçºé»æã®ååçã§ã¯ãããŸããã ãã®ãã³ãã¬ãŒãã®æ¬è³ªã¯ããµãŒããŒã³ãŒãã1ã€ã®å€§ããªéšåã§æžã蟌ãŸããé£ç¶ããŠå®è¡ãããã®ã§ã¯ãªããå°ããªãããã¯ã«æžã蟌ãŸããåãããã¯ãé¢é£ä»ããããã€ãã³ãã®çºçæã«åŒã³åºãããïŒãåå¿ãããïŒããšã§ãã ãããã£ãŠãã³ãŒãã¯å€ãã®ãããã¯ã®ã»ããã§ããããã®ã¿ã¹ã¯ã¯ããã€ãã®ã€ãã³ãã«ãå¿çãããããšã§ãã
ãã®æ°ããã¢ãŒããã¯ãã£ã¯ãNode.jsã®ç»å ŽåŸã«äž»æµã«ãªããŸããã Node.jsã¯C ++ã§èšè¿°ãããŠããããã®ã€ãã³ãã«ãŒãã¯libev CïŒã©ã€ãã©ãªã«åºã¥ããŠããŸãã ãã ããããã§Javascriptã¯éžæãããèšèªã§ã¯ãããŸãããã©ã€ãã©ãªã®èšèªã«ãéããããã³ã°ãI / Oãããå Žåãåæ§ã®ããã¬ãŒã ã¯ãŒã¯ããèšè¿°ããããšãã§ããŸããPythonã«ã¯Twisted ã Tornado ãPearlã«ã¯Perl Object Environment ãRubyã«ã¯EventMachine ïŒãã§ã«5æ³ã§ãïŒã ãããã®ããã¬ãŒã ã¯ãŒã¯ãã§ã¯ãNode.jsã«äŒŒãç¬èªã®ãµãŒããŒãäœæã§ããŸãã ããšãã°ãJavaïŒjava.nioããŒã¹ïŒã§ã¯NettyãšMINAããRubyïŒEventMachineããŒã¹ïŒ-GoliathïŒ Fibersãå©çšïŒãèšè¿°ãããŠããŸãã
é·æãšçæ
ãéåæã€ãã³ãã¢ãã«ãã¯ãå€ãã®å€ãã®ãŠãŒã¶ãŒãããã»ããµãããŒãããªãã¢ã¯ã·ã§ã³ãåæã«å®è¡ããå Žåã«é©ããŠããŸãã ããšãã°ãã çŸåšæå» ãã¢ãŒãã®ã»ã³ãµãŒãã枩床ãååŸãããããªã«ã¡ã©ããç»åãååŸããæ¥ç¶ããã枩床èšããååŸãã枩床ããµãŒããŒã«è»¢éãããã£ããã«æ°ããã¡ãã»ãŒãžãæžã蟌ã¿ããã£ããããæ°ããã¡ãã»ãŒãžãåä¿¡ããŸãã
ããã»ããµãããŒãããªãã¢ã¯ã·ã§ã³ã®èŠä»¶ã¯ããã®ç¡éã«ãŒãå šäœã1ã€ã®ã¹ã¬ããã§å®è¡ãããããšãæãåºããšããã®ã«ãŒãã«éãèšç®ãæŒã蟌ãã å ŽåïŒããšãã°ã埮åæ¹çšåŒã®è§£æ³ãéå§ããå ŽåïŒãä»ã®ãã¹ãŠã®ãŠãŒã¶ãŒã¯ããã®èšç®ãå®äºãããŸã§é çªã«åŸ æ©ããŸãã
ãããã£ãŠãNode.jsã®ãããªãµãŒããŒã¯ãããã»ããµãããŒãããªãã¿ã¹ã¯ã«é©ããŠããããéãããã¯ãšã³ãã®ããã³ããšã³ããšããŠã®ã¿é©ããŠããŸãã ãŸãããé ãããªã¯ãšã¹ãïŒçãéä¿¡ãã£ãã«ãé ããªã¿ãŒã³/ããŒã¿ã®éä¿¡ãå éšã®ã©ããã§ã®é·ãå¿çæéãªã©ïŒãåŠçããããã®ãµãŒããŒãšããŠãé©ããŠããŸãã Node.jsã®ãããªãµãŒããŒã«ãå ¥åºåã仲ä»ã®å ŽæãäžããŸãã ããšãã°ããã¯ã©ã€ã¢ã³ãããšããµãŒããŒãã®éã®ä»²ä»ïŒèŠèŠçè¡šçŸå šäœãäœæãããã€ã³ã¿ãŒããããŠãŒã¶ãŒã®ãã©ãŠã¶ãŒã§çŽæ¥ã¬ã³ããªã³ã°ãããå¿ èŠãªãã¹ãŠã®ããŒã¿ããªããžããªã®ãµãŒããŒã«ä¿åãããNode.jsã仲ä»ã®ã¿ã¹ã¯ãå®è¡ããèŠæ±ã«å¿ããŠãã¯ã©ã€ã¢ã³ããã«å¿ èŠãªããŒã¿ãæäŸããŸãããã¯ã©ã€ã¢ã³ããããæ¥ããšãã«æ°ããããŒã¿ããªããžããªã«æžã蟌ãã
ãéåæã€ãã³ãã¢ãã«ãã«ãããµãŒããŒãåãã·ã¹ãã ã¹ã¬ããã§å®è¡ãããŠãããšããäºå®ã«ãããå®éã«ã¯ããã«2ã€ã®é害ãçºçããŸãã 1ã€ã¯ã¡ã¢ãªãªãŒã¯ã§ãã Apacheãæ°ãããªã¯ãšã¹ãããšã«ã·ã¹ãã ã¹ã¬ãããäœæããå ŽåããŠãŒã¶ãŒã«å¿çãéä¿¡ããåŸããã®ã·ã¹ãã ã¹ã¬ããã¯èªå·±ç Žå£ããããã«å²ãåœãŠããããã¹ãŠã®ã¡ã¢ãªã¯åã«è§£æŸãããŸãã ããšãã°ãNode.jsã®å Žåãéçºè ã¯æ¬¡ã®ãŠãŒã¶ãŒãªã¯ãšã¹ããåŠçãããšãã«ãã¬ãŒã¹ãæ®ããªãããã«æ³šæããå¿ èŠããããŸãïŒãã®ãããªãªã¯ãšã¹ããå°çãããã¹ãŠã®èšŒæ ãRAMããåé€ããïŒãããããªããšãããã»ã¹ã¯ãŸããŸã貪é£ããŸãæ°ãããªã¯ãšã¹ãããšã®ã¡ã¢ãªã 2çªç®ã¯ãããã°ã©ã ã®ãšã©ãŒåŠçã§ãã ç¹°ãè¿ããŸãããéåžžã®Apacheãå¥ã®ã·ã¹ãã ã¹ã¬ãããäœæããŠçä¿¡ãªã¯ãšã¹ããåŠçããPHPåŠçã³ãŒããäœããã®ãäŸå€ããã¹ããŒãããšããã®ã·ã¹ãã ã¹ã¬ããã¯éãã«ãæ»ã«ãããŠãŒã¶ãŒã¯ã500ãã®ãããªããŒãžãåãåããŸãã å éšãµãŒããŒãšã©ãŒãã åãNode.jsã®å Žåãåäžã®ãªã¯ãšã¹ãã®åŠçäžã«çºçããå¯äžã®ãšã©ãŒã¯ãµãŒããŒå šäœããããããããŸãããã®ããã æåã§ç£èŠããã³åèµ·åããå¿ èŠããããŸãã
ãéåæã€ãã³ãã¢ãã«ãã®ãã1ã€ã®æœåšçãªæ¬ ç¹ã¯ã ãã³ãŒã«ããã¯ããç¹ã亀ããããŠããããã«ãã¢ããªã±ãŒã·ã§ã³ã³ãŒããç解ãã«ãããªãå Žåãããããšã§ãïŒåžžã«ã§ã¯ãããŸããããç¹ã«ãæå³ããªãç®çã§ãéåæã€ãã³ãã¢ãã«ãã䜿çšããå Žåã«èµ·ãããŸãïŒ ã ããã¯ãã¹ãã²ããã£ã³ãŒããåé¡ãšåŒã°ãã ãã³ãŒã«ããã¯æã®ã³ãŒã«ããã¯ãã³ãŒã«ããã¯ãã§ã€ã¹ããšèª¬æãããŠããŸãã 圌ãã¯ãããšæŠãããšããŠãããäŸãã°ã Seqã©ã€ãã©ãªã¯Node.jsçšã«æžãããŠããŸãã
äžè¬ã«ãã³ãŒã«ããã¯ããæé€ããå¥ã®æ¹æ³ã¯ãããããç¶ç¶ ïŒ ã³ã«ãŒãã³ ïŒã§ãã ããšãã°ã Scalaã§ã¯ããŒãžã§ã³2.8ïŒ ã³ã«ãŒãã³ ïŒãããRubyã§ã¯ããŒãžã§ã³1.9ïŒ ãã¡ã€ã㌠ïŒããå°å ¥ãããŠããŸãã Rubyã§Fibersã䜿çšããŠãã³ãŒã«ããã¯ãå®å šã«æé€ãããã¹ãŠãåæçã«çºçããŠããããã«ã³ãŒããèšè¿°ããæ¹æ³ã®äŸã次ã«ç€ºããŸãã
åæ§ã®ããŒããã¡ã€ããŒã©ã€ãã©ãªãNode.jsçšã«äœæãããŸããã ããã©ãŒãã³ã¹ã®èŠ³ç¹ããïŒå®éã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãªãã人工çãªãã¹ãã§ïŒãããŒããã¡ã€ããŒã¯ã ãã³ãŒã«ããã¯ãã䜿çšããéåžžã®ã¹ã¿ã€ã«ãããçŽ3ã4åé ãåäœããŸãã ã©ã€ãã©ãªã®äœæè ã¯ãJavascript ãV8ãšã³ãžã³ã® C ++ã³ãŒãïŒNode.jsèªäœã«åºã¥ããŠããïŒã«é©åããå Žåã«ãã®ããã©ãŒãã³ã¹ã®éããçãããšäž»åŒµããããã©ãŒãã³ã¹æž¬å®ã¯ãããŒããã¡ã€ããŒã3ã4åé ãããšè§£éãããã¹ãã§ã¯ãªãã³ãŒã«ãã㯠''ã§ãããã³ãŒãå ã®ä»ã®äœã¬ãã«ã¢ã¯ã·ã§ã³ïŒãã€ãé åã®æäœãããŒã¿ããŒã¹ãŸãã¯ã€ã³ã¿ãŒãããäžã®ãµãŒãã¹ãžã®æ¥ç¶ïŒãšæ¯èŒãããšãããŒããã¡ã€ããŒã®ããã©ãŒãã³ã¹ãããããªã³ãã¯ãŸã£ããç®ç«ã¡ãŸããã
éåžžã®ããã°ã©ãã³ã°ã¹ã¿ã€ã«ã«å ããŠãããŒããã¡ã€ããŒã¯try / catchãšã©ãŒãåŠçããããã®äœ¿ãæ £ãã䟿å©ãªæ¹æ³ãæäŸããŸãã ãã ãããã®ã©ã€ãã©ãªã¯Node.jsã®ã³ã¢ã«ã¯åã蟌ãŸããŸãããRyanDahlã¯ãäœæã®ç®çãäœã¬ãã«ã«ä¿ã¡ãéçºè ã«äœãé ããªãããã«èããŠããããã§ãã
ãã®èšäºã®äž»èŠéšåã¯çµãããŸãããæåŸã«ãå¥ã®æ¹æ³ãšããã€ãã³ããµã€ã¯ã«ãããã€ãã³ãã®ãœãŒã¹ããããŒãªã³ã°ããŠãæ°ããããŒã¿ã衚瀺ãããæ¹æ³ãç°¡åã«æ€èšããŸãã
å¥ã®æ¹æ³
ãã®èšäºã§ã¯ããåæãããã³ããããã¯ãI / Oã䜿çšããã¢ããªã±ãŒã·ã§ã³ãå€æ°ã®åææ¥ç¶ã«èããããªãçç±ã説æããŸããã ãœãªã¥ãŒã·ã§ã³ã®1ã€ãšããŠããã®ã¢ããªã±ãŒã·ã§ã³ããéåæã€ãã³ãã¢ãã«ãã«å€æããããšãææ¡ããŸããïŒã€ãŸããNode.jsã§ã¢ããªã±ãŒã·ã§ã³ãæžãæããŸãïŒã ãã®ããã«ããŠãå®éã«ïŒããã¯ã¹ããŒãžã§ïŒãåæãããã³ããããã¯ãI / Oãããåæãããã³ãéãããã¯ãI / Oã«åãæ¿ããããšã§åé¡ã解決ããŸãã ãããããããå¯äžã®è§£æ±ºçã§ã¯ãããŸããããéåæãI / Oã«é Œãããšãã§ããŸãã
ã€ãŸããã·ã¹ãã ãããŒã®å€ãè¯ããããŒã«ãïŒãã®èšäºã®ååã§èª¬æïŒã䜿çšã§ããŸããããã¯ãéçºã®æ°ãã段éã«é²åããŸããã ãã®éçºæ®µéã¯ãã°ãªãŒã³ããã»ã¹ããšåŒã°ããŸã ïŒãããã£ãŠããã°ãªãŒã³ã¹ããªãŒã ãããããŸãïŒã ãããã¯ããã»ã¹ã§ãããã·ã¹ãã ã®ããã»ã¹ã§ã¯ãããŸããããã³ãŒããèšè¿°ãããŠããèšèªã®ä»®æ³ãã·ã³ã«ãã£ãŠäœæãããŸãã ä»®æ³ãã·ã³ã¯ãã·ã¹ãã ã¹ã¬ããã®éåžžã®ãããŒã«ããå éšã§èµ·åãïŒããšãã°ãããã»ããµã®ã³ã¢æ°ã«ãã£ãŠïŒããããã®ã·ã¹ãã ã¹ã¬ããã«å éšã®ãã°ãªãŒã³ããã»ã¹ããæ¢ã«è¡šç€ºããŸãïŒãããéçºè ããå®å šã«é ããŸãïŒã
ãã°ãªãŒã³ããã»ã¹ãã¯æ£ç¢ºã«ã¯ãããã»ã¹ãã§ãããããããŒãã§ã¯ãããŸããããããã¯äºãã«å ±éã®å€æ°ãæãããå¶åŸ¡ãã¡ãã»ãŒãžããçžäºã«éä¿¡ããããšã«ãã£ãŠã®ã¿éä¿¡ããããã§ãã ãã®ã¢ãã«ã¯ãããŸããŸãªããããããã¯ãã«å¯Ÿããä¿è·ãæäŸãã ããŒã¿å ±æã®åé¡ãåé¿ããŸããããã¯ããã°ãªãŒã³ããã»ã¹ããæã€ã®ã¯å éšç¶æ ãšãã¡ãã»ãŒãžãã ãã ããã§ãã
åããªããžã§ã¯ããã«ã¯ãã¡ãã»ãŒãžãã®é çªããããŸãïŒãã®ããã«ãã°ãªãŒã³ããã»ã¹ããäœæãããŸãïŒã ãããŠãããªããžã§ã¯ããã®ã³ãŒããžã®åŒã³åºãã¯ããã¡ãã»ãŒãžãã圌ã«éä¿¡ããããšã§ãã ããããªããžã§ã¯ããããå¥ã®ããªããžã§ã¯ãããžã®ãã¡ãã»ãŒãžãã®éä¿¡ã¯éåæçã«è¡ãããŸãã
ããã«å ããŠãä»®æ³ãã·ã³ã¯ç¬èªã®I / Oãµãã·ã¹ãã ãäœæããŸããããã¯ãéããããã³ã°ã·ã¹ãã I / Oã«ãããããŸãïŒéçºè ã¯äœãçã£ãŠããŸããïŒã
ãããŠããã¡ãããä»®æ³ãã·ã³ã«ã¯ç¬èªã®å éšã¹ã±ãžã¥ãŒã©ãå«ãŸããŠããŸãã
ãã®çµæãéçºè ã¯ãéåžžã®å ¥å/åºåã䜿çšããŠéåžžã®ã³ãŒããèšè¿°ãããšèããŠããŸãããå®éã«ã¯éåžžã«é«æ§èœãªã·ã¹ãã ãç»å ŽããŸãã äŸïŒ Erlang ã Scalaã® ã¢ã¯ã¿ãŒ ã
ãã€ãã³ããµã€ã¯ã«ãã§ãã€ãã³ãã®ãœãŒã¹ããããŒãªã³ã°ããŠãæ°ããããŒã¿ã衚瀺ããæ¹æ³
æãç°¡åãªè§£æ±ºçã¯ããã¹ãŠã®ãèšè¿°åãïŒãããã¯ãŒã¯ãœã±ãããéãããã¡ã€ã«ã®èªã¿åããŸãã¯æžã蟌ã¿ãªã©ïŒã§ã¯ãšãªãå®è¡ããŠãæ°ããããŒã¿ãååŸããããšã§ãã ãã®ãããªã¢ã«ãŽãªãºã ã¯ãããŒãªã³ã°ããšåŒã°ããŸãã 次ã®ããã«ãªããŸãã
- ããªãã¯2ã€ã®éãããœã±ãããæã£ãŠããŸã
- ãããã®ãœã±ãããèšè¿°ãã2ã€ã®æ§é ã®é åãäœæããŸã
- ãã®é åã®åèŠçŽ ã«äœãšã©ã®ãœã±ãããæžã蟌ãããèšè¿°ããŸã
- 次ã«ããã®é åãããŒãªã³ã°ã·ã¹ãã é¢æ°ã«æž¡ããŸããããŒãªã³ã°ã·ã¹ãã é¢æ°ã¯ããããã®ãœã±ããã®çŸåšã®ç¶æ ã®èª¬æãããã«æžã蟌ã¿ãŸã
- ãã®åŸãåã³ãã®é åã調ã¹ãŠããããã®ãœã±ããã«æ°ããããŒã¿ããããã©ãããå€æããŸã
- ããããã°ãããããèªãã§ã圌ããšäœããããŠãã ãã
- ããã¯ãã¹ãŠãç¡éã®ãã€ãã³ããµã€ã¯ã«ãã®æ°ããã©ãŠã³ãã§ç¹°ãè¿ãããŸãã
RAMããããã»ããµã¬ãžã¹ã¿ãžã®ããŒã¿ã®é ä¿¡ãããã³ããã»ããµã¬ãžã¹ã¿ããRAMãžã®ããŒã¿ã®éä¿¡ã¯é«éãªæäœã§ã¯ãªããããã¢ã¬ã€ã®ååŸãžã®ã³ããŒãªã©ã¯ã·ã¹ãã ããã©ãŒãã³ã¹ã«åœ±é¿ããŸãïŒã·ã¹ãã ãã¹äžã®ããŒã¿ãRAMã«ç§»åããããããæ¥ãŸãïŒã
ããã«ã倧åïŒçŽ95ïŒ ïŒå¯Ÿå¿ãããœã±ããã«ã¯æ°ããããŒã¿ããªããããçµæã®é åïŒçŽ10,000åã®ãªãŒãã³ãœã±ããã®å ŽåïŒã¯åœ¹ã«ç«ã¡ãŸããã
ãŸãããã®é åã®ãµã€ãºã¯èšè¿°åã®æ°ã«æ¯äŸããŠå€§ãããªãããããœã±ãããéããŠããã»ã©ãã®ã¢ã«ãŽãªãºã ãæ©èœããããšãããããŸããã€ãŸãããµã€ããžã®åæ蚪åè ãå€ãã»ã©ããã€ãã³ããµã€ã¯ã«ãã®é床ãäœäžãå§ããŸãããã®å Žåã圌ãã¯èšãïŒãã¢ã«ãŽãªãºã ã«è€éæ§OïŒnïŒããããŸããã
ããæé©ãªã¢ã«ãŽãªãºã ãæžãããšã¯å¯èœã§ããïŒããã¯å¯èœã§ããããããã¯ãäž»èŠãªãµãŒããŒãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã§æžãããŠããŸãïŒãã¡ã€ã«ãã£ã¹ã¯ãªãã¿ LINUXãšããkqueueã® FreeBSDäžã§ã¯ã Windowsã«ã¯IO Completion PortsããããŸããããã¯ãepollã®è¿çžã®äžçš®ã§ããNode.jséçºè ãWindowsã«ç§»æ€ããéã«äœ¿çšããlibevã©ã€ãã©ãªãšIOå®äºããŒãã®äž¡æ¹ã«åäžã®ã€ã³ã¿ãŒãã§ãŒã¹ãæäŸããlibuvã©ã€ãã©ãªãäœæããŸãããepollã
æ€èšããŠãã ãããäž¡åŽã®åçŽãªæ祚ãšã¯ç°ãªããŸãã
- ããã°ã©ã ã¯ããã¹ãŠã®èšè¿°åïŒããã³ãã¹ãŠã®ã¿ã€ãã®ã€ãã³ãïŒããŸã£ãããã§ãã¯ããŸããããå¿ èŠãªèšè¿°åïŒããã³ã€ãã³ãã®ã¿ã€ãïŒã®ã¿ããµãã¹ã¯ã©ã€ãããŸãã
- ã«ãŒãã«ã¯ã/ dev / epollãã¡ã€ã«ãäœæããããšã«ãããèšè¿°åããŒã¿ãå«ãã¡ã¢ãªé åãããã°ã©ã ããèŠããããã«ããŸãïŒå®éã«ã¯ããã¯ãããã€ã¹ãã§ãããLinuxã®å²åŠã®èŠ³ç¹ããã¯ããã¹ãŠããã¡ã€ã«ãã§ãïŒãããã°ã©ã ã¯ãmmapé¢æ°ã䜿çšããŠããŸã£ããã³ããŒããã«ãã®ãã¡ã€ã«ãèªã¿åãïŒããã³æžã蟌ãïŒããšãã§ããŸããæ°ããã¡ãã»ãŒãžã®ååšã¯ãioctlã·ã¹ãã é¢æ°ã«ãã£ãŠãã§ãã¯ãããŸãã
èšè¿°åã®éåžžã®åæã«OïŒnïŒæéããã£ãå Žåããããã®æé©åãããã¢ã«ãŽãªãºã ã¯OïŒ1ïŒæéãå¿ èŠãšããŸããã€ãŸãããµã€ããžã®åæ蚪åè ã®æ°ãå¢ããŠãé ããªããŸããã
èšäºã®ç·šéã«åå ãããŠãŒã¶ãŒ
ãã®èšäºã«ã¯ããŠãŒã¶ãŒãææ¡ããã»ãã³ãã£ãã¯ç·šéãå«ãŸããŠããŸãïŒakzhanãerlyvideoãeyeofhellãMagaSoftãMoxãnuitãolegichãreddotãsplav_asvãtanennãThrowableã
ãŠãŒã¶ãŒãæ°ä»ãæ§æããã³ã¹ã¿ã€ã«ã®å€æŽïŒGoderã@ theelephantã
é¢é£ãªã³ã¯
Dahlæ°ã¯åè«ãèšããªããã°ãªããªãããŸãã¯Node.jsãWebãµãŒããŒã®é²åã®å ã§ããçç±
EventMachine
ã¹ã±ãŒã©ãã«ãªãããã¯ãŒã¯ããã°ã©ãã³ã°ã®
æŠèŠKqueue
ã¹ã¿ãã¯ã¬ã¹pythonãšåæå®è¡
/ ( , )
node-sync â - nodejs fibers
What every programmer should know about memory
10 things every Linux programmer should know
Video: Node.js by Ryan Dahl
No Callbacks, No Threads & Ruby 1.9