惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
L
LangChain Blog
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
F
Full Disclosure
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
G
Google Developers Blog
C
Check Point Blog
GbyAI
GbyAI
A
About on SuperTechFans
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
T
Tor Project blog
AWS News Blog
AWS News Blog
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
MongoDB | Blog
MongoDB | Blog
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
U
Unit 42
Y
Y Combinator Blog
P
Privacy International News Feed
Cisco Talos Blog
Cisco Talos Blog
S
Securelist
S
Schneier on Security
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
P
Proofpoint News Feed
C
Cisco Blogs
Webroot Blog
Webroot Blog
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
Cloudbric
Cloudbric
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog

博客园 - flashicp

一个购物分享网站核心源码分析 ECSHOP读写分离配置与改造(转载) - flashicp 多年没有管理的技术博客了,即日起开始管理起技术博客 c# WebBrowser网页操作-元素获取_事件操作 zend framework多模块多布局配置 c# office不同版本下中使用Excel 目录下的文件 - flashicp - 博客园 中秋 国庆 最近在忙项目,好久不来 转 :如何提高自己的编程水平 衣物去污指南 转 洗衣小窍门集锦 牙膏的妙用 转 家居小窍门 (二) 转 家居小窍门 (一) 转 --有些事情需要注意 WinForm的App.config 保存我的操作日志 关于sql server表名 和字段的一点操作
Apache里的 MPM 调优比较详细
flashicp · 2012-06-11 · via 博客园 - flashicp

1、什么是MPM?
Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server。(多进程、多线程)

2、有多少种MPM?
大致有:prefork MPM、worker MPM、BeOS MPM、NetWare MPM、OS/2 MPM、WinNT MPM。   

3、怎么知道apache当前用的是哪个MPM?
linux及windows下都可以使用命令:“httpd -l ” 进行查询。

4、各个MPM是怎么工作及如何优化?
(1)prefork MPM
        <IfModule mpm_prefork_module>
            StartServers                10
            MinSpareServers        10
            MaxSpareServers        15
            ServerLimit                  2000
            MaxClients                   1000
            MaxRequestsPerChild 10000
        </IfModule>
        启动时建立StartServers个子进程,
        然后按每秒创建指数级个进程直到达到MinSpareServers个进程(最多增到每秒32个),
        如果空闲进程数大于MaxSpareServers,则检查kill掉一些空闲进程。
        MaxRequestPerChild指定每个进程处理了多少个请求后就自我毁灭。
        MaxClients指定apache最多可以同时处理的请求数,也就是进程数?
        MaxClients默认不能大于256,可以通过设定ServerLimit来增大这个限制数,最大20000?

(2)worker:
        <IfModule mpm_worker_module>
            StartServers                  3
            MaxClients                     2000
            ServerLimit                    25
            ThreadLimit                   200
            ThreadsPerChild            100
            MinSpareThreads         50
            MaxSpareThreads        200
            MaxRequestsPerChild   0
        </IfModule>
        启动时建立StartServers个子进程,
        每个进程包含ThreadsPerChild个线程,缺省最大64
        MinSpareThreads定义最小的空闲线程数,最大75
        MaxSpareThreads定义最大的空闲线程数,超过则执行清理?最大250
        MaxClients定义所有子进程中的线程总数
        ThreadLimit,最大20000,默认64
        ServerLimit,最大值20000,默认16
        需要注意的是,如果显式声明了ServerLimit,那么它乘以ThreadsPerChild的值必须大于等于MaxClients,而且 MaxClients必须是ThreadsPerChild的整数倍,否则Apache将会自动调节到一个相应值(可能是个非期望值)。

(3)WinNT MPM:
        <IfModule mpm_winnt_module>
            ThreadsPerChild         500
            MaxRequestsPerChild 10000
        </IfModule>
        mpm_winnt.c是专门针对Windows NT优化的MPM(多路处理模块),它使用一个单独的父进程产生一个单独的子进程,在这个子进程中轮流产生多个线程来处理请求。也就是说 mpm_winnt只能启动父子两个进程, 不能像Linux下那样同时启动多个进程。
ThreadLimit,默认1920,最大15000,限制单个进程的线程总数。