---
title: "Apache并发连接数"
author: "脑壳冒星星"
date: "2014-11-04T17:27:56Z"
tags: []
categories: ["开源软件"]
slug: "apache"
draft: false
lastmod: "2014-11-04T17:27:56Z"
id: 2152340
url: "https://ethan-li.iteye.com/blog/2152340"
---

```
可以使用以下参数配置Apache的并发连接数：

<IfModule prefork.c>
  StartServers            8
  MinSpareServers         5
  MaxSpareServers        20
  MaxClients            150
  MaxRequestsPerChild  1000
</IfModule>

<IfModule worker.c>
  StartServers            2
  MaxClients            150
  MinSpareThreads        25
  MaxSpareThreads        75 
  ThreadsPerChild        25
  MaxRequestsPerChild     0
</IfModule>

<IfModule mpm_winnt.c>
  ThreadsPerChild       250
  MaxRequestsPerChild     0
</IfModule>

对于Windows系统，缺省会使用mpm_winnt，配置中有用的是第三段，即：
<IfModule mpm_winnt.c>
  ThreadsPerChild       250
  MaxRequestsPerChild     0
</IfModule>

具体含义可参考Apache的官方文档：
http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadsperchild
```