{"id":1378,"date":"2008-09-08T23:43:29","date_gmt":"2008-09-08T23:43:29","guid":{"rendered":"http:\/\/www.icocean.com\/blog\/?p=1378"},"modified":"1970-01-01T07:00:00","modified_gmt":"1970-01-01T07:00:00","slug":"windowsnt%E7%B3%BB%E7%BB%9F%E4%B8%8B%E7%9A%84apache%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=1378","title":{"rendered":"Windows NT\u7cfb\u7edf\u4e0b\u7684Apache\u6027\u80fd\u4f18\u5316"},"content":{"rendered":"<p>\u4e00\u822c\u6765\u8bf4\uff0cWinNT\u7cfb\u7edf\u4e0b\u4f7f\u7528IIS\uff0c\u800cApache\u5728Linux\u4e0b\u5e94\u7528\u7684\u6bd4\u8f83\u591a\uff0c\u4f46\u662f\u4f9d\u7136\u6709\u5f88\u591a\u4eba\u5728WinNT\u7cfb\u7edf\u4e0b\u4f7f\u7528Apache\u800c\u975eIIS\uff0c\u53ef\u80fd\u662f\u57fa\u4e8e\u5bf9Windows\u7cfb\u7edf\u7684\u719f\u6089\u5427\u3002\u4eca\u5929\u5c31\u6765\u8bf4\u4e00\u4e0b\u5728Windows\u7cfb\u7edf\u4e0b\u5982\u679c\u4f18\u5316Apache\u7684\u6027\u80fd\u3002<\/p>\n<p>mpm_winnt.c\u662f\u4e13\u95e8\u9488\u5bf9Windows NT\u4f18\u5316\u7684MPM(\u591a\u8def\u5904\u7406\u6a21\u5757)\uff0c\u5b83\u4f7f\u7528\u4e00\u4e2a\u5355\u72ec\u7684\u7236\u8fdb\u7a0b\u4ea7\u751f\u4e00\u4e2a\u5355\u72ec\u7684\u5b50\u8fdb\u7a0b\uff0c\u5728\u8fd9\u4e2a\u5b50\u8fdb\u7a0b\u8f6e\u6d41\u4ea7\u751f\u591a\u4e2a\u7ebf\u7a0b\u6765\u5904\u7406\u8bf7\u6c42\u3002\u4e5f\u5c31\u662f\u8bf4mpm_winnt\u53ea\u80fd\u542f\u52a8\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b, \u4e0d\u80fd\u50cfLinux\u4e0b\u90a3\u6837\u540c\u65f6\u542f\u52a8\u591a\u4e2a\u8fdb\u7a0b\u3002<\/p>\n<p>mpm_winnt\u4e3b\u8981\u901a\u8fc7ThreadsPerChild\u548cMaxRequestsPerChild\u4e24\u4e2a\u53c2\u6570\u6765\u4f18\u5316Apache\uff0c\u4e0b\u9762\u8be6\u7ec6\u6765\u8bf4\u660e\u4e00\u4e0b\u3002<\/p>\n<p>ThreadsPerChild<br \/>\u8fd9\u4e2a\u53c2\u6570\u7528\u4e8e\u8bbe\u7f6e\u6bcf\u4e2a\u8fdb\u7a0b\u7684\u7ebf\u7a0b\u6570, \u5b50\u8fdb\u7a0b\u5728\u542f\u52a8\u65f6\u5efa\u7acb\u8fd9\u4e9b\u7ebf\u7a0b\u540e\u5c31\u4e0d\u518d\u5efa\u7acb\u65b0\u7684\u7ebf\u7a0b\u4e86. \u4e00\u65b9\u9762\u56e0\u4e3ampm_winnt\u4e0d\u80fd\u542f\u52a8\u591a\u4e2a\u8fdb\u7a0b, \u6240\u4ee5\u8fd9\u4e2a\u6570\u503c\u8981\u8db3\u591f\u5927\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u5904\u7406\u53ef\u80fd\u7684\u8bf7\u6c42\u9ad8\u5cf0; \u53e6\u4e00\u65b9\u9762\u8be5\u53c2\u6570\u4ee5\u670d\u52a1\u5668\u7684\u54cd\u5e94\u901f\u5ea6\u4e3a\u51c6\u7684, \u6570\u76ee\u592a\u5927\u7684\u53cd\u800c\u4f1a\u53d8\u6162\u3002\u56e0\u6b64\u9700\u8981\u7efc\u5408\u5747\u8861\u4e00\u4e2a\u5408\u7406\u7684\u6570\u503c\u3002<\/p>\n<p>mpm_winnt\u4e0a\u7684\u9ed8\u8ba4\u503c\u662f64, \u6700\u5927\u503c\u662f1920. \u8fd9\u91cc\u5efa\u8bae\u8bbe\u7f6e\u4e3a100-500\u4e4b\u95f4\uff0c\u670d\u52a1\u5668\u6027\u80fd\u9ad8\u7684\u8bdd\u503c\u5927\u4e00\u4e9b\uff0c\u53cd\u4e4b\u503c\u5c0f\u4e00\u4e9b\u3002<\/p>\n<p>MaxRequestsPerChild<br \/>\u8be5\u53c2\u6570\u8868\u793a\u6bcf\u4e2a\u5b50\u8fdb\u7a0b\u80fd\u591f\u5904\u7406\u7684\u6700\u5927\u8bf7\u6c42\u6570, \u5373\u540c\u65f6\u95f4\u5185\u5b50\u8fdb\u7a0b\u6570\u76ee.\u8bbe\u7f6e\u4e3a\u96f6\u8868\u793a\u4e0d\u9650\u5236, mpm_winnt\u4e0a\u7684\u9ed8\u8ba4\u503c\u5c31\u662f0.<\/p>\n<p>\u65b9\u53c2\u8003\u624b\u518c\u4e2d\u4e0d\u5efa\u8bae\u8bbe\u7f6e\u4e3a0, \u4e3b\u8981\u57fa\u4e8e\u4e24\u70b9\u8003\u8651: (1) \u53ef\u4ee5\u9632\u6b62(\u5076\u7136\u7684)\u5185\u5b58\u6cc4\u6f0f\u65e0\u9650\u8fdb\u884c\uff0c\u4ece\u800c\u8017\u5c3d\u5185\u5b58; (2) \u7ed9\u8fdb\u7a0b\u4e00\u4e2a\u6709\u9650\u5bff\u547d\uff0c\u4ece\u800c\u6709\u52a9\u4e8e\u5f53\u670d\u52a1\u5668\u8d1f\u8f7d\u51cf\u8f7b\u7684\u65f6\u5019\u51cf\u5c11\u6d3b\u52a8\u8fdb\u7a0b\u7684\u6570\u91cf\u3002<!--more--><\/p>\n<p>\u6b64\u8fd9\u4e2a\u53c2\u6570\u7684\u503c\u66f4\u5927\u7a0b\u5ea6\u4e0a\u53d6\u51b3\u4e8e\u670d\u52a1\u5668\u7684\u5185\u5b58\uff0c\u5982\u679c\u5185\u5b58\u6bd4\u8f83\u5927\u7684\u8bdd\u53ef\u4ee5\u8bbe\u7f6e\u4e3a0\u6216\u5f88\u5927\u7684\u6570\u5b57\uff0c\u5426\u5219\u8bbe\u7f6e\u4e00\u4e2a\u5c0f\u7684\u6570\u503c\u3002\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u5982\u679c\u8fd9\u4e2a\u503c\u8bbe\u7f6e\u7684\u592a\u5c0f\u7684\u8bdd\u4f1a\u9020\u6210Apache\u9891\u7e41\u91cd\u542f\uff0c\u5728\u65e5\u5fd7\u6587\u4ef6\u4e2d\u4f1a\u770b\u5230\u5982\u4e0b\u7684\u6587\u5b57\uff1a<\/p>\n<p>Process exiting because it reached MaxRequestsPerChild. Signaling the parent<\/p>\n<p>\u8fd9\u6837\u4e00\u6765\u964d\u4f4e\u4e86Apache\u7684\u603b\u4f53\u6027\u80fd\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u53ef\u4ee5\u901a\u8fc7\u67e5\u770bApache\u63d0\u4f9b\u7684server-status(\u72b6\u6001\u62a5\u544a)\u6765\u9a8c\u8bc1\u5f53\u524d\u6240\u8bbe\u7f6e\u6570\u503c\u662f\u5426\u5408\u7406\uff0c\u5728httpd.conf\u6587\u4ef6\u4e2d\u505a\u5982\u4e0b\u8bbe\u7f6e\u6765\u6253\u5f00\u5b83\uff1a<\/p>\n<p># \u9996\u5148\u9700\u8981\u52a0\u8f7dmod_status\u6a21\u5757<br \/>LoadModule status_module modules\/mod_status.so<\/p>\n<p># \u7136\u540e\u8bbe\u7f6e\u8bbf\u95ee\u7684\u5730\u5740<br \/><Location \/server-status><br \/>&nbsp;&nbsp;&nbsp;&nbsp;SetHandler server-status<br \/>&nbsp;&nbsp;&nbsp;&nbsp;Order deny,allow<br \/>&nbsp;&nbsp;&nbsp;&nbsp;Deny from all<br \/>&nbsp;&nbsp;&nbsp;&nbsp;# \u5982\u679c\u9650\u5236\u67d0\u4e2aIP\u8bbf\u95ee\u5219\u8bbe\u7f6e\u4e3a Allow from 192.168.1.1<br \/>&nbsp;&nbsp;&nbsp;&nbsp;Allow from all<br \/><\/Location><\/p>\n<p>\u5408\u6765\u8bf4\uff0c\u56e0\u4e3aWindows NT\u4e0bApache\u53ea\u80fd\u542f\u52a8\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b\uff0c\u56e0\u6b64\u53ea\u80fd\u901a\u8fc7\u589e\u5927\u5355\u4e2a\u8fdb\u7a0b\u7684\u7ebf\u7a0b\u6570\u4ee5\u53ca\u5355\u4e2a\u8fdb\u7a0b\u80fd\u591f\u5904\u7406\u7684\u6700\u5927\u8bf7\u6c42\u6570\u6765\u8fdb\u884c\u4f18\u5316\u3002\u5176\u4ed6\u4f18\u5316\u7684\u53c2\u6570\u540cLinux\u7cfb\u7edf\u4e0b\u662f\u4e00\u6837\u7684\uff0c\u5927\u5bb6\u53ef\u4ee5\u52a0\u4ee5\u53c2\u8003\u3002\u4e0b\u9762\u9488\u5bf9\u4e0a\u8ff0\u4e24\u4e2a\u53c2\u6570\u7ed9\u51fa\u4e00\u4e2a\u5efa\u8bae\u7684\u8bbe\u7f6e\uff1a<\/p>\n<p><IfModule mpm_winnt.c><br \/>&nbsp;&nbsp;ThreadsPerChild 250<br \/>&nbsp;&nbsp;MaxRequestsPerChild 5000<br \/><\/IfModule><\/p>\n<p>\u8003\u8d44\u6599\uff1a<br \/>Apache\u53c2\u8003\u624b\u518c<br \/><a href=\"http:\/\/www.phpchina.com\/manual\/apache\/mod\/mod_status.html\" target=\"_blank\">Apache\u6a21\u5757 mod_status<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u822c\u6765\u8bf4\uff0cWinNT\u7cfb\u7edf\u4e0b\u4f7f\u7528IIS\uff0c\u800cApache\u5728Linux\u4e0b\u5e94\u7528\u7684\u6bd4\u8f83\u591a\uff0c\u4f46\u662f\u4f9d\u7136\u6709\u5f88\u591a\u4eba\u5728WinNT\u7cfb <a href='https:\/\/www.icocean.com\/blog\/?p=1378' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[638,608,392,1881],"class_list":["post-1378","post","type-post","status-publish","format-standard","hentry","category-lamp","tag-apache","tag-windows","tag-392","tag-1881","category-24-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1378"}],"version-history":[{"count":0,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1378\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}