Apahceã®ServerLimitãã£ã¬ã¯ãã£ã
ããã¾ã§prefork MPMã§ä½¿ã£ã¦ããApacheããè² è·å¢å ã®ããworkeråãããã¨ã«ããã(MPMã«ã¤ãã¦ã¯以前のブログ)ã§ç´¹ä»ããããããªããã§httpd.confã®MPMã«é¢ããè¨å®å¤ãåæ¤è¨ãããã¨ã«ãªã£ãããã ããServerLimitã®ãã£ã¬ã¯ãã£ãã®MPMã«ããéãããã£ããã¨ããè¦ãã¦ããªãã£ãã®ã§ããä¸åº¦èª¿ã¹ã¦ã¿ãã
- prefork MPM ã®å ´å
- ServerLimitã¯Apacheããã»ã¹ç¨¼åä¸ã«ãããMaxClientsã«è¨å®å¯è½ãªä¸éå¤ãè¨å®ãããããã¯ãpreforkã®å ´åã¯ãåæã¯ã©ã¤ã¢ã³ãæ° = ãµã¼ãããã»ã¹æ°ãã«ãªãããã
- prefork MPM ã§ã¯ãMaxClientsã256 (ããã©ã«ã) ããã大ããªå¤ã«è¨å®ããå¿ è¦ãããæã«ã ã使ç¨ããã å¸æã® MaxClientsæ°ã¨ããã¹ã¦ãå¿ è¦ä»¥ä¸ã«å¤§ããªå¤ãæå®ãããã¨ã¯é¿ããã
- worker MPMã®å ´å
- ServerLimitã¯ThreadLimitãã£ã¬ã¯ãã£ãã¨çµã¿åããã¦ã Apacheããã»ã¹ç¨¼åä¸ã«ããã MaxClientsã«è¨å®å¯è½ãªä¸éå¤ãè¨å®ããã åèµ·åä¸ã«ãã®ãã£ã¬ã¯ãã£ããå¤æ´ãã¦ãç¡è¦ããããã MaxClientsã¯åèµ·åä¸ã«ä¿®æ£ãããã¨ãã§ããã
- worker MPM(leader, threadpool MPMã§ãåæ§)ã§ã¯ãMaxClientsã¨ThreadsPerChildã®è¨å®ã§ 16ãµã¼ãããã»ã¹ (ããã©ã«ã) 以ä¸å¿ è¦ã«ãªãå ´åã«ã®ã¿ä½¿ç¨ãããå¸æã® MaxClientsã¨ThreadsPerChildã¨ããã¹ã¦ãå¿ è¦ã¨ãªããµã¼ãããã»ã¹æ°ä»¥ä¸ã«å¤§ããªå¤ãè¨å®ãããã¨ã¯é¿ãããã¤ã¾ãã以ä¸ã®é¢ä¿ã§æ大ãµã¼ãããã»ã¹æ°ãããã©ã«ãã®16ããã大ããå ´åã«è¨å®ããã®ãããã
MaxClients(ç·ã¹ã¬ããæ°) / ThreadsPerChild(1åããã»ã¹ãçæããã¹ã¬ããæ°) = æ大ãµã¼ãããã»ã¹æ°
-
- ThreadLimitã«ã¤ãã¦è£è¶³
- ThreadLimitã¨ã¯ã Apache ããã»ã¹ç¨¼åä¸ã«ãããThreadsPerChildã«è¨å®å¯è½ãªä¸éå¤ãè¨å®ããã
- åèµ·åæã«ãã®ãã£ã¬ã¯ãã£ãã®å¤ã å¤æ´ãã¦ãç¡è¦ããããã ThreadsPerChildã¯åèµ·åä¸ã«ããã®ãã£ã¬ã¯ãã£ãã§æå®ãããä¸éå¤ã¾ã§ å¤æ´ãããã¨ãã§ããã
- ThreadLimitãã£ã¬ã¯ãã£ãã使ç¨ããéã¯ç¹ã«æ³¨æãå¿ è¦ãThreadLimitãThreadsPerChild ããããã£ã¨å¤§ããªå¤ã«è¨å®ãããå ´åã¯ã ä½è¨ãªæªä½¿ç¨å ±æã¡ã¢ãªãå²ãå½ã¦ããã¦ãã¾ãã ThreadLimitãThreadsPerChild ã®ä¸¡æ¹ãã·ã¹ãã ã®æ±ããç¯å²ãè¶ ãã¦ããå ´åã¯ãApache ã¯èµ·åããªãããèµ·åããã¨ãã¦ãä¸å®å®ã«ãªãå ´åãããã ãã®ãã£ã¬ã¯ãã£ãã®å¤ã¯ä»ä½¿ç¨ãã¦ãã Apache ã® ThreadsPerChild ã®äºæ³ä¸éå¤ã è¶ ããå¤ã«ã¯è¨å®ãã¦ã¯ãããªããThreadLimit ã®ããã©ã«ãå¤ã¯ mpm_winnt ã®ã¨ã㯠1920 ã§ã ä»ã®å ´åã¯64ã
- ThreadLimitã«ã¤ãã¦è£è¶³
- ServerLimitãã£ã¬ã¯ãã£ãã使ç¨ããéã®æ³¨æç¹
- ServerLimit ãå¿ è¦ä»¥ä¸ã«å¤§ããªå¤ã« è¨å®ãããå ´åã¯ãä½è¨ãªæªä½¿ç¨å ±æã¡ã¢ãªãå²ãå½ã¦ããããServerLimit 㨠MaxClients ãã·ã¹ãã ã®æ±ããç¯å²ãè¶ããè¨å®å¤ã«ãªã£ã¦ããã¨ã Apache ã¯èµ·åããªãããèµ·åãã¦ãä¸å®å®ã«ãªãå ´åãããã
- perchild MPM ã§ã¯ã NumServers ã 8 (ããã©ã«ã) ããã大ããªå¤ã«è¨å®ããå¿ è¦ãããã¨ãã«ã®ã¿ä½¿ç¨ããã
ä¸è¨ãè²ã ã¨æ¸ããããµã³ãã«ãä¾ã«èª¬æããæ¹ãããããããã¨æãã®ã§ã以ä¸ã«ä¾ãè¼ããã
ãã®ä¾ã§ã¯ãæ¥ç¶å¯è½ãªãªã¯ã¨ã¹ãæ大æ°ã1500ã¨ãã¦ãããããåè¿°ã®ãã£ã¬ã¯ãã£ãå士ã®é¢ä¿ããããªã¯ã¨ã¹ãä¸éã¾ã§ã¢ã¯ã»ã¹ãéä¸ããå ´åã®åããã»ã¹æ°ã¯æ大ã§ã1500(MaxClients)/25(ThreadsPerChild)=60ããã»ã¹ãã¨ãªããããServerLimitãã£ã¬ã¯ãã£ãã®è¨å®å¤ã¯60ã¨ãªãããªããããã§ã¯ååããã»ã¹ãèµ·åããã¹ã¬ããæ°(ThreadsPerChild)ã¯ããã©ã«ãã®25ã®ã¾ã¾ã¨ãã¦ããããã®å¤ã64ããã大ããããå ´åã«ã¯ãThreadLimitãã£ã¬ã¯ãã£ãã使ç¨ããå¤ãã»ããããã
ServerLimit 60
StartServers 2
MaxClients 1500
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 1000