(Min|Max)SpareServers ã«ããã prefork ã¢ãã«ãèãã¦ã¿ã
ããããåçã«ããã»ã¹æ°ãå¤åããããã¨ãã§ãã¦ä½ãããããããã¨ããã¨ãè² è·ã軽ãæã«ãå¥ã®ã¿ã¹ã¯ãåããã¦ããã¢ã¤ãã«ç¶æ
ã®ãµã¼ãããã»ã¹ãéªéã«ãªããªããã£ã¦ããããªã®ããªãã§ããã®ããï¼ã ãï¼ã« Scoreboard ã¨ãè¤éãªä»çµã¿ãç¨æããã®ã¯ãªãã ããªã¼ã¨æã£ããã
ï¼scoreboard èªä½ã«ã¯ mod_status ã¿ãããªä½¿ãæ¹ããããã©
ä¸æ¹ã§ã(Min|Max)SpareServers æ¹å¼ã«ã¯ãè² è·ã®å¢å¤§å±é¢ã§ fork(2) ãçºçããã¨ãã好ã¾ãããããåé¡ããã£ããããã
ï¼ç¹ã«ãã³ããã¼ã¯çµæã«æªå½±é¿ãåºã :-p
ãããããã»ã¹æ°ãåºå®ããã¾ã¾ãè² è·ã軽ãéã«ä½è¨ãªãªã½ã¼ã¹ãé£ããªããããªè¨è¨ãã§ããªãããã§ããããããªãããªã¼ãã¨ããã®ãæ¬é¡ãå ·ä½çã«ã¯ã
accept(2) ã«ã¯ãå¿ ã mutex lock ããããmutex ãããã¯ã§ããªãã£ãã¯ã¼ã«ã¼ããã»ã¹ã¯ãèªåãä¸å®é以ä¸ã¡ã¢ãªãæ¶è²»ãã¦ãã¦*1ããã¤ãæå¾ã«ãªã¯ã¨ã¹ããå¦çãã¦ããä¸å®æé以ä¸çµéãã¦ããæ°ããæ¥ç¶ãåãä»ãããã¨ããªãã£ãå ´å㯠exit(2) ãã- 親ããã»ã¹ã¯æ°ããåããã»ã¹ã spawn ãã
ã§ããããããªãã®ããªã¼ã¨ãvanilla ãªã¯ã¼ã«ã¼ããã»ã¹ã¯ CoW ãªã®ã§ã»ã¨ãã©ã¡ã¢ãªé£ããªãããã¹ã±ã¸ã¥ã¼ã©çã«ã¯ thundering herd ãèµ·ãããªããã°ãå¾ æ©ããã»ã¹å¢ããã¦ãåé¡ãªãã¯ãã ãã
ã¢ããªã±ã¼ã·ã§ã³ãµã¼ãæ¸ããããªã±ã¼ã¹ã ã¨ããã®ã»ããã(Min|Max)SpareServers ã¢ãã«ããããçµææ¶è²»ã¡ã¢ãªéã¯å°ãªããªãããããªãããªï¼SpareServers ã¢ãã«ã MinSpareServers åã®ããã»ã¹ã®æ¶è²»ã¡ã¢ãªãååããªãã®ã«å¯¾ãããã®ã¢ãã«ã ã¨å ¨ã¯ã¼ã«ã¼ããã»ã¹ã®æ¶è²»ã¡ã¢ãªãååã§ããããï¼ã
åè: Apache Performance Tuning - Apache HTTP Server Version 2.2
2009/09/25 追è¨: mutex lock 使ããªãã¦ã alarm(2) ã§ã§ããã¨æã£ãã®ã§ä¿®æ£ãã¨ãããããã£ã¨åç´ã«ããã³ãã«ãããªã¯ã¨ã¹ãæ°ã¨å¾ æ©ããæéã®åè¨ãï¼ã§ãªãããã¤ä¸å®æ°ï¼ä¾ãã°100ï¼ãè¶ ãããã¯ã¼ã«ã¼ããã»ã¹ã¯ exit(2)ãã¨ããã¢ãã«ãè¯ãããã
*1:ã¢ããªã±ã¼ã·ã§ã³ãµã¼ããªããï¼åã§ããªã¯ã¨ã¹ããå¦çãããã¿ãããªåºæºã§ããã¨æã