#naruhounix ãèªãã ã
æ£ç´ãããã»ã¹ï¼ããã§ããããªããåããã¤ããã¨ããã¬ãã«ã ã£ãã®ã§é常ã«åå¼·ã«ãªã£ãã
Rubyã§æ¸ããã¦ããã®ããä½è¨ãªãã¨(Cã®ææ³ã¨ãä¾å¤å¦çã¨ã)ãã¤ãã¦ããªãã¦ç解ããããã
æ¸ãæ¹ã¯ããããã¤ã¡ã¼ã¸ãç¥ãããããï¼ã¨ããã¿ã¤ãã®æ¹ã«ããããã
éã«Rubyã®ä½è¨ãªãã¨(ãã®ãã¼ã¸ã§ã³ã§ã¯ä¿®æ£æ¸ã¿ã¨ã)ãã¤ãã¦ããã®ã§Rubyistå¯ãã§ãããã¨ã¯ããªããªãã
ããã»ã¹ãforkãã¦ããªã½ã¼ã¹ã¯åãã¿ãããªã¨ããã¯ãã¤ã³ã¿çãªè§£éã
ãã¨forkå¾ã¡ãã£ã¨ã§ãã¡ã¢ãªã®å 容ãå¤ãã£ããå ¨ã³ãã¼ã ã¨æã£ã¦ããã©å ¨ç¶éã£ã¦ãªãã¸ã§ã¯ãåä½ï¼(ãã®ã¸ããããµã)ã¨ãããæ¬å½ã«å¤ãã£ãé¨åã ãã³ãã¼ãããã¿ããã ã
ä¾ãã°Railsã¢ããªã¨ãã¯ç«ã¡ä¸ããéã«å¤§éã®ãã¬ã¼ã ã¯ã¼ã¯ã®ã³ã¼ãã¨ã¢ããªã±ã¼ã·ã§ã³ã®ã³ã¼ããèªã¿è¾¼ãã§ããã®ã§æ°ç§ã¨ããããã
ãããã³ã¼ãã¨ãè¨å®ãã¡ã¤ã«ã¯ã¢ããªã±ã¼ã·ã§ã³ã¨ãã¦ã¯ã»ã¨ãã©å¤ãããã¨ããªãé¨åãªã®ã§æ¬¡ããåå©ç¨ãããã¨ãã§ããã°è¶ æ©ãããã¨ããã®ãSpringãUnicornã®ãããããã¨ãªãã ãããªãã¨æãã
並åå¦çã¨ããããä¸ã¤ã®å´é¢ããã£ã¦ãããã¾ã§ä¸¦åå¦çããããããã¨ããã¤ã¡ã¼ã¸ã ã£ããã©ã¨ããããforkãã¦ããã°ããã»ã¹ãè¤æ°ç«ã¡ä¸ãã£ã¦ãã¨ã¯OSããããªã«ä¸¦ååãã¦ãããã¨ãããã¨ãããã£ããOSãããã
å®éã«ä½ã£ã¦ã¿ãç¿ä½
Måã®ã¿ã¹ã¯ãæ大åæNããã»ã¹ã§å¦çãããforkãã¦waitããã ãã®ç°¡åãªãã®ã forkã¨waitã®åå¾ã§ä»»æã®callbackãå¼ã¹ããªãã·ã§ã³ä»ãã
ããã§ã¯ãã£ãããããè¨ç®ãã¦ãããã©ãã¨ãããã試ãã¦ã¿ãã¨åæèµ·åã§ããããã»ã¹æ°ã¯1ããã»ã¹ãã2ããã»ã¹ã®æ¹ãçµæ§æ©ããªããã©ãã©ãããã»ã¹æ°ãä¸ããã¨CPUã®ã³ã¢æ°ãããã§ã©ããªã«ããã»ã¹ãä½ã£ã¦ãããã¾ãæ©ããªããªããã¨ãããã£ãã
ã³ã¼ããæ±ããªãã¸ã§ã¯ãã¯å°ããã®ã§ã¡ã¢ãªå ±æã®å®æã¯ããã¾ããªãã£ããã©èªåã§ã並åå¦çã§ããããããã¨ããå°ããèªä¿¡ã«ãªã£ãã
å å¼æ¬ããããããªã®ã§èªãã§ã¿ããããªãã