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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - flashicp

一个购物分享网站核心源码分析 ECSHOP读写分离配置与改造(转载) - flashicp 多年没有管理的技术博客了,即日起开始管理起技术博客 c# WebBrowser网页操作-元素获取_事件操作 - flashicp zend framework多模块多布局配置 c# office不同版本下中使用Excel - flashicp 目录下的文件 - 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,限制单个进程的线程总数。