2023å¹´03æ31æ¥è¿½è¨ï¼ãã®è¨äºãåºã«ã@sadnessOjisanãããããã³ã¼ãã¬ãã«ã«ããè¸ã¿è¾¼ãã ããã¤ãã°ãªã¼ã³ã¹ã¬ãããã¼ã¹ã®æ°ããWebãµã¼ãã¢ã¼ããã¯ãã£ãå«ãã¦æ´çãããè¨äº Webサーバーアーキテクチャ進化論2023 | blog.ojisan.io ãå ¬éããã¾ããã
主ã«æ°åã®Webã¨ã³ã¸ãã¢åãã«ãå¤å ¸çãªWebãµã¼ãã¢ã¼ããã¯ãã£ãå¦ã¶éã®ãã¨ä»£è¡¨çãªå®è£ ã¢ãã«ã®æ¦è¦ãç´¹ä»ãã¾ãã
ãã®è¾ºãã®è©±é¡ãWebçéã§æµè¡ã£ã¦ããã®ã¯æ°å¹´ä»¥ä¸åã¨ããã¤ã¡ã¼ã¸ã§ãããWebãµã¼ãã¹ã¯ç¸å¤ãããWebãµã¼ãã®ä¸ã§åãã¦ããã®ã§ãæµè¡ãå»ãé¢ä¿ãªãå¦ã¶ã¹ãå 容ã ã¨æã£ã¦ãã¾ãã
ã¾ããHTTP/2ãããããRFCåããæ¢ã«h2oãtrusterdãªã©ã®HTTP/2ã®ãµã¼ãå®è£ ããããä»å¾Webãµã¼ãã¢ã¼ããã¯ãã£ãå訪ãããã¨ãå¢ãããããªæ°ããã¦ãã¾ãã
ã¨ããããWebãµã¼ãã¢ã¼ããã¯ãã£ãå¦ã¼ãã¨ããã¨ãæ å ±ã¯å¤ããã®ããæ°ãããã®ã¾ã§å±±ã®ããã«ãããã¾ãã«æµ·ã®ãã®ã¨ãå±±ã®ãã®ã¨ãã¤ããªããã°ã°ã度ã«ç¿»å¼ããã¦ããã¨ããè¥è ã«ã¯å³ããç¶æ³ããããä¸æ¦èªåã®ä¸ã§ã¾ã¨ãã¦ã¿ããã¨æãã¾ããã
åºè«ã¨ãããã¨ã§ãWebãµã¼ãã¢ã¼ããã¯ãã£ã®åºæ¬ã俯ç°ã§ããã¨ãããã¨ã¨ãããçºå±çãªè©±é¡ã¸é²ãã§ããããã®ã«ã¼ã¿ã¼ã®ãããªå½¹å²ãç®æãã¦ãã¾ãã
- èæ¯
- UNIXã®ããã»ã¹ã¨ãããã¯ã¼ã¯API
- Webãµã¼ãã®å®è£ ã¢ãã«
- åèæç®
- ã¾ã¨ã
èæ¯
ãã®æ¥ã«å ¥ç¤¾ããæ°åã®Webã¢ããªã±ã¼ã·ã§ã³ã¨ã³ã¸ãã¢ã¨è©±ããã¦ãã¦ããpreforkã£ã¦ãªãã§ãããã¨ãã話ã«ãªã£ãã ã¢ããªã±ã¼ã·ã§ã³ãµã¼ãããRedisã¸æ¥ç¶ãã¦ããã³ãã¯ã·ã§ã³æ°ã®ã°ã©ããçºãã¦ãã¦ãã ãããã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã®ã¯ã¼ã«ã¼ããã»ã¹æ°ã«çãããã妥å½ãªæ°å¤ã ãããã¨ããããã話ããã¦ããã¨ãã ã£ãã¨æããã¡ãã£ã¨åã¾ã§AnyEvent::Redisã使ã£ã¦ããã¨ãã«ãã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã»Rediséã®ã³ãã¯ã·ã§ã³æ°ãç°å¸¸ãªæ°å¤ã«ãªã£ã¦ãã¦ãAnyEvent::Redisããããããé常å¤ã«æ»ã£ãã¨ããèæ¯ãããã
ãã®è©±ã«ã¯2ã¤ã®æé»çãªç¥èãåæã«ããã1ã¤ã¯å¯¾è±¡ã®ã¢ããªã±ã¼ã·ã§ã³ãµã¼ããpreforkåã®ã¢ã¼ããã¯ãã£ã§åä½ãã¦ããã¨ãããã¨ããã1ã¤ã¯ã¯ã¼ã«ã¼ããã»ã¹åä½ã§Redisã¸ã®ã³ãã¯ã·ã§ã³ããã£ãã·ã¥ãã¦ããã¨ãããã¨ã ã
ãªãã»ã©ã確ãã«å人ã§æ®éã«ã¢ããªã±ã¼ã·ã§ã³ã®ã³ã¼ããæ¸ãã¦ããããWebãµã¼ããDBã¸ã®æ¥ç¶ç®¡çã®ä»çµã¿ããã¾ãæ°ã«ããªããããããªãã Railsã®ãããªWebã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã使ãã¤ã¤ããããã¤ã¯Herokuã«git pushãã¦çµããã¨ããæ代ãªã®ã§ãè£å´ãã©ã®ãããªä»çµã¿ã§åãã¦ããããæ°ã«ããæ©ä¼ã¯å°ãªãã ç¹ã«æ°åã®å½¼ã¯ããã³ãã¨ã³ããå¾æãªã¿ã¤ããªã®ã§ãªãããã ãç ä¿®ã§æãããã¨ããæ°ããããããã®æã®ãã¨ãæããç ä¿®ã¯ãªãã£ãã
ããæç®ãæãããã¨æã£ãããWebãµã¼ãã®ä»çµã¿ãå¦ã¶ããã®ä½ç³»çãªããã¥ã¡ã³ããæå¤ã¨è¦ã¤ãããªããã¨ã«æ°ã¥ããã ãWorking With TCP Socketsããåéçã«ãæ軽ã§æé©ã®ããã«æãããåºæ¬ã¯ã½ã±ããAPIã®è§£èª¬ãªã®ã§ãWebãµã¼ãã®å®è£ é¢ã«ããããã¦ããæãããã ããµã¼ãã»ã¤ã³ãã©ãæ¯ããæè¡ 4.2ç« Apacheã®ãã¥ã¼ãã³ã°ãããããããããªããUNIXã®ããã»ã¹ã®ç¥èãããç¨åº¦å¿ è¦ã ã
ããããèªåãã©ããã£ã¦å¦ç¿ãã¦ããã®ãè¦ãå¾ãªãã ä½ç³»çã«å¦ãã ã¨ã¯ã¨ã¦ãè¨ãããã²ãããã°ã°ã£ã¦ãnaoyaãããkazuhoããã®æã®è¨äºãèªãã ããStarletãªã©ã®ãµã¼ãå®è£ ãèªãã§ã¿ãã¨ãããããªããã ã¢ããå¼ã§å¦ãã§ããã¨æãã
ä¸å¿ãå¦çã®ã¨ãã«åºæ¬çãªTCPãµã¼ãã»ã¯ã©ã¤ã¢ã³ããä½ã£ã¦ãã¦ãsocketãbindãconnectãlistenãselectãacceptãreadãwriteãªã©ã®ã½ã±ããAPIã®ã·ã¹ãã ã³ã¼ã«ãä¸éãå©ãããã¨ã¯ãã£ãããããããå ·ä½çã«ä½ãæå³ããã®ãããªãåããã»ã¹ã§acceptãã¦ããã®ã親ããã»ã¹ã§acceptã¯ããªãã®ãããã³ããããã³ã°I/Oãä½ããªã©ããã¾ãç解ã§ãã¦ãã¦ãªãã£ã
Webãµã¼ãã¢ã¼ããã¯ãã£ã®æ´å²ççµç·¯ã®è¤éããç解ã®é£ããã«æè»ãããã¦ããã Webãµã¼ããç¹ã«Webã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã®ã¢ã¼ããã¯ãã£ã«ã¤ãã¦ãCGIããå§ã¾ãmod_xxxãFastCGIãªã©ããããç¾å¨ã®UnicornãStarletã¾ã§è³ãçµç·¯ãé çªã«å¦ç¿ãã¦ããã®ã¯éª¨ãæããã UnicornãStarletã使ãã¨ãããã¨ã¯ãã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã¨ãã¦Apacheã使ããã«ãã¢ããªã±ã¼ã·ã§ã³ãã¸ãã¯ãæ¸ãè¨èªã¨åãè¨èªã®Webãµã¼ãã使ãã¨ãããã¨ã ãPerlãªãPerlã§æ¸ãããWebãµã¼ãã使ãã¨ããå ·åã«ã
ããã«ãforkã«ãããã«ãããã»ã¹ã¢ãã«ä»¥å¤ã«ãã«ãã¹ã¬ããã¢ãã«ãã¤ãã³ãé§åãªã©ãããè² è·ã®å°ãªãå®è£ ã¢ãã«ãã¢ãã«ã®çµã¿åãããå¤æ°ãããã¨ãç解ãé£ãããã¦ããã
å°ãªãã¨ãä»ããWebãµã¼ãã¢ã¼ããã¯ãã£ãåå¼·ããã®ã«ãCGIãmod_xxxãå¦ã°ãªããã°ãªããªãã¨ãããã¨ã¯ãªãã¨æããããã§ããWebãµã¼ãã¢ã¼ããã¯ãã£ã¨å¼ãã§ããã®ã¯ãå®éã¯Web(HTTP)ã¨ããããã¯ããæ±ç¨ã®TCPãµã¼ãã®å®è£ ã¢ãã«ã®1ã¤ã ããã ã å®è£ ãèªãã§åå¼·ãããªããPerlã®å ´åãStarletããPlackãã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã®é ã«å¦çã追ã£ã¦ã¿ãã¨ããããã Webãµã¼ã以å¤ã«preforkãªTCPãµã¼ãããã¾ãç¥ããªãããpgpool ã¯preforkã ã£ãã¨æãã
æçµçã«ãå¤å ¸åèã¨ããã¦ãããUNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ç¬¬2ç Vol.1 ãããã¯ã¼ã¯API:ã½ã±ããã¨XTIããèªãã§ã¢ã¤ã¢ã¤ãã¦ãããã®ããã£ããããã UNIXã§ä½¿ç¨ã§ããI/Oã¢ãã«ãå¤å ¸çãªTCPãµã¼ãã®è¨è¨ã«ã¤ãã¦é常ã«ããæ´çããã¦ããã åèãçºè¡ãããã®ã1990å¹´å°ã¨å¤ãããèªãã§ã¿ãã¨ä»ã§ãè²ãããªããã¨ããããã¨æããLinuxåºæã®äºæ ãªã©ãé¤ãã¦ããããã¯ã¼ã¯APIã¾ããã§å°ã£ããããããèªãã°ããã¨ããæ°æã¡ã§ããã ãUNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ããè³¼å ¥ããã®ã¯5å¹´åã ã£ãããä»èªãã§ãã¾ã ã¾ã å¦ã³ãå¤ãã
UNIXã®ããã»ã¹ã¨ãããã¯ã¼ã¯API
Webãµã¼ããç解ãããã¨ããã¨ãUNIXãç¹ã«ããã»ã¹ã¨ãããã¯ã¼ã¯APIã«ã¤ãã¦ã®åºæ¬çãªç¥èãå¿ è¦ã ã¨æãã
æåããå¦ç¿ãããªããããã»ã¹ã«ã¤ãã¦ã¯ãWorking With Unix Processesãã¨ããããã¯ã¼ã¯APIã«ã¤ãã¦ã¯åè¿°ã®ãWorking With TCP Socketsãããããããããã åè ã®ãWorking With Unix Processesãã¯ããªãã»ã©UNIXããã»ã¹ â Rubyã§å¦ã¶Unixã®åºç¤ãã¨ããã¿ã¤ãã«ã§ç¿»è¨³ããã¦ããã®ã§ãã¨ã£ã¤ããããã æ®å¿µããå¾è ã«ã¤ãã¦ã¯ç¿»è¨³ããã¦ããªãã®ã§ãæ°åãå ¥ãã¦åæãèªããã¨ã«ãªãã
[asin:B0078VSRUE:detail] [asin:B00BPYT6PK:detail]
ããã»ã¹ã«ã¤ãã¦ã¯ãOSä¸ã§å®è¡ãããããã°ã©ã ã®åºæ¬çãªå®è¡åä½ã§ãããã¨ã¨è¦ªããã»ã¹ã¨åããã»ã¹ãªã©ã®OSã®åºæ¬çãªããã»ã¹ç®¡çãã¾ãç¥ã£ã¦ããã°è¯ãã¨æããps
ã³ãã³ãã®è¦æ¹ããããã°ã ãããããããã
ãããã¯ã¼ã¯APIå¨ãã«ã¤ãã¦ã¯ãã½ã±ããã¨ã¯ä½ããlistenãacceptãªã©ã®åã·ã¹ãã ã³ã¼ã«ã®åä½ãããã»ã¹ããã³ãã¼ãçªå·ã®é¢ä¿ãªã©ããããã°ãããããlsof
ãnetstat
ã³ãã³ããªã©ãå©ãã¦ã¿ã¦ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãã³ãã¯ã·ã§ã³ã®æ§åãçºããã¨ããã
ç°¡åãªTCP echoãµã¼ããæ¸ããã°ãªãããã
ããã ãã§ã¯ããã¾ããªã®ã§ããã¼ãçªå·ã¨ã½ã±ããã«ã¤ãã¦ç解ãã¦ããã¨ãããæ¸ãã¦ã¿ãã
ãã¼ã
TCPãUDPã§éä¿¡ããã¨ãã«ãIPã¢ãã¬ã¹ã ãã§ã¯äºãã®ã¨ã³ããã¤ã³ããèå¥ã§ããªããIPã¢ãã¬ã¹ã§ä¸æã«æ±ºã¾ãã®ã¯ãã¹ãã ãã§ãTCP/UDPã§éä¿¡ãããã¨ããã¨åä¸ãã¹ãä¸ã§åãã¦ããè¤æ°ã®ããã»ã¹ï¼sshdãhttpdãªã©ï¼ã®ãã¡ã®ã©ããã¨ãããã¨ãèå¥ããå¿ è¦ãããã TCPã¨UDPã¯ã©ã¡ãã16ãããæ´æ°ã®ãã¼ãçªå·ãç¨ãã¦ç°ãªãããã»ã¹ãèå¥ãã¦ããã
ã¡ãªã¿ã«IPã¢ãã¬ã¹ã¯ãã±ããã®IPãããã«æ¸ããã¦ããããã¼ãçªå·ã¯ãã±ããã®TCP/UDPãããã«æ¸ããã¦ããã
ã½ã±ããã¨ã¯
ã½ã±ããAPIã®ä½¿ãæ¹ã«ã¤ãã¦æ¸ããã¦ããããå®è£ ã¨ãã¦ã®ã½ã±ããã«ã¤ãã¦æ¸ããã¦ãã¦ããã½ã±ããããã¼ã¿ã¢ãã«ã¨ãã¦ä½ã表ç¾ãã¦ããã®ãã¨ãããã¨ãæ¸ããã¦ããæç®ã¯æå¤ã¨å°ãªãããã«æãã UNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ã«ã¯æ¬¡ã®ããã«ã¯ã£ããã¨ã½ã±ãããä½ã§ããããæ¸ããã¦ãã¦ãæ¼ ç¶ãã¦ãããã®ããã£ããããã ã½ã±ããã¨ã¯ãéä¿¡ã«ãããã¨ã³ããã¤ã³ãã表ç¾ãããã¼ã¿ã¢ãã«ã®ãã¨ã ã
TCPã³ãã¯ã·ã§ã³ã®ã½ã±ãããã¢(socket pair)ã¯ãã³ãã¯ã·ã§ã³ã®ä¸¡æ¹ã®ã¨ã³ããã¤ã³ããå®ç¾©ããããã¼ã«ã«IPã¢ãã¬ã¹ããã¼ã«ã«TCPãã¼ãããªã¢ã¼ãIPã¢ãã¬ã¹ãããã³ãªã¢ã¼ãTCPãã¼ãã®ï¼ã¤çµã§ãããããã½ã±ãããã¢ã¯ãã¤ã³ã¿ã¼ãããã®ä¸ã®ç¹å®ã®ã³ãã¯ã·ã§ã³ãä¸æã«èå¥ããã
åã¨ã³ããã¤ã³ããèå¥ããï¼ã¤ã®å¤ãããªãã¡IPã¢ãã¬ã¹ã¨ãã¼ãçªå·ã¯ãå¤ãã®å ´åã½ã±ãã (socket) ã¨å¼ã°ããã
UNIXãããã¯ã¼ã¯ããã°ã©ãã³ã° 第ï¼ç Vol.1 p43
ã½ã±ããã¯UDPãªã©ã®ã³ãã¯ã·ã§ã³ã¬ã¹ãªãããã¯ã¼ã¯ãããã³ã«ã«ã使ç¨ãããããä¸è¨å¼ç¨åã®ç¶ãã«UDPã«ãæ¡å¼µã§ããã¨æ¸ããã¦ããã
ã½ã±ãããã¢ã®æ¦å¿µã¯ãã³ãã¯ã·ã§ã³ãæããªãUDPã«ãæ¡å¼µãããã¨ãã§ãããã½ã±ããé¢æ°(bindãconnectãgetpeernameãªã©)ã®èª¬æãããå ´åãã©ã®é¢æ°ãã½ã±ãããã¢ã®ã©ã®è¦ç´ ãæä½ããã®ãã«æ³¨ç®ãããä¾ãã°ãbindã¯TCPã¨UDPã®ã©ã¡ãã®ã½ã±ããã«å¯¾ãã¦ããã¢ããªã±ã¼ã·ã§ã³ããã¼ã«ã«IPã¨ãã¼ã«ã«ãã¼ããæå®ãããã¨ãå¯è½ã«ãã¦ããã
UNIXãããã¯ã¼ã¯ããã°ã©ãã³ã° 第ï¼ç Vol.1 p43
Webãµã¼ãã®å®è£ ã¢ãã«
åºæ¬çã«ã¯ãHTTPã§ãªã¯ã¨ã¹ããåãã¦ã¬ã¹ãã³ã¹ãè¿ãã ãã§ããã ãã®ä¸é£ã®æµãããªã¯ã¨ã¹ãå¦çã¨å¼ã¶ãã¨ã«ããããã®ãªã¯ã¨ã¹ãå¦çã®ä¸ã§ããªã¯ã¨ã¹ããåä¿¡ããHTTPãããããã¼ã¹ããã¢ããªã±ã¼ã·ã§ã³å´ã§é©åãªãã³ãã©ãå¼ã³åºããå¿ è¦ãªå ´åã¯å¤é¨ã®ãµã¼ãã¹ãããããããDBã¢ã¯ã»ã¹ããã¥ã¼ã«ãã¼ã¿ãããããããä¸ã§ããã³ãã¬ã¼ãã¨ã³ã¸ã³ãªã©ã«ããHTMLãã¬ã³ããªã³ã°ãããã¯ä»»æã®ãã©ã¼ãããã§ãã¼ã¿ãæ§ç¯ãã¦ãã¯ã©ã¤ã¢ã³ãã«ã¬ã¹ãã³ã¹ã¨ãã¦ã¬ã¹ãã³ã¹ããããã¤ãã¦è¿ãã
preforkã¢ãã«ãªã©ã®Webãµã¼ãã¢ã¼ããã¯ãã£ã®ä¸»ãªé¢å¿ã¯ããªã¯ã¨ã¹ãå¦çãã©ã®ããã«ãã¦å¹çè¯ã並è¡å®è¡ãããã¨ãããã¨ã«ããã¨æãã
ããåæã«1ã¤ãããªã¯ã¨ã¹ããåãä»ããªãã¦ãããªããä½ãèããã«ãããã®å¦çãã«ã¼ãå ã§ã·ãªã¢ã«ã«å®è¡ããã°ããã ããããå®éã¯è¤æ°ã®ã¯ã©ã¤ã¢ã³ãããã®ãªã¯ã¨ã¹ãã並è¡ãã¦å¦çããªããã°ãªããªãã
並è¡å¦çããããã«ã¯ãOSãæä¾ããããã»ã¹ãã¹ã¬ãããè¨èªã®ã©ã³ã¿ã¤ã ä¸ã®è»½éã¹ã¬ãããã¤ãã³ãé§åã¢ãã«ã«ããããã³ãã©ãªã©ã®ãªãããã®å®è¡ã³ã³ããã¹ãã«ãªã¯ã¨ã¹ãå¦çãå§è²ããå¿ è¦ãããã 並è¡å¦çã®ææ³ã®æ°ã ãWebãµã¼ãã¢ã¼ããã¯ãã£ã®ã¢ãã«ããããä¸çªå¤§éæãªåé¡ããã«ãããã»ã¹ããã«ãã¹ã¬ãããã¤ãã³ãé§åããããã¯ãããã®ãã¤ããªããããã¢ãã«ã§ããã
以ä¸ã§ã¯ãåã¢ãã«ã®æ¦è¦ã«ã¤ãã¦å¤§éæã«èª¬æãããåé¡ã®ä»æ¹ã¯ããUNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ç¬¬ï¼ç Vol.1ãããWorking With TCP Socketsããåèã«ãã¦ããããä¾ãã°UNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ã§ã¯ã¤ãã³ãé§åã¢ãã«ã¯ç´¹ä»ããã¦ããªãã¨ãã£ãçç±ããåãåé¡ãã®ã¾ã¾ã§ã¯ãªãã
ã·ãªã¢ã«ã¢ãã«
æãåç´ãªã¢ãã«ãPerlã®å ´åã¯HTTP::Server::PSGIãããå®è£ ä¾ã並è¡å¦çã¯ããã«ãé次ã«å¦çããã ãã§ããã ã¢ããªã±ã¼ã·ã§ã³ã®éçºç¨éã«ã¯ä¸¦è¡å¦çã¯ãããªãã®ã§ãæå ã®ãã¼ã«ã«ç°å¢ã ã¨ãã·ãªã¢ã«ã¢ãã«ã®ãµã¼ãã§åããããããã
Perlã®å ´åãã½ã±ããã©ã¤ããµã¤ã¯ã«ã®ãã¡ãä¾ãã°socketãbindãlistenã¾ã§ãIO::Socket::INET
ã¢ã¸ã¥ã¼ã«ããã£ã¦ãã¾ãã®ã§ããã¾ãã½ã±ããAPIã使ã£ã¦ããã¨ããå®æã¯ãªããããããªãã
ä¸å³ã«ãã·ãªã¢ã«ã¢ãã«ã®ã½ã±ããã©ã¤ããµã¤ã¯ã«ã示ãã
- ãµã¼ãã¯èµ·åæã«ãsocketãbindãlistenã«ããæ¥ç¶ãå¾ ã¡åããæºåããã
- æ¥ç¶ãåãä»ãããacceptã«ããå®éã®ãã¼ã¿ã®èªã¿åºãã¾ã§å¾ ã¤ã
- ãã¼ã¿ãå°çããããªã¯ã¨ã¹ããå¦çãã¦ãã¯ã©ã¤ã¢ã³ãã«ã¬ã¹ãã³ã¹ãè¿ãã
- ã¯ã©ã¤ã¢ã³ãã¨ã®æ¥ç¶ãcloseã«ããéãã¦ãã¾ãacceptå¾ ã¡ç¶æ ã«ãªãã
以ä¸ã®ã©ã®ã¢ãã«ã«ããã¦ããã·ãªã¢ã«ã¢ãã«ã®ã©ã¤ããµã¤ã¯ã«ãåºæ¬ã¨ãªãã
ãã«ãããã»ã¹ã¢ãã«
å ã«ãè¿°ã¹ãããã«ãã·ãªã¢ã«ã¢ãã«ã§ã¯ä¸¦è¡ã«ãªã¯ã¨ã¹ããå¦çã§ããªãã ããã§ããªã¯ã¨ã¹ããåä¿¡ãããã³ã«ãforkã«ããåããã»ã¹ãçæããåããã»ã¹ã«ãªã¯ã¨ã¹ãå¦çãä»»ãã(1 connection per process)ã
forkã¯ã¡ã¢ãªä¸ã®ããã»ã¹ã®ã¢ãã¬ã¹ç©ºéã丸ãã¨å¥ã®ã¢ãã¬ã¹ç©ºéã«ã³ãã¼ãããããä¸è¬ã«é ãã¨è¨ããã¦ããã
ããããå®éã¯OSã®ã¡ã¢ãªç®¡çã®æé©åææ³ã®1ã¤ã§ããCopy On Write(Cow)ã¨ããä»çµã¿ã§ãç¬éçãªã¡ã¢ãªã³ãã¼ã®è² è·ãæãã¦ããã CoWã¯forkæã«ã¯åããã»ã¹ã®ä»®æ³ã¢ãã¬ã¹ç©ºéã«è¦ªããã»ã¹ã®ã¢ãã¬ã¹ç©ºéããããã³ã°ãã親ã¨åã§ã¢ãã¬ã¹ç©ºéãå ±æããã åããã»ã¹ã¯ãã¡ã¢ãªã®åç §æã«ã¯è¦ªããã»ã¹ã®ç©çã¢ãã¬ã¹ç©ºéãåç §ããã ä¸æ¹ã§ãã¡ã¢ãªã®æ¸ãè¾¼ã¿æã«ã¯æ¸ãè¾¼ã¾ãããã¼ã¸ã親åã§å ±æãããã¨ã¯ã§ããªãã®ã§ãæ¸ãè¾¼ã¿åã«è©²å½ã¡ã¢ãªãã¼ã¸ãåããã»ã¹ã«ã³ãã¼ãã¦ããæ¸ãè¾¼ãã以éã該å½ãã¼ã¸ã®ã¡ã¢ãªå ±æã¯ããªãã (fork & execã®å ´åã¯ãåããã»ã¹ã§è¦ªã¨ã¯å ¨ãç°ãªãããã°ã©ã ãå®è¡ããããã親åéã§å ±æã§ãããã¼ã¸ããªããCoWãå¹ããªãã¯ãï¼
CoWã§ã¡ã¢ãªã³ãã¼è² è·ãæããããã¨ã¯ããããªã¯ã¨ã¹ãã®åº¦ã«ä½åãªå¦çãçºçããã®ã¯ééããªãã®ã§ããªãã¹ãforkãããªãææ³ã¨ãã¦preforkã¢ãã«ãããã preforkã¯è¨èã®éããäºåã«forkãããã¨ãæãã ãµã¼ãèµ·åæã«äºåã«ä¸å®æ°ã®åããã»ã¹*1ãforkãã¦ããããããã使ãã¾ãããã¨ã§ããªã¯ã¨ã¹ããã¨ã«forkããªãã¦ããã
preforkåã®ãã¡ãªããã¯ãåææ¥ç¶æ°åã ãã®ããã»ã¹ãã¡ã¢ãªä¸ã«ç¢ºä¿ãã¦ããå¿ è¦ããããããã¡ã¢ãªæ¶è²»éãå¤ããªããã¨ã ã CoWã§å ±æã§ããã¨è¨ã£ã¦ãããªã¯ã¨ã¹ããå¦çãã¦ãã度ã«è¦ªåéã®ã¡ã¢ãªãã¼ã¸ã®å·®ç°ã¯å¤§ãããªã£ã¦ããã
ãããããç¨åº¦è§£æ±ºããããã«ãNåãªã¯ã¨ã¹ããå¦çããåããã»ã¹ã親ããã»ã¹ã殺ãã¦åforkãããããªå®è£
ãããã
ããã«ãããå®æçã«ããã»ã¹ãæ»ãã§ã¡ã¢ãªãéæ¾ããã¦ãCoWã«ããã¡ã¢ãªå
±æçãæ¯è¼çé«ãããã»ã¹ããæ®ããªãããã«ãªããã¡ã¢ãªä½¿ç¨éãåæ¸ã§ããã
ã¢ããªã±ã¼ã·ã§ã³ã®ã¡ã¢ãªãªã¼ã¯ãããã»ã©æ°ã«ããªãã¦ãããã®ãã¡ãªããã¨è¨ããã
MaxReqsPerChild
ã¨ãããããªååã®ãã©ã¡ã¼ã¿ã§ãNãæå®ã§ããWebãµã¼ããå¤ãã
ããã«ãåããã»ã¹ã®æ°ä»¥ä¸ã®ã¯ã©ã¤ã¢ã³ãæ°ãåæã«æããã¨ãã§ããªãã¨ããå¥ã®ãã¡ãªãããããã ããã¯å¾è¿°ãããã«ãã¹ã¬ããã¢ãã«ã«ãå½ã¦ã¯ã¾ãã åææ¥ç¶ã¯ã©ã¤ã¢ã³ãæ°ãåããã»ã¹ã®æ°ãè¶ ããã¨ã3-wayãã³ãã·ã§ã¤ã¯æ¸ã¿ã®æ¥ç¶ã¯ã«ã¼ãã«å ã®ãã¥ã¼ã«ãã¾ã£ã¦ããããacceptãã人ãããªããããæ¥ç¶ã¯å¦çãããªãã¾ã¾ã¨ãªããããªãã¡ãä¸è¬ã«è©°ã¾ãã¨è¨ããããããªç¾è±¡ãèµ·ããããã
PerlãªãStarletãRubyãªãUnicornãªã©ããã®ã¢ãã«ã«è©²å½ããã
ãã«ãã¹ã¬ããã¢ãã«
ã¹ã¬ããã¨å¼ã°ãããã®ã«ãOSãæä¾ãããã¤ãã£ãã¹ã¬ããã¨ããã°ã©ãã³ã°è¨èªã®VMä¸ã«å®è£ ãããã°ãªã¼ã³ã¹ã¬ããï¼Erlangã®ãããã»ã¹ããGoè¨èªã®goroutineãªã©ï¼ããããå¾è ã¯è»½éããã»ã¹ãããã¯è»½éã¹ã¬ããã¨å¼ã°ããããããããã§ã¯ãã¹ã¬ããã¯ä¸»ã«åè ãæããã¨ã«ãããã¹ã¬ãããæ示çã«çæããã«ãåã«1ã¤ã®ããã»ã¹ãåãã¦ããå ´åã§ãã1ããã»ã¹=1ã¹ã¬ããã¨èãã¦ã1ã¤ã®ã¹ã¬ããã§åä½ããã¨è¡¨ç¾ãããã¨ãããã
ãã«ãã¹ã¬ããã¢ãã«ããåºæ¬ã¯ãã«ãããã»ã¹ã¢ãã«ã¨åããããªã¯ã¨ã¹ããã¨ã«ã¹ã¬ãããçæããã¢ãã«ï¼1 connection per threadï¼ã¨ãäºåã«ã¹ã¬ãããçæãã¦ããã¢ãã«ï¼ã¹ã¬ãããã¼ã«ï¼ãããã
ã¹ã¬ããã¯çæå ã®ããã»ã¹ã¨ã¢ãã¬ã¹ç©ºéãå ±æãããããããã»ã¹ã®forkã®ããã«ä¸¸ãã¨ã¢ãã¬ã¹ç©ºéããã³ãã¼ãããã¨ã¯ãªããã¹ã¬ããçæã®ã³ã¹ãã¯ä¸è¬ã«ããã»ã¹çæããå°ããã¨è¨ããã¦ããã ( マルチスレッドのコンテキスト切り替えに伴うコスト - naoyaのはてなダイアリー )
ã¡ã¢ãªæ¶è²»éã«ã¤ãã¦ããã¹ã¬ããã®ã»ããä¸è¬ã«å°ããããã¨è¨ããã¦ããããããã«ã¤ãã¦ã¯çæã³ã¹ãã¨åæ§ã®è°è«ã«ãªãã
å®éã«ãã«ãã¹ã¬ããããã°ã©ãã³ã°ãããã¨ããã¨ãè¤æ°ã®ã¹ã¬ãããã¡ã¢ãªã¢ãã¬ã¹ç©ºéãå ±æãã¦ããããããªã½ã¼ã¹ç«¶åãããã°ã©ããæèãã¦é¿ããªããã°ãªããªãã ãã®ç¹ããã«ãããã»ã¹ã¢ãã«ã®æ¹ãã¡ã¢ãªã¢ãã¬ã¹ç©ºéãéé¢ããããããã³ã¼ããè¤éã«ãªãã«ããã¨ããã¡ãªãããããã MySQLã«å¯¾ãã¦Postgresã®ã»ããã³ã¼ãã綺éºã¨è¨ãããæ以ã¯ãåè ããã«ãã¹ã¬ããã¢ãã«ãªã®ã«å¯¾ãã¦ãå¾è ããã«ãããã»ã¹ã¢ãã«ã§ããã¨ãããã¨ããããããããªãã
ã¤ãã³ãé§åã¢ãã«
Node.jsãªã©ã«ä»£è¡¨ãããã¢ãã«ãã¯ã©ã¤ã¢ã³ãããã®æ¥ç¶ç®¡çããªã¯ã¨ã¹ãå¦çããã¤ãã³ãã«ã¼ãã«ãã1ã¤ã®ã¹ã¬ããã§å®è¡ããã
ã·ãªã¢ã«ã¢ãã«ã®èª¬æã®ã¨ããã§ãacceptãreadãwriteãªã©ãI/Oãå®äºããã¾ã§å¦çããããã¯ããã¨æ¸ããã ãããã£ã¦ã1ã¹ã¬ããã§ã¯åæã«è¤æ°ã®ãããã¯å¦çãæ±ããªããããåè¿°ã®2ã¤ã®ã¢ãã«ã§ã¯ãããã»ã¹ãã¹ã¬ããã®ãããªç°ãªãå®è¡ã³ã³ããã¹ãã«å¦çãå§è²ãã¦ããã
å¦çããããã¯ãããããªI/Oã¢ãã«ãããããã³ã°I/Oã¨å¼ã¶ã UNIXã«ã¯ä»ã«ãI/Oã¢ãã«ãããããUNIXãããã¯ã¼ãã³ã°ããã°ã©ãã³ã°ç¬¬ï¼ç Vol.1 第ï¼ç« ãã«ããã¨ä»¥ä¸ã®5ã¤ãããã
- ããããã³ã°I/O
- éããããã³ã°I/O
- I/Oã®å¤éåï¼selectã¨pollï¼
- ã·ã°ãã«é§åI/O
- éåæI/Oï¼Posix.1ã®aio_é¢æ°ç¾¤ï¼
ããããã³ã°I/Oã¢ãã«ã§ã¯é常1ã¤ã®ã½ã±ããã®I/Oã§å¦çããããã¯ãã¦ãã¾ãããã1ã¤ã®ããã»ã¹/ã¹ã¬ããã§è¤æ°ã®ã½ã±ãããæ±ããã¨ã¯é£ããã ããã§ãã¤ãã³ãé§åã¢ãã«ã§ã¯ãä¸è¨ã®ãã¡I/Oã®å¤éåã«ãããã©ã®ã½ã±ããããI/Oãããããç¥ããã¨ã§ãããããã³ã°I/Oãç¨ãã¦ãã¦ãè¤æ°ã®ãããã¯ã¼ã¯I/Oãæããããã«ãã¦ããã ã¤ãã³ãé§åã¢ãã«ã«ã¤ãã¦ã¯ãmizzyããã®ã¹ã©ã¤ã イベント駆動プログラミングとI/O多重化 ãããããããã
I/Oã®å¤éåã¯ãselect/pollãªã©ã®ã·ã¹ãã ã³ã¼ã«ãç¨ãã¦ãè¤æ°ã®ã½ã±ããã®I/Oã¤ãã³ããç£è¦ãããselectã«ããããã¼ã¿ãåä¿¡å¯è½ãªã½ã±ããã§ã®ã¿ãacceptãreadãªã©ã®ããããã³ã°I/Oãåºæ¬çã«ãããã¯ããã«å¼ã³åºããã ãã®I/Oã¤ãã³ãç£è¦ã¯ãé常ã«ã¼ãã¨ãã¦å®è£ ããããã¤ãã³ãã«ã¼ãã¨å¼ã°ããã ã«ã¼ãã®å é ã§selectãå¼ã³åºããã¤ãã³ããããã¾ã§ãããã¯ããã¤ãã³ããããã°å¦çãåéããã
ã¤ãã³ãé§åã¢ãã«ã®ã¡ãªããã¯ãpreforkãã¹ã¬ãããã¼ã«ã¨éã£ã¦ãåæã«æ¥ç¶ã§ããã¯ã©ã¤ã¢ã³ãæ°ã«ä¸éããªããã¨ã ã å³å¯ã«ã¯ãã¼ãã¦ã§ã¢ãªã½ã¼ã¹ããªã¼ãã³ãã¦ãããã£ã¹ã¯ãªãã¿æ°ã®å¶éãlistenããã¯ãã°ã®å¶éãªã©ã¯ãã¡ããããããã¢ãã«ãã®ãã®ã«ã¯æ¥ç¶æ°ã®éçã¯ãªãã
ä¸æ¹ã§ãã¤ãã³ãé§åã¢ãã«ã®ãã¡ãªããã¯1ã¹ã¬ããã§åä½ããããããã«ãã³ã¢ã¹ã±ã¼ã«ããªããã¨ã ã ããã¯å¾è¿°ã®ãã¤ããªããã¢ãã«ã§è§£æ±ºãããã
ããã«ãããã²ã¨ã¤ã®ãã¡ãªããã¨ãã¦ããªã¯ã¨ã¹ãå¦çä¸ã«ããããã³ã°ããã³ã¼ããæ¸ãã¨ã¹ã¬ãããã¨ãããã¯ãã¦ãã¾ãã¨ããåé¡ãããã
ä¾ãã°ãmizzyããã®ã¹ã©ã¤ãã«æ¸ããã¦ããããã«ãlibmysqlclient
ã¯ããããã³ã°I/Oåæã®ã³ã¼ããªã®ã§ãã¤ãã³ãé§åã¢ãã«ã§ã¯ä½¿ããªãã
åºæ¬çã«ããªã¯ã¨ã¹ãå¦çä¸ã®ãã¼ã¿ãã¼ã¹ã¨ã®æ¥ç¶ã«ã¯ãã³ããããã³ã°I/Oã使ããªã©ã®å¦çããããã¯ããªã工夫ãå¿
è¦ã ã
ãããã«ãã¦ããè¨èªã¾ãã¯ãã¬ã¼ã ã¯ã¼ã¯ã¬ãã«ã«ãããããã°ã©ãã³ã°ã¢ãã«ã®éåæå¦çãµãã¼ãããªãã¨ããªãè¤éãªã³ã¼ãã«ãªã£ã¦ãã¾ããã¨ãäºæ³ã§ããã
Node.jsããPerlãªãTwiggyãRubyãªãEventMachineãPythonãªãTwistedãWebãµã¼ã以å¤ã«ã¯Redisãªã©ããã®ã¢ãã«ã«è©²å½ããã
ãã¤ããªããã¢ãã«
ãã¤ããªããã¢ãã«ã¯ä¸è¨3ã¤ãçµã¿åãããã¢ãã«ã®ãã¨ã çµã¿åããæ¹ã«ãããæ§ã ãªã¢ãã«ãèããããã ããã§ã¯ãããã«ãããã»ã¹/ã¹ã¬ãã -> ã¤ãã³ãé§åãã¨ãã¤ãã³ãé§å -> ãã«ãããã»ã¹/ã¹ã¬ããããç´¹ä»ããã
ãã«ãããã»ã¹/ã¹ã¬ãã -> ã¤ãã³ãé§å
ç´ç²ãªã¤ãã³ãé§åã¢ãã«ã®å ´åã1ã¹ã¬ããã§ããåä½ããªããããã«ãã³ã¢ã¹ã±ã¼ã«ããªãã¨ããåé¡ãããã ããã§ãprefork/ã¹ã¬ãããã¼ã«ã¨ã¤ãã³ãé§åã¢ãã«ãçµã¿åããããã¨ã«ããããã«ãã³ã¢ã¹ã±ã¼ã«ãããã¢ãã«ãããã
å ·ä½çã«ã¯preforkã¾ãã¯ã¹ã¬ãããã¼ã«ã¨åæ§ã«èµ·åæã«ä¸å®æ°ã®ã¯ã¼ã«ã¼ããã»ã¹/ã¹ã¬ãããçæãã¦ãããåã¯ã¼ã«ã¼ã§ã¯ã¤ãã³ãé§åã¢ãã«ã«ããæ¥ç¶ãåãä»ããªã¯ã¨ã¹ãå¦çããã
NginxãPlay2ãªã©ãããã«è¿ããåè ã¯prefork+ã¤ãã³ãé§åãå¾è ã¯ã¹ã¬ãããã¼ã«+ã¤ãã³ãé§åã§åä½ãããPerlãªãTwiggy::Preforkãprefork+ã¤ãã³ãé§åã¢ãã«ã«ç¸å½ããã
ã¤ãã³ãé§åã¢ãã«åæ§ããããã³ã°I/Oãªã©ã®å¦çããããã¯ãããããªã³ã¼ããæ¸ãã¨ãã®ããã»ã¹/ã¹ã¬ããã®å¦çã¯ä»ã®I/Oãæããªããªãã®ã§æ³¨æãå¿ è¦ã ã
ã¤ãã³ãé§å -> ãã«ãããã»ã¹/ã¹ã¬ãã
ã¡ã¤ã³ã®ã¹ã¬ãããã¤ãã³ãã«ã¼ãã§æ¥ç¶ç®¡çããã¤ã¤ããªãããã®æ¹æ³ã§ã¡ã¤ã³ã¹ã¬ãããacceptã§å¾ãã¯ã©ã¤ã¢ã³ãã®ã½ã±ãããå¾ç¶ã®ããã»ã¹/ã¹ã¬ããã«æ¸¡ãã¦ããªã¯ã¨ã¹ãå¦çãå§è²ããã¢ãã«ãããã
preforkã®å ´åã親ããã»ã¹ã§acceptããã½ã±ããï¼ãã£ã¹ã¯ãªãã¿ï¼ãUNIXãã¡ã¤ã³ã½ã±ããã«ããåããã»ã¹ã«æ¸¡ãæ¹å¼ããããããããã£ã¹ã¯ãªãã¿ããã·ã³ã°ã¨å¼ã¶ã
kazeburoããã®Monocerosãããã«è¿ãã
EventMachineã®ããã«ãåºæ¬ã¯ã·ã³ã°ã«ã¹ã¬ããã®ã¤ãã³ãã«ã¼ãã§æ¥ç¶ã¨ãªã¯ã¨ã¹ãå¦çãæãä¸æ¹ã§ãé·æéåãã¦ãããããã¯ããããã³ã°å¦çãé 延ãããããã«ã¹ã¬ãããã¼ã«ãæä¾ãããããªå®è£ ãããã ã¤ãã³ãé§åã¢ãã«ã«ããã¦ãããããã³ã°å¦çãã©ããã¦ãæ¸ããªãã¨ãããªãã¨ãã«ãã¹ã¬ãããã¼ã«ã«ãããä»»ãã¦ãã¾ããã¨ãããã¨ã ã¨æãã
åèæç®
æ大ã®åèæç®ã¯æ¸ç±ãUNIXãããã¯ã¼ã¯ããã°ã©ãã³ã°ãã ããWebä¸ã®è³æã«ã¤ãã¦ããªã¹ãã¢ããããã
- The C10K problem
- http://tech.geniee.co.jp/entry/so_reuseport
- はてなグループの終了日を2020年1月31日(金)に決定しました - はてなの告知
- ネットワークプログラムのI/O戦略 - sdyuki-devel
- prefork サーバーと thundering herd 問題 - naoyaのはてなダイアリー
- マルチスレッドのコンテキスト切り替えに伴うコスト - naoyaのはてなダイアリー
- Starman と Starlet のベンチマークと Accept Serialization - Hateburo: kazeburo hatenablog
- プロのサーバ管理者がApacheのStartServers, (Min|Max)SpareServers, MaxClientsを同じにする理由 - blog.nomadscafe.jp
- How we've made Phusion Passenger 5 ("Raptor") up to 4x faster than Unicorn, up to 2x faster than Puma, Torquebox
- How to build a High Performance PSGI/Plack Server
- 『How to build a High Performance PSGI/Plack Server』のその後と ISUCON3を受けての…
- 最速最強Webサーバーアーキテクチャ - Qiita
- マルチコア時代の高並列性IOアーキテクチャ Wavy - Blog by Sadayuki Furuhashi
- http://developer.cybozu.co.jp/archives/kazuho/2009/09/epoll-bac0.html
- The Architecture of Open Source Applications (Volume 2): nginx
- Blog - LINE ENGINEERING
- Kazuho's Weblog: [メモ] Starlet 0.22のリリースに伴いThundering Herd問題を再訪した件
- Socket Sharding in NGINX OSS Release 1.9.1
ãããã¿ãã¨ãWebãµã¼ãã¢ã¼ããã¯ãã£ã®è©±ã2007å¹´ãã2009å¹´ãããã¾ã§ã®æ¥æ¬ã®Webæ¥çã§çããªè©±é¡ã ã£ããã¨ããªãã¨ãªããããã 2010年以éã¯Perlçéã§ã¯Plackãæ®åããPlackä¸ã§åä½ããWebãµã¼ããããã¤ãéçºããã話é¡ã«ãªã£ããã¨ããããã
ä¸è¨ã®åèæç®ãèªãã§ããã¨ãä»åç´¹ä»ãããã®ããã¼ã¹ã«ããçºå±çãªé¢é£ãããã¯ã¨ãã¦ã次ã®ãããªãã®ãããã¨ãããã¨ãããã£ã¦ããããã®è¾ºãããã£ã¦ããã¨ãWebãµã¼ãã¢ã¼ããã¯ãã£ã¾ããã®ç¥èãã¤ãã¦ããã¨è¨ãããããããªãã
- ããããã³ã°I/Oããã³ããããã³ã°I/OãéåæI/OãI/Oå¤éå
- UNIXãã¡ã¤ã³ã½ã±ãã
- Thundering herdåé¡, accept mutex
- epoll/kqueueãã¬ãã«ããªã¬å/ã¨ãã¸ããªã¬åéç¥
- HTTP keepalive
- Zero Copy
- accept4ãTCP_DEFER_ACCEPTãSO_REUSEPORT
- ããããããã¤
- è¨èªã®è»½éããã»ã¹/ã¹ã¬ãã
ã¾ã¨ã
åé ã«æ¸ãã¦ããããã«ã¡ããã©æè¿ç¤¾å ã§è©±é¡ã«ãªã£ãå 容ã¨ãããã¨ãããã以åããæ´çãããã¨ãæã£ã¦ããã®ã§ãèªåãªãã«ã¾ã¨ãã¦ã¿ã¾ããã ã¾ã ã¾ã ããã£ã¦ããã¤ããã§ããã£ã¦ããªãã¨ãããå¤ãã¨æãã¾ãããããèªåãä»ããå¦ãã§ãããªãããããã¨ã³ããªãããã¨å©ãã«ãªããããããªãã¨ããè¦ç¹ã§ãWebãµã¼ãã¢ã¼ããã¯ãã£ã®å¦ã³æ¹ã®ãããªãã®ãä¸å¿æ¸ããã¤ããã§ãã
å¤ã話é¡ã¨ã¯ãããä»ã§ãåãã¢ã¼ããã¯ãã£ã®Webãµã¼ãã使ã£ã¦ããã®ã§ããããã¯ã®éè¦åº¦ã¯ãããªã«å¤ãã£ã¦ã¯ããªãã¨æã£ã¦ãã¾ãã Webä¸ã®æç®ã«é ¼ãã¨ã©ããã¦ãããã ã¢ããå¼ã®å¦ç¿ã«ãªããä½ç³»çãªç¥èãå¾ãããªãã¨æ©ããã¨ãããã¾ããåå ¸ãå¤å ¸ã¨è¨ããããããªé·ãèªã¾ãç¶ããæ¸ç±ã«æ¡å¤çããæ¸ãã¦ããã¨ãããã¨ãå人çã«ç¹ã«é¡èã«ä½é¨ããåéã§ãããã¾ãã
åå ¸ãå¤å ¸ãèªãä½é¨ã¨èãã¨ãtomomiiããã®è¨äºãããé ã«æãæµ®ãã¹ã¾ãã
ãé³è åããªã確ããªæè¡ãå¿ è¦ã ãåã³æ¬ã«åãã
Webãµã¼ãã«ã¤ãã¦ã¯ã5å¹´å¾ã10å¹´å¾ãããããåããããªä»çµã¿ã®å»¶é·ç·ä¸ã§å®è£ ããã¦ããã¨æãã®ã§ã3å¹´å¾ã«ä½¿ã£ã¦ãããã©ãããããããªãæµè¡ãã®ãã¼ã«ã§ãã æ¶èããããã¯æ¯ã®é·ãæè¡ãç¥èã身ã«ã¤ãããã¨æã£ã¦ããæ¨ä»ã§ãããã¡ããæµè¡ãã®ãã¼ã«ã好ããªãã§ããã
*1:preforkã«ããã¦ãåããã»ã¹ã®ãã¨ãã¯ã¼ã«ã¼ããã»ã¹ã¨å¼ã¶ãã¨ãããã