1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
4 <!-- English Revision: 420990:1021924 (outdated) -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="prefork.xml.meta">
26 <description>スレッドを使わず、先行して fork を行なうウェブサーバを実装
29 <sourcefile>prefork.c</sourcefile>
30 <identifier>mpm_prefork_module</identifier>
33 <p>このマルチプロセッシングモジュール (MPM) は、
34 Unix 上での Apache 1.3 のデフォルトの挙動と非常によく似た方法で
35 リクエストを処理する、スレッドを使わず、先行して fork を行なう
37 スレッドセーフでないライブラリとの互換性をとるために、
38 スレッドを避ける必要のあるサイトでは、このモジュールの使用が適切でしょう。
39 あるリクエストで発生した問題が他のリクエストに影響しないように、
40 個々のリクエストを単離するのにも、最適な MPM です。</p>
42 <p>この MPM は非常に自律的なので、この MPM の設定ディレクティブを
43 調整する必要はほとんどないでしょう。もっとも重要なことは、
44 <directive module="mpm_common">MaxClients</directive>
45 が、予想される同時リクエスト数を十分扱えるぐらいは大きいけれども、
46 全プロセスに十分な物理メモリが確実に行き渡る程度には小さい値にする、
50 <seealso><a href="../bind.html">Apache
51 が使用するアドレスとポートの設定</a></seealso>
53 <section id="how-it-works"><title>動作方法</title>
55 コネクションに対して listen して、しかるべき時に応答する
56 子プロセスを起動します。Apache は常に幾つかの<dfn>スペア</dfn>
57 かアイドルなサーバプロセスを維持していて、それらは入ってきた
58 リクエストに応答できるように待機しています。
59 このようにしてクライアントは、リクエストが応答される前に、
60 新しい子プロセスが fork されるのを待たなくてもよいように
63 <p>親プロセスがリクエストに応答するの子プロセスを
65 <directive module="mpm_common">StartServers</directive>,
66 <directive module="prefork">MinSpareServers</directive>,
67 <directive module="prefork">MaxSpareServers</directive>,
68 <directive module="mpm_common">MaxClients</directive>
69 で調整します。一般的に、Apache は非常に自律的なので、
70 大抵のサイトではこれらのディレクティブをデフォルト値から調整する
72 同時に 256 を超えるリクエストに応答しないといけないサイトでは、
73 <directive module="mpm_common">MaxClients</directive>
75 一方、メモリの限られているサイトでは、スラッシング
76 (メモリとディスク間で何度もスワップ) が起こるのを防ぐために
77 <directive module="mpm_common">MaxClients</directive>
78 を減らす必要があるでしょう。プロセス生成のチューニングに関する
80 href="../misc/perf-tuning.html">性能に関するヒント</a>
83 <p>通常 Unix では親プロセスは 80 番ポートにバインドするために
84 <code>root</code> で起動されますが、子プロセスやスレッドは
85 もっと低い権限のユーザで Apache によって起動されます。
86 <directive module="mpm_common">User</directive> と
87 <directive module="mpm_common">Group</directive>
89 Apache の子プロセスの権限を設定するのに用いられます。
90 子プロセスはクライアントに送るコンテンツ全てを読めないといけませんが、
91 可能な限り必要最小限の権限のみを持っているようにするべきです。</p>
93 <p><directive module="mpm_common">MaxRequestsPerChild</directive>
94 は、古いプロセスを停止して新しいプロセスを起動することによって、
95 どの程度の頻度でサーバがプロセスをリサイクルするかを制御します。</p>
98 <directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
100 <directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
102 <directivesynopsis location="mpm_common"><name>PidFile</name>
104 <directivesynopsis location="mpm_common"><name>Listen</name>
106 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
108 <directivesynopsis location="mpm_common"><name>LockFile</name>
110 <directivesynopsis location="mpm_common"><name>MaxClients</name>
112 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
114 <directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
116 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
118 <directivesynopsis location="mpm_common"><name>ReceiveBufferSize</name>
120 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
122 <directivesynopsis location="mpm_common"><name>ServerLimit</name>
124 <directivesynopsis location="mpm_common"><name>StartServers</name>
126 <directivesynopsis location="mpm_common"><name>User</name>
128 <directivesynopsis location="mpm_common"><name>Group</name>
130 <directivesynopsis location="mpm_common"><name>AcceptMutex</name>
134 <name>MaxSpareServers</name>
135 <description>アイドルな子サーバプロセスの最大個数</description>
136 <syntax>MaxSpareServers <var>number</var></syntax>
137 <default>MaxSpareServers 10</default>
138 <contextlist><context>server config</context></contextlist>
141 <p><directive>MaxSpareServers</directive> ディレクティブは、
142 <em>アイドルな</em>子サーバプロセスの希望最大個数を設定します。
143 アイドルプロセスとは、リクエストを扱っていないプロセスです。
144 <directive>MaxSpareServers</directive> よりも多い数がアイドルであれば、
145 親プロセスは超過プロセスを kill します。</p>
147 <p>非常に混んでいるサイトでのみ、このパラメータをチューニングするべきです。
148 このパラメータを大きくするということは、大抵の場合は悪い発想です。
149 <directive module="prefork">MinSpareServers</directive>
150 以下に設定した場合、<directive>MinSpareServers</directive>
151 <code>+1</code> に自動調整されます。</p>
153 <seealso><directive module="prefork">MinSpareServers</directive></seealso>
154 <seealso><directive module="mpm_common">StartServers</directive></seealso>
158 <name>MinSpareServers</name>
159 <description>アイドルな子サーバプロセスの最小個数</description>
160 <syntax>MinSpareServers <var>number</var></syntax>
161 <default>MinSpareServers 5</default>
162 <contextlist><context>server config</context></contextlist>
165 <p><directive>MaxSpareServers</directive> ディレクティブは、
166 <em>アイドルな</em>子サーバプロセスの希望最小個数を設定します。
167 アイドルプロセスとは、リクエストを扱っていないプロセスです。
168 <directive>MinSpareServers</directive> よりも少ない数がアイドルであれば、
169 親プロセスは最高で 1 秒につき 1 個の割合で新しい子プロセスを生成します。</p>
171 <p>非常に混んでいるサイトでのみ、このパラメータをチューニングするべきです。
172 このパラメータを大きくするということは、大抵の場合は悪い発想です。</p>
174 <seealso><directive module="prefork">MaxSpareServers</directive></seealso>
175 <seealso><directive module="mpm_common">StartServers</directive></seealso>