1<?xml version="1.0" encoding="EUC-KR"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head><!--
4        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5              This file is generated from xml source: DO NOT EDIT
6        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7      -->
8<title>����ġ ������� - Apache HTTP Server</title>
9<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
12<script src="/style/scripts/prettify.min.js" type="text/javascript">
13</script>
14
15<link href="/images/favicon.ico" rel="shortcut icon" /></head>
16<body id="manual-page"><div id="page-header">
17<p class="menu"><a href="/mod/">���</a> | <a href="/mod/directives.html">���þ��</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">���</a> | <a href="/sitemap.html">����Ʈ��</a></p>
18<p class="apache">Apache HTTP Server Version 2.4</p>
19<img alt="" src="/images/feather.gif" /></div>
20<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
21<div id="path">
22<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.4</a> &gt; <a href="./">Miscellaneous Documentation</a></div><div id="page-content"><div id="preamble"><h1>����ġ �������</h1>
23<div class="toplang">
24<p><span>������ ���: </span><a href="/en/misc/perf-tuning.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
25<a href="/fr/misc/perf-tuning.html" hreflang="fr" rel="alternate" title="Fran&#231;ais">&nbsp;fr&nbsp;</a> |
26<a href="/ko/misc/perf-tuning.html" title="Korean">&nbsp;ko&nbsp;</a> |
27<a href="/tr/misc/perf-tuning.html" hreflang="tr" rel="alternate" title="T&#252;rk&#231;e">&nbsp;tr&nbsp;</a></p>
28</div>
29<div class="outofdate">�� ������ �ֽ��� ���� �ƴմϴ�.
30            �ֱٿ� ����� ������ ���� ������ ����ϼ���.</div>
31
32
33    <p>����ġ 2.0�� ��ɰ� ���ð��ɼ��� ������ ������ �µ���
34    ������ ��� �������̴�. ��ġ��ũ ����� ��������� ��������
35    �ʾ����� ����ġ 2.0�� ���� ���� ��� ���� ������ ����.</p>
36
37    <p>����ġ 1.3�� ���ؼ� 2.0 ������ ó������ Ȯ�强(scalability)��
38    ���̱����� ���� ����ȭ�� �ߴ�. �⺻������ ��κ� ����ȭ��
39    ���� ����Ѵ�. �׷��� �����Ͻ� Ȥ�� ����� ������ ���ɿ�
40    ū ������ �� �� �ִ�. �� ������ ����ġ 2.0�� ������ ����ϱ�����
41    ���� ���ڰ� ������ �� �ִ� �ɼ��� �����Ѵ�. � ����
42    �ɼ��� �������� �ϵ����� �ü���� ����� �� �� Ȱ���ϵ���
43    �ϴ� �ݸ�, � �ɼ��� �ӵ��� ���� ����� ����Ѵ�.</p>
44
45  </div>
46<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#hardware">�ϵ����� �ü���� ���ؼ�</a></li>
47<li><img alt="" src="/images/down.gif" /> <a href="#runtime">����� ������ ���ؼ�</a></li>
48<li><img alt="" src="/images/down.gif" /> <a href="#compiletime">�����Ͻ� ������ ���ؼ�</a></li>
49<li><img alt="" src="/images/down.gif" /> <a href="#trace">�η�: �ý���ȣ�� ����� �ڼ��� �м��ϱ�</a></li>
50</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
51<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
52<div class="section">
53<h2><a name="hardware" id="hardware">�ϵ����� �ü���� ���ؼ�</a></h2>
54
55    
56
57    <p>������ ���ɿ� ���� ū ������ �ִ� ���� �޸���. ������
58    ��û�� �����ð��� ����ڰ� "����� ��ٰ�" ������ ���ϰ�
59    �ø��⶧���� �������� ������ �ϸ� �ȵȴ�. �������� ����ڴ�
60    �����ϰ� �ٽ� �����Ͽ� ���ϰ� ��� �����Ѵ�. <code class="directive"><a href="/mod/mpm_common.html#maxclients">MaxClients</a></code> ���þ �����Ͽ�
61    �������� ������ �� ������ ���� �ڽ��� �������ʵ��� �ؾ�
62    �Ѵ�. ����� �����ϴ�: <code>top</code>�� ���� ��������
63    ���μ��� ����� ���� ����ġ ���μ����� ��� �޸� ��뷮��
64    �˾Ƴ���, ��ü ��밡���� �޸����� �ٸ� ���μ������� �����
65    ���� �� ������ ������.</p>
66
67    <p>�������� ����ϴ�: ����� �� CPU, ����� �� ��Ʈ��ī��,
68    ����� �� ��ũ, ���⼭ "����� ��"�� ������ �ؼ� �����ؾ�
69    �Ѵ�.</p>
70
71    <p>�ü���� ���� ���� �˾Ƽ� ������ ���̴�. �׷��� �Ϲ�������
72    �����ϴٰ� �Ǹ�� ��� ��ħ�� �ִ�:</p>
73
74    <ul>
75      <li>
76        <p>������ �ü���� �ֽ� ���� ����� ��ġ�� �����Ѵ�.
77        ���� �ü�� ���ۻ�� �ֱ� TCP ���ð� ������ ���̺귯����
78        ���� �ӵ������ �ߴ�.</p>
79      </li>
80
81      <li>
82        <p>�ü���� <code>sendfile(2)</code> �ý���ȣ����
83        �����Ѵٸ�, �̸� ����ϱ����� �����̳� ��ġ�� ��ġ�Ͽ�����
84        Ȯ���Ѵ�. (���� ���, ��������� 2.4 �̻� ������ ���Ѵ�.
85        Solaris 8 �ʱ� ������ ��ġ�� �ʿ��ϴ�.) �����ϴ� �ý����̶��
86        ����ġ 2�� <code>sendfile</code>�� ����Ͽ� CPU�� ��
87        ����ϸ� ���� ������ �� ���� ����� �� �մ�.</p>
88      </li>
89    </ul>
90
91  </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
92<div class="section">
93<h2><a name="runtime" id="runtime">����� ������ ���ؼ�</a></h2>
94
95    
96
97    <table class="related"><tr><th>��õ� ���</th><th>��õ� ���þ�</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code></li><li><code class="module"><a href="/mod/mpm_common.html">mpm_common</a></code></li><li><code class="module"><a href="/mod/mod_status.html">mod_status</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="/mod/mod_dir.html#directoryindex">DirectoryIndex</a></code></li><li><code class="directive"><a href="/mod/core.html#hostnamelookups">HostnameLookups</a></code></li><li><code class="directive"><a href="/mod/core.html#enablemmap">EnableMMAP</a></code></li><li><code class="directive"><a href="/mod/core.html#enablesendfile">EnableSendfile</a></code></li><li><code class="directive"><a href="/mod/core.html#keepalivetimeout">KeepAliveTimeout</a></code></li><li><code class="directive"><a href="/mod/prefork.html#maxspareservers">MaxSpareServers</a></code></li><li><code class="directive"><a href="/mod/prefork.html#minspareservers">MinSpareServers</a></code></li><li><code class="directive"><a href="/mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="/mod/mpm_common.html#startservers">StartServers</a></code></li></ul></td></tr></table>
98
99    <h3><a name="dns" id="dns">HostnameLookups�� DNS�� ���� ����� ����</a></h3>
100
101      
102
103      <p>����ġ 1.3 ���� <code class="directive"><a href="/mod/core.html#hostnamelookups">HostnameLookups</a></code>�� �⺻����
104      <code>On</code>�̿���. ��û�� ��ġ���� DNS �˻��� ������
105      �ϹǷ� ��û���� ������ ����. ����ġ 1.3���� �� ������
106      �⺻���� <code>Off</code>�� ����Ǿ��. �α������� �ּҸ�
107      ȣ��Ʈ������ ��ȯ�Ϸ��� ���� �α�ó�� ���α׷��� �ϳ���,
108      ����ġ�� ���Ե� <a href="/programs/logresolve.html"><code>logresolve</code></a>
109      ���α׷��� ����϶�.</p>
110
111      <p>�α�ó�� �۾��� ���� ���ɿ� �ǿ����� ��ġ�Ƿ� ����
112      ����ϴ� �������� �ƴ� �ٸ� ��ǻ�Ϳ��� �α������� ��ó���ϱ�
113      �ٶ���.</p>
114
115      <p><code><code class="directive"><a href="/mod/mod_access.html#allow">Allow</a></code>
116      from domain</code>�̳� <code><code class="directive"><a href="/mod/mod_access.html#deny">Deny</a></code> from domain</code>
117      ���þ ����Ѵٸ� (��, IP �ּҰ� �ƴ� ȣ��Ʈ���̳� �����θ���
118      ����Ѵٸ�) �ε��� �ߺ�-�� DNS �˻��� (���˻��� ���� ���Ƿ�
119      ����Ǿ���� Ȯ���ϱ����� �ٽ� �˻�) �ؾ� �Ѵ�. �׷��Ƿ�
120      ������ ���̱����� �̷� ���þ�� �����ϸ� �̸���� IP
121      �ּҸ� ����Ѵ�.</p>
122
123      <p><code>&lt;Location /server-status&gt;</code> ���� ������
124      ���þ��� �������� ������ �� ������ ����϶�. �� ���
125      ���ǿ� �´� ��û���� DNS ��ȸ�� �Ѵ�. ������
126      <code>.html</code>�� <code>.cgi</code> ���ϸ� DNS �˻���
127      �ϴ� ������:</p>
128
129      <div class="example"><p><code>
130        HostnameLookups off<br />
131        &lt;Files ~ "\.(html|cgi)$"&gt;<br />
132        <span class="indent">
133          HostnameLookups on<br />
134        </span>
135        &lt;/Files&gt;
136      </code></p></div>
137
138      <p>�׷��� CGI���� DNS���� �ʿ��� ���̶��, �ʿ��� Ư��
139      CGI������ <code>gethostbyname</code> ȣ���� �ϵ��� ����غ�
140      �� �ִ�.</p>
141
142    
143
144    <h3><a name="symlinks" id="symlinks">FollowSymLinks�� SymLinksIfOwnerMatch</a></h3>
145
146      
147
148      <p>URL ���� <code>Options FollowSymLinks</code>��
149      ��������ʰ� <code>Options SymLinksIfOwnerMatch</code>��
150      ����ϸ� ����ġ�� �ɺ���ũ�� �˻��ϱ����� �ý���ȣ����
151      �ѹ� �� �ؾ� �Ѵ�. ���ϸ��� �� �κи��� �ѹ� �� ȣ����
152      �Ѵ�. ���� ���, ������ ������ ����:</p>
153
154      <div class="example"><p><code>
155        DocumentRoot /www/htdocs<br />
156        &lt;Directory /&gt;<br />
157        <span class="indent">
158          Options SymLinksIfOwnerMatch<br />
159        </span>
160        &lt;/Directory&gt;
161      </code></p></div>
162
163      <p><code>/index.html</code> URI�� ���� ��û�� �ִٰ� ��������.
164      �׷��� ����ġ�� <code>/www</code>, <code>/www/htdocs</code>,
165      <code>/www/htdocs/index.html</code> ������ ����
166      <code>lstat(2)</code>�� ȣ���Ѵ�. <code>lstats</code>
167      ��� ij������ �ʱ⶧���� ��û�� ���� ������ �Ź� ����
168      �۾��� �Ѵ�. ��¥ �ɺ���ũ ���� �˻縦 ���Ѵٸ� ������
169      ���� �� �� �ִ�:</p>
170
171      <div class="example"><p><code>
172        DocumentRoot /www/htdocs<br />
173        &lt;Directory /&gt;<br />
174        <span class="indent">
175          Options FollowSymLinks<br />
176        </span>
177        &lt;/Directory&gt;<br />
178        <br />
179        &lt;Directory /www/htdocs&gt;<br />
180        <span class="indent">
181          Options -FollowSymLinks +SymLinksIfOwnerMatch<br />
182        </span>
183        &lt;/Directory&gt;
184      </code></p></div>
185
186      <p>�� ��� �ּ��� <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code> ��δ� �˻�����
187      �ʴ´�. DocumentRoot �ۿ� �ִ� ��η� <code class="directive"><a href="/mod/mod_alias.html#alias">Alias</a></code>�� <code class="directive"><a href="/mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>�� �����
188      ��쿡�� ���� ����� ������ �ʿ��ϴ�. �ɺ���ũ ������
189      ������� �ʰ� �ְ��� ������ ��������,
190      <code>FollowSymLinks</code>�� �����ϰ�,
191      <code>SymLinksIfOwnerMatch</code>�� ���� �ȵȴ�.</p>
192
193    
194
195    <h3><a name="htaccess" id="htaccess">AllowOverride</a></h3>
196
197      
198
199      <p>URL ���� overrides�� ����Ѵٸ� (����
200      <code>.htaccess</code> ����) ����ġ�� ���ϸ��� �� �κи���
201      <code>.htaccess</code>�� ���� �õ��Ѵ�. ���� ���,</p>
202
203      <div class="example"><p><code>
204        DocumentRoot /www/htdocs<br />
205        &lt;Directory /&gt;<br />
206        <span class="indent">
207          AllowOverride all<br />
208        </span>
209        &lt;/Directory&gt;
210      </code></p></div>
211
212      <p><code>/index.html</code> URI�� ���� ��û�� �ִٰ� ��������.
213      ����ġ�� <code>/.htaccess</code>, <code>/www/.htaccess</code>,
214      <code>/www/htdocs/.htaccess</code>�� ������ �õ��Ѵ�.
215      �ذ�å�� ���� <code>Options FollowSymLinks</code> ����
216      ����ϴ�. �ְ��� ������ �������� ���Ͻý��ۿ� ���ؼ� �׻�
217      <code>AllowOverride None</code>�� ����Ѵ�.</p>
218
219    
220
221    <h3><a name="negotiation" id="negotiation">�������</a></h3>
222
223      
224
225      <p>�����ϰ� ��¥ ������ ��������� ����� �ִٸ� ���������
226      ���´�. ������ ����� �̵��� �������Ϻ��� �۴�. ������
227      ��� �� �� �ִ�. ������ ���� ���ϵ�ī�带 ����ϴ� ���:</p>
228
229      <div class="example"><p><code>
230        DirectoryIndex index
231      </code></p></div>
232
233      <p>������ ����� ����Ѵ�:</p>
234
235      <div class="example"><p><code>
236        DirectoryIndex index.cgi index.pl index.shtml index.html
237      </code></p></div>
238
239      <p>���� ���� ���� �տ� �д�.</p>
240
241      <p>��, ���丮���� ���ϵ��� ã�� <code>MultiViews</code>
242      ���ٴ�, �� ���ϸ� ������ �ʿ��� ������ ���� �� �ִ�
243      <code>type-map</code> ������ ���� ����� ���� �� ����
244      ����϶�.</p>
245
246    <p>����Ʈ�� ��������� �ʿ��ϴٸ� ����� ���� <code>Options
247    MultiViews</code> ���þ ����ϱ⺸�� <code>type-map</code>
248    ������ ����϶�. ����� ���� �ڼ��� �����
249    <code>type-map</code> ������ ����� ����� <a href="/content-negotiation.html">�������</a> ������ ����϶�.</p>
250
251    
252
253    <h3>�޸����� (memory-mapping)</h3>
254
255      
256
257      <p>���� ���, server-side-include�� ó���ϴ� �� ����ġ
258      2.0�� ����� ������ ������ �ü���� <code>mmap(2)</code>
259      ���� �����Ѵٸ� ������ �޸������Ѵ�.</p>
260
261      <p>���� �÷��� �޸������� ������ ����Ѵ�. �׷���
262      �޸������� ������ ������ ����Ʈ���� ������ ��������
263      ��ġ�� ��찡 �ִ�:</p>
264
265      <ul>
266        <li>
267          <p>� �ü������ <code>mmap</code>�� CPU ������
268          ������ <code>read(2)</code> ��ŭ Ȯ�强�� ���� �ʴ�.
269          ���� ���, �������μ��� Solaris �������� ����ġ 2.0��
270          ���� <code>mmap</code>�� ������� ������ ������ ��
271          ������ �� ���� ����Ѵ�.</p>
272        </li>
273
274        <li>
275          <p>NFS ����Ʈ�� ���Ͻý��ۿ� �ִ� ������ �޸������ϴ�
276          ���߿� �ٸ� NFS Ŭ���̾�Ʈ�� �ִ� ���μ����� ������
277          ����ų� ����ũ�⸦ ���̸�, ������ ���μ����� ����
278          �� �޸������� ���ϳ����� ������ bus error�� �߻���
279          �� �ִ�.</p>
280        </li>
281      </ul>
282
283      <p>���� ���ǿ� �ش��ϸ� ����ϴ� ������ �޸���������
284      �ʵ��� <code>EnableMMAP off</code>�� ����ؾ� �Ѵ�. (����:
285      �� ���þ�� ���丮���� ������ �� �ִ�.)</p>
286
287    
288
289    <h3>Sendfile</h3>
290
291      
292
293      <p>����ġ�� �ü���� <code>sendfile(2)</code>�� �����ϸ�
294      Ŀ�� sendfile�� ����Ͽ� -- ���� ���, ���� ������ �����Ҷ�
295      -- ����� ������ ���� �������� �� �ִ�.</p>
296
297      <p>���� �÷��� sendfile�� ����ϸ� read�� send�� ���
298      �� �ʿ䰡 �� �������. �׷��� sendfile�� ����ϸ�
299      �������� �������� ��ġ�ԵǴ� ��찡 �ִ�:</p>
300
301      <ul>
302        <li>
303          <p>sendfile ������ �߸�Ǿ�� ������ �ý����� ������
304          �߰����� ���ϴ� �÷����� �ִ�. Ư�� �ٸ� ��ǻ�Ϳ���
305          ���������� �������Ͽ� sendfile ������ �߸�� ��ǻ�ͷ�
306          ������ ��쿡 �����ϴ�.</p>
307        </li>
308        <li>
309          <p>Ŀ���� �ڽ��� ij���� ����Ͽ� NFS�� ����Ʈ�� ������
310          ���������� ������ �� ��� ��찡 �ִ�.</p>
311        </li>
312      </ul>
313
314      <p>���� ���ǿ� �ش��ϸ� ������ sendfile ������� �ʵ���
315      <code>EnableSendfile off</code>�� ����ؾ� �Ѵ�. (����:
316      �� ���þ�� ���丮���� ������ �� �ִ�.)</p>
317
318    
319
320    <h3><a name="process" id="process">����� ��</a></h3>
321
322      
323
324      <p>����ġ 1.3 ����� <code class="directive"><a href="/mod/prefork.html#minspareservers">MinSpareServers</a></code>, <code class="directive"><a href="/mod/prefork.html#maxspareservers">MaxSpareServers</a></code>, <code class="directive"><a href="/mod/mpm_common.html#startservers">StartServers</a></code> ������ ���
325      ��ġ��ũ ��� ū ������ ���ƴ�. Ư�� ����ġ�� �۾���
326      �����ϱ����� ����� �ڽļ��� �ٴٸ� ������ "����" �Ⱓ��
327      �ʿ��ߴ�. ó�� <code class="directive"><a href="/mod/mpm_common.html#startservers">StartServers</a></code>�� �ڽ���
328      ������, <code class="directive"><a href="/mod/prefork.html#minspareservers">MinSpareServers</a></code>
329      ���������� �ʴ� �ڽ��� �ϳ��� ������. �׷��� <code class="directive"><a href="/mod/mpm_common.html#startservers">StartServers</a></code> �⺻����
330      <code>5</code>�� ������ Ŭ���̾�Ʈ 100���� ���ÿ� �����ϸ�
331      ���ϸ� ó���ϱ⿡ ����� �ڽ��� �������� 95�ʰ� �ɷȴ�.
332      ���� ��������� �ʴ� ���� ���������� �� ����������, 10�а���
333      �����ϴ� ��ġ��ũ ���� �ſ� ���ڰ� ���´�.</p>
334
335      <p>�ʴ� �Ѱ� ��Ģ�� �ڽ��� ���� �����ϸ鼭 ������ ������
336      ���� �������� ���ߴ�. ��ǻ�Ͱ� �ڽ��� �����ϴ��� �ٻڸ�
337      ��û�� ������ �� ���. �׷��� �� ��Ģ�� ����ġ�� ü��
338      ���ɿ� �ǿ����� �־� �����Ͽ���. ����ġ 1.3���� �ʴ� �Ѱ�
339      ��Ģ�� ��ȭ�Ǿ��. �ڵ�� �ڽ� �Ѱ��� �����, 1�� ����,
340      �ΰ��� �����, 1�� ����, �װ��� �����, �̷� ������ �ʴ�
341      �ڽ��� 32�� ���鶧���� ������ �����Ѵ�. �ڽļ��� <code class="directive"><a href="/mod/prefork.html#minspareservers">MinSpareServers</a></code> ������ �ٴٸ���
342      ������ �ߴ��Ѵ�.</p>
343
344      <p>�� ��� �����ӵ��� �������� <code class="directive"><a href="/mod/prefork.html#minspareservers">MinSpareServers</a></code>, <code class="directive"><a href="/mod/prefork.html#maxspareservers">MaxSpareServers</a></code>, <code class="directive"><a href="/mod/mpm_common.html#startservers">StartServers</a></code>�� ���� ������ �ʿ䰡 ���. ���ʿ�
345      �ڽ��� 4�� �̻� ���ϸ� <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code>�� ����Ѵ�. �̷� ������
346      ���� ���̸� �� �������� �����ϱ� �ٶ���.
347      <code class="module"><a href="/mod/mod_status.html">mod_status</a></code> ��� ������ �� ���̴�.</p>
348
349    <p>���μ��� ��� ����Ͽ� <code class="directive"><a href="/mod/mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></code> ������
350    ���μ����� �����Ѵ�. �⺻���� �ڽĴ� ó���� ��û���� ������
351    ��ٴ� <code>0</code>�̴�. ���� ������ <code>30</code>��
352    ���� �ſ� ���� ������ �������ִٸ�, ���� ����� ���� �ʿ䰡
353    �ִ�. SunOS�� ������ Solaris ������ ����Ѵٸ�, �޸����⶧����
354    �� ���� <code>10000</code> ������ �����϶�.</p>
355
356    <p>��������(keep-alive)�� ����Ѵٸ� �ڽĵ��� �̹� ����
357    ���ῡ�� �߰� ��û�� ��ٸ��� �ƹ��͵� �����ʱ⶧���� ���
358    �ٻڴ�. <code class="directive"><a href="/mod/core.html#keepalivetimeout">KeepAliveTimeout</a></code>��
359    �⺻�� <code>15</code> �ʴ� �̷� ������ �ּ�ȭ�Ѵ�. ��Ʈ��
360    �뿪��� ���� �ڿ� ���� ������ �°� �����Ѵ�. <a href="http://www.research.digital.com/wrl/techreports/abstracts/95.4.html">
361    ���������� ��κ��� ������ ������⶧����</a> � ��쿡��
362    �� ���� <code>60</code> �� �̻����� �ø��� ����.</p>
363
364    
365
366  </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
367<div class="section">
368<h2><a name="compiletime" id="compiletime">�����Ͻ� ������ ���ؼ�</a></h2>
369
370    
371
372    <h3>MPM ����</h3>
373
374      
375
376      <p>����ġ 2.x�� <a href="/mpm.html">����ó�����</a>
377      (MPMs)�̶�� ��ü�� �� �ִ� ����ȭ ���� �����Ѵ�. ����ġ��
378      �������Ҷ� MPM�� �����ؾ� �Ѵ�. <code class="module"><a href="/mod/beos.html">beos</a></code>,
379      <code class="module"><a href="/mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="/mod/mpmt_os2.html">mpmt_os2</a></code>,
380      <code class="module"><a href="/mod/mpm_winnt.html">mpm_winnt</a></code>�� ���� Ư�� �÷����� �����
381      �� �ִ� MPM�� �ִ�. �Ϲ����� ���н��� �ý����� ���� MPM
382      �߿� �ϳ��� ������ �� �ִ�. �������� �ӵ���
383      Ȯ�强(scalability)�� � MPM�� �����߳Ŀ� �޷ȴ�:</p>
384
385      <ul>
386
387        <li><code class="module"><a href="/mod/worker.html">worker</a></code> MPM�� ���� �ڽ� ���μ�����
388        ���� ���� �����带 ����Ѵ�. �� ������� �ѹ� �� ������
389        ����Ѵ�. �Ϲ������� worker�� prefork MPM ���� ����
390        �޸��� ����ϹǷ� ��ŷ��� ���� ������ �����ϴ�.</li>
391
392        <li><code class="module"><a href="/mod/prefork.html">prefork</a></code> MPM�� �����尡 �Ѱ��� �ڽ�
393        ���μ����� ������ ����Ѵ�. �� ���μ����� �ѹ� ��
394        ������ ����Ѵ�. ���� �ý��ۿ��� prefork�� �ӵ��� worker��
395        ���������, �� ���� �޸��� ����Ѵ�. ������ ���� ��Ȳ����
396        �����带 ������� �ʴ� prefork ����� worker�� ����
397        ������ �����: �����忡 �������� (thread-safe) ����
398        �����ڰ� ���� ����� ����� �� �ְ�, ������ ����� ������
399        ����� �÷��� ���� ������� �� �ִ�.</li>
400
401      </ul>
402
403      <p>�� MPM��� �ٸ� MPM�� ���� �� �ڼ��� ������ MPM <a href="/mpm.html">����</a>�� ����ϱ� �ٶ���.</p>
404
405    
406
407    <h3><a name="modules" id="modules">���</a></h3>
408
409        
410
411        <p>�޸� ��뷮�� ���ɿ��� ���� �߿��� �����̱⶧����
412        ������ ������� �ʴ� ����� �����غ���. ����� <a href="/dso.html">DSO</a>�� �������ߴٸ� ������ ��
413        ��⿡ ���� <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code> ���þ �ּ�ó���ϸ�
414        �ȴ�. �׷��� ����� �����ϰ� �����Ͽ� ����Ʈ�� �����̵�
415        ���������� �����ϴ��� ���캼 �� �ִ�.</p>
416
417        <p>�ݴ�� ����� ����ġ �������Ͽ� �������� ��ũ���ִٸ�
418        ������ �ʴ� ����� �����ϱ����� ����ġ�� ���������ؾ�
419        �Ѵ�.</p>
420
421        <p>���⼭ �翬�� � ����� ����ϰ� ������� ����
422        �ǹ��� ����. ������ ������Ʈ���� �ٸ���. �׷��� �Ƹ���
423        <em>�ּ���</em> <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code>,
424        <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code>, <code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code>
425        ����� ����� ���̴�. ���� ������Ʈ�� �α������� �ʿ��ٸ�
426        <code>mod_log_config</code>�� �� �ȴ�. �׷��� ��õ����
427        �ʴ´�.</p>
428
429    
430
431    <h3>Atomic ���</h3>
432
433      
434
435      <p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> ���� ���� �ֱ� ��������
436      worker MPM�� APR�� atomic API�� ����Ѵ�. �� API�� �淮��
437      ������ ����ȭ�� ���� atomic ����� �����Ѵ�.</p>
438
439      <p>�⺻������ APR�� �� �ü��/CPU �÷��� ���� ȿ������
440      ����� ����Ͽ� �� ����� �����Ѵ�. ���� ���, ���� �ֽ�
441      CPU���� �ϵ����� atomic compare-and-swap (CAS) ������
442      �ϴ� ��ɾ �ִ�. �׷��� � �÷��� APR�� �̷�
443      ��ɾ ��� ������ CPU�� ȣȯ���� ���� �� ���� mutex���
444      ������ �⺻������ ����Ѵ�. �̷� �÷��� ����ġ��
445      �������Ҷ� ����ġ�� �ֽ� CPU������ ������ ��ȹ�̶��,
446      ����ġ�� �����Ҷ� <code>--enable-nonportable-atomics</code>
447      �ɼ��� ����Ͽ� �� �� atomic ������ ������ �� �ִ�:</p>
448
449      <div class="example"><p><code>
450        /buildconf<br />
451        /configure --with-mpm=worker --enable-nonportable-atomics=yes
452      </code></p></div>
453
454      <p><code>--enable-nonportable-atomics</code> �ɼ��� ������
455      ���� �÷��� ������ �ִ�:</p>
456
457      <ul>
458
459        <li>SPARC���� Solaris<br />
460            �⺻������ APR�� Solaris/SPARC���� mutex��� atomic��
461            ����Ѵ�. �׷��� �����Ҷ�
462            <code>--enable-nonportable-atomics</code>�� ����ϸ�
463            APR�� �� �ϵ���� compare-and-swap�� ���� SPARC
464            v8plus ��ɾ ����Ѵ�. �� �ɼ��� ����ϸ� atomic
465            ����� �� ȿ���������� (CPU�� �� ����ϰ� �� ����
466            ����ȭ�� �����ϴ�), �������� ���������� UltraSPARC
467            Ĩ������ ������ �� �ִ�.
468        </li>
469
470        <li>Linux on x86<br />
471            �⺻������ APR�� ���������� mutex��� atomic��
472            ����Ѵ�. �׷��� �����Ҷ�
473            <code>--enable-nonportable-atomics</code>�� ����ϸ�
474            APR�� �� �ϵ���� compare-and-swap�� ���� 486
475            ��ɾ ����Ѵ�. �� ȿ������ atomic ����� ����������,
476            �������� ���������� 486 �̻� Ĩ������ (386�� �ȵȴ�)
477            ������ �� �ִ�.
478        </li>
479
480      </ul>
481
482    
483
484    <h3>mod_status�� ExtendedStatus On</h3>
485
486      
487
488      <p>����ġ�� �������Ҷ� <code class="module"><a href="/mod/mod_status.html">mod_status</a></code>�� �����ϰ�
489      �����Ҷ� <code>ExtendedStatus On</code>�� �����ϸ� ����ġ��
490      ��û�� ���������� <code>gettimeofday(2)</code>(Ȥ�� �ü����
491      ��� <code>times(2)</code>)�� �ι� ȣ���ϰ� (1.3 �����)
492      <code>time(2)</code>�� �߰��� ������ ȣ���Ѵ�. ���� ������
493      ���۽ð��� �ʿ��ϱ� �����̴�. �ֻ��� ������ ��������
494      (�⺻����) <code>ExtendedStatus off</code>�� �����Ѵ�.</p>
495
496    
497
498    <h3>accept ����ȭ - ���� ����</h3>
499
500      
501
502    <div class="warning"><h3>����:</h3>
503      <p> �Ʒ� ������ ����ġ ������ 2.0 ���� ����� ������
504      ��� ���� �ʴ�. ������ ��ȿ�� ������ ������, �����ؼ�
505      ����ϱ� �ٶ���.</p>
506    </div>
507
508      <p>���н� ���� API�� ������ �����Ѵ�. �������� ���� ��Ʈ
509      Ȥ�� ���� �ּҸ� ��ٸ������� ���� <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>�� ����Ѵٰ� ��������.
510      ������ �������� �� ������ �˻��ϱ����� ����ġ��
511      <code>select(2)</code>�� ����Ѵ�. <code>select(2)</code>��
512      ���Ͽ� ��ٸ��� �ִ� ������ <em>�����</em> Ȥ�� <em>�ּ���
513      �Ѱ�</em> �ִ��� �˷��ش�. ����ġ���� ���� �ڽ��� �ְ�,
514      ���� �ִ� ��� �ڽ��� ���ÿ� ���ο� ������ �˻��Ѵ�. ��
515      ������ ������ ����ϴ� (�� ���� �ڵ忡�� �������� �ʾҴ�.
516      ���� �����ϱ����� �뵵�� ������.):</p>
517
518      <div class="example"><p><code>
519        for (;;) {<br />
520        <span class="indent">
521          for (;;) {<br />
522          <span class="indent">
523            fd_set accept_fds;<br />
524            <br />
525            FD_ZERO (&amp;accept_fds);<br />
526            for (i = first_socket; i &lt;= last_socket; ++i) {<br />
527            <span class="indent">
528              FD_SET (i, &amp;accept_fds);<br />
529            </span>
530            }<br />
531            rc = select (last_socket+1, &amp;accept_fds, NULL, NULL, NULL);<br />
532            if (rc &lt; 1) continue;<br />
533            new_connection = -1;<br />
534            for (i = first_socket; i &lt;= last_socket; ++i) {<br />
535            <span class="indent">
536              if (FD_ISSET (i, &amp;accept_fds)) {<br />
537              <span class="indent">
538                new_connection = accept (i, NULL, NULL);<br />
539                if (new_connection != -1) break;<br />
540              </span>
541              }<br />
542            </span>
543            }<br />
544            if (new_connection != -1) break;<br />
545          </span>
546          }<br />
547          process the new_connection;<br />
548        </span>
549        }
550      </code></p></div>
551
552      <p>�׷��� ���� �ܼ��� �������� �ɰ��� ��(starvation)
553      ������ �ִ�. ���� �ڽ��� ���ÿ� �� �ݺ����� �����ϸ�,
554      ��û�� ��ٸ��� ��� <code>select</code>���� �����. �̶�
555      � ���Ͽ� ��û�� �ϳ��� ������ ��� �ڽ��� ����
556      (���� �ڽ��� ������ �ü���� Ÿ�ֿ̹� ��� �ٸ���).
557      �̵��� ��� ������ <code>accept</code>�ϱ� �õ��Ѵ�. �׷���
558      (������ �� ���Ḹ ������̶��) �� �ڽĸ� �����ϰ�, ��������
559      <code>accept</code>���� <em>�����.</em> �׷��� �� �ڽĵ���
560      �� ������ ��û���� �����ϵ��� ������, �� �������� ���ο�
561      ��û�� ����� ���ͼ� ��� �ڽ��� ��ﶧ���� �������ִ�.
562      �̷� �� ������ <a href="http://bugs.apache.org/index/full/467">PR#467</a>��
563      ó�� ����Ǿ��. �ּ��� �ΰ��� �ذ�å�� �ִ�.</p>
564
565      <p>�Ѱ����� ������ ������� �ʵ��� (non-blocking) �����
566      ����̴�. �� ��� �ڽ��� <code>accept</code>�� �ص� ������
567      �ʰ�, ��� ������ �� �ִ�. �׷��� CPU �ð��� �����Ѵ�.
568      <code>select</code>���� ���� �ڽ��� 10�� �ְ�, ���� ������
569      �Ѱ� ���Դٰ� ��������. �׷��� �� �ڽ��� 9���� ����
570      ������ <code>accept</code>�ϱ� �õ��ϰ� �����ϸ� �ƹ�
571      �ϵ� ���� �ʰ� �ٽ� <code>select</code>�� �ݺ��Ѵ�. �ٽ�
572      <code>select</code>�� ���ƿ� ������ � �ڽĵ� �ٸ� ���Ͽ�
573      ���� ��û�� �������� �ʴ´�. (�������μ��� ��ǻ�Ϳ���)
574      ���� �ڽ� ������ŭ CPU ������ �ִ� �幮 ��찡 �ƴ϶��
575      �� �ذ�å�� ���� ���ƺ����� �ʴ´�.</p>
576
577      <p>�ٸ� ����� ����ġ�� ����ϴ� ������� ���� �ݺ�����
578      �� �ڽĸ��� �鿩������. �ݺ����� ������ ���� (���̸�
579      ��������):</p>
580
581      <div class="example"><p><code>
582        for (;;) {<br />
583        <span class="indent">
584          <strong>accept_mutex_on ();</strong><br />
585          for (;;) {<br />
586          <span class="indent">
587            fd_set accept_fds;<br />
588            <br />
589            FD_ZERO (&amp;accept_fds);<br />
590            for (i = first_socket; i &lt;= last_socket; ++i) {<br />
591            <span class="indent">
592              FD_SET (i, &amp;accept_fds);<br />
593            </span>
594            }<br />
595            rc = select (last_socket+1, &amp;accept_fds, NULL, NULL, NULL);<br />
596            if (rc &lt; 1) continue;<br />
597            new_connection = -1;<br />
598            for (i = first_socket; i &lt;= last_socket; ++i) {<br />
599            <span class="indent">
600              if (FD_ISSET (i, &amp;accept_fds)) {<br />
601              <span class="indent">
602                new_connection = accept (i, NULL, NULL);<br />
603                if (new_connection != -1) break;<br />
604              </span>
605              }<br />
606            </span>
607            }<br />
608            if (new_connection != -1) break;<br />
609          </span>
610          }<br />
611          <strong>accept_mutex_off ();</strong><br />
612          process the new_connection;<br />
613        </span>
614        }
615      </code></p></div>
616
617      <p><code>accept_mutex_on</code>�� <code>accept_mutex_off</code>
618      <a id="serialize" name="serialize">�Լ�</a>�� mutex �������
619      �����Ѵ�. �ѹ� ���� �� �ڽĸ��� mutex�� ���� �� �ִ�.
620      mutex�� �����ϴ� ����� ���������̴�. ���� ����� (1.3
621      ����) <code>src/conf.h</code>�� (1.3�� �� ����)
622      <code>src/include/ap_config.h</code>�� ���ǵ��ִ�. �
623      ��Ű���Ĵ� ���(locking) ����� �������� �ʱ⶧����, �̷�
624      ��Ű���Ŀ��� ���� <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> ���þ ����ϸ�
625      �����ϴ�.</p>
626
627      <p>����� <code class="directive"><a href="/mod/mpm_common.html#acceptmutex">AcceptMutex</a></code> ���þ ����Ͽ�
628      mutex ������ ������ �� �ִ�.</p>
629
630      <dl>
631        <dt><code>AcceptMutex flock</code></dt>
632
633        <dd>
634          <p>�� ����� ��������� ��ױ����� <code>flock(2)</code>
635          �ý���ȣ���� ����Ѵ� (������� ��ġ�� <code class="directive"><a href="/mod/mpm_common.html#lockfile">LockFile</a></code> ���þ�� ����).</p>
636        </dd>
637
638        <dt><code>AcceptMutex fcntl</code></dt>
639
640        <dd>
641          <p>�� ����� ��������� ��ױ����� <code>fcntl(2)</code>
642          �ý���ȣ���� ����Ѵ� (������� ��ġ�� <code class="directive"><a href="/mod/mpm_common.html#lockfile">LockFile</a></code> ���þ�� ����).</p>
643        </dd>
644
645        <dt><code>AcceptMutex sysvsem</code></dt>
646
647        <dd>
648          <p>(1.3�� �� ����) �� ����� SysV�� ������� ����Ͽ�
649          mutex�� �����Ѵ�. �������� SysV�� ��������� ����
650          ���ۿ��� �ִ�. �ϳ��� ����ġ�� ������� ��������
651          �ʰ� ���� �� �ִ� ���̴� (<code>ipcs(8)</code> manpage
652          ���). �ٸ� �ϳ��� �������� ������ uid�� �����ϴ�
653          CGI�� (<em>��,</em> <code>suexec</code>��
654          <code>cgiwrapper</code>�� ��������ʴ� �� ��� CGI)
655          �������� API�� ����Ͽ� �����źΰ���� �� �� �ִ�
656          ���̴�. �̷� ���������� IRIX�� ������ ��Ű���Ŀ���
657          �� ����� ������� �ʴ´� (��κ��� IRIX ��ǻ�Ϳ���
658          ���� �� ����� ����ġ�� ���̴�).</p>
659        </dd>
660
661        <dt><code>AcceptMutex pthread</code></dt>
662
663        <dd>
664          <p>(1.3�� �� ����) �� ����� POSIX mutex�� ����ϱ⶧����
665          POSIX ������ �Ծ��� ������ ������ ��Ű���Ķ�� ���
666          ��밡��������, (2.5 ����) Solaris������ �װ͵� Ư��
667          ���������� �����ϴ� ���ϴ�. �� ����� �õ��غ��ٸ�
668          ������ ���缭 ������ ���ϴ��� ������� �Ѵ�. ����
669          ���븸 �����ϴ� ������ �� �����ϴ� �� ����.</p>
670        </dd>
671
672        <dt><code>AcceptMutex posixsem</code></dt>
673
674        <dd>
675          <p>(2.0�� �� ����) �� ����� POSIX ������� ����Ѵ�.
676          mutex�� ���� ���μ����� �����尡 �״´ٸ�(segfault)
677          �������� �������� ȸ������ �ʾƼ� �������� �����.</p>
678        </dd>
679
680      </dl>
681
682      <p>�ý��ۿ� �� ��Ͽ� ��� ����ȭ(serialization) �����
683      �ִٸ� �� ����� ����ϴ� �ڵ带 APR�� �߰��� ��ġ�� �ִ�.</p>
684
685      <p>����� �غ����� ������������ �ٸ� ����� �κ�������
686      �ݺ����� ����ȭ�ϴ� ����̴�. ��, ���μ����� ��� �鿩������
687      ���̴�. �� ����� ���� �ڽ��� ���ÿ� ������ �� �־
688      ����ȭ������ ��ü �뿪���� Ȱ������ ���ϴ� �������μ���
689      ��ǻ�Ϳ����� ����� ������ �� �ִ�. ������ ���캼 �κ�������,
690      �ſ� ����ȭ�� �������� ������ �ʾƼ� �켱������ ����.</p>
691
692      <p>�ֻ��� ������ ������ؼ��� ���� <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code> ���� ������� �ʴ�
693      ���� �̻����̴�. �׷��� ��� �����Ѵ�.</p>
694
695    
696
697    <h3>accept ����ȭ - ���� �Ѱ�</h3>
698
699      
700
701      <p>���� ������ ���߼��� �������� ������, ������ �Ѱ���
702      ������ ���? ������ �����Ҷ����� ��� �ڽ���
703      <code>accept(2)</code>���� �����ֱ⶧���� �̷л� ����
704      ������ �߻����� �ʰ�, �� ������ ���. �׷��� �����δ�
705      �տ��� ���� ������� �ʴ� (non-blocking) ��� �߻��ϴ�
706      "��ȸ��(spinning)" ������ ���߰� �ִ�. ��κ��� TCP ������
707      ������ �����ϸ� Ŀ���� <code>accept</code>���� �����ִ�
708      ��� �ڽ��� ��쵵�� �������ִ�. ���μ����� �Ѱ��� ������
709      ��� ����ڿ������� ���ư���, �������� Ŀ�ο��� ��ȸ���Ͽ�
710      ������ ������ �߰��ϸ� �ٽ� ���� �ܴ�. ����ڿ��� �ڵ忡����
711      �̷� ��ȸ���� �� �� ������, �и��� �����Ѵ�. �׷��� ���߼�����
712      ������� �ʴ� ���� �����ϰ� ���ϸ� ���̴� ���ʿ��� �ൿ��
713      �Ͼ��.</p>
714
715      <p>�׷��� �츮�� ���� ��Ű���Ŀ��� ������ �Ѱ��� ��쿡��
716      ����ȭ�ϸ� �� "��" �������� �߰��ߴ�. �׷��� ���� ��κ���
717      ��� �⺻������ ����ȭ�� ����Ѵ�. ���������� (Ŀ�� 2.0.30,
718      128Mb �޸��� ��� Pentium pro) ������ ��� ���� �Ѱ���
719      ����ȭ�ϸ� ���� ���� ��쿡 ���� �ʴ� ��û�� 3% �̸�
720      �پ����. �׷��� ����ȭ�� ���� ���� ��� ��û�� 100ms
721      ������ �߻��ߴ�. �� ������ �Ƹ��� LAN���� �߻��ϴ� ��
722      ���ἱ������ ���̴�. ������ �Ѱ��� ��� ����ȭ�� �������
723      �������� <code>SINGLE_LISTEN_UNSERIALIZED_ACCEPT</code>��
724      �����Ѵ�.</p>
725
726    
727
728    <h3>Close ����(lingering)</h3>
729
730      
731
732      <p><a href="http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-connection-00.txt">
733      draft-ietf-http-connection-00.txt</a> 8�� �����ϵ���
734      <strong>��������</strong> �������� �Ƿ���, ����� �� ������
735      ���������� ���� �� �־�� �Ѵ� (TCP ������ �ֹ����̰�,
736      ������ ���� �������̴�). ������ �ٸ� ���������� ����
737      ����������, ����ġ�� 1.2���� ��Ȯ�� �����ؿԴ�.</p>
738
739      <p>�� ����� �������ϰ� ����ġ�� �߰������� ���� ���н�
740      ���� ���� ������ �߻��ߴ�. TCP �Ծ���
741      <code>FIN_WAIT_2</code>�� Ÿ�Ӿƿ��� �ִٰ� ������ �ʾ�����,
742      ���������� �ʾҴ�. Ÿ�Ӿƿ��� ��� �ý��ۿ��� ����ġ 1.2��
743      ���� ������ ������ <code>FIN_WAIT_2</code> ���·� ������.
744      ���� ��� �� ������ ���ۻ簡 �����ϴ� �ֽ� TCP/IP ��ġ��
745      ����Ͽ� �ذ��� �� �ִ�. �׷��� ���ۻ簡 ��ġ�� ��ǥ����
746      �ʴ� ��찡 (<em>��,</em> SunOS4 -- �ҽ� ���̼����� �ִ�
747      ����� ���� ��ġ�� �� ������) �ֱ⶧���� �� ����� �������
748      �ʱ�� �����ߴ�.</p>
749
750      <p>����� �ΰ�����. �ϳ��� ���� �ɼ� <code>SO_LINGER</code>��
751      ����ϴ� ����̴�. �׷��� �������� ��κ��� TCP/IP ������
752      �� �ɼ��� �ùٷ� �������� �ʾҴ�. �ùٷ� ������ ���ÿ���
753      ������ (<em>��,</em> ������ 2.0.31) �� ����� ���� ����
754      �� cpu�� ��ƸԴ´�.</p>
755
756      <p>����ġ�� ���� (<code>http_main.c</code>�� �ִ�)
757      <code>lingering_close</code>��� �Լ��� ����Ѵ�. �� �Լ���
758      ���� ������ ����:</p>
759
760      <div class="example"><p><code>
761        void lingering_close (int s)<br />
762        {<br />
763        <span class="indent">
764          char junk_buffer[2048];<br />
765          <br />
766          /* shutdown the sending side */<br />
767          shutdown (s, 1);<br />
768          <br />
769          signal (SIGALRM, lingering_death);<br />
770          alarm (30);<br />
771          <br />
772          for (;;) {<br />
773          <span class="indent">
774            select (s for reading, 2 second timeout);<br />
775            if (error) break;<br />
776            if (s is ready for reading) {<br />
777            <span class="indent">
778              if (read (s, junk_buffer, sizeof (junk_buffer)) &lt;= 0) {<br />
779              <span class="indent">
780                break;<br />
781              </span>
782              }<br />
783              /* just toss away whatever is here */<br />
784            </span>
785            }<br />
786          </span>
787          }<br />
788          <br />
789          close (s);<br />
790        </span>
791        }
792      </code></p></div>
793
794      <p>�� �ڵ�� ������ ������ �� CPU�� ���������, ��������
795      ������ ���� �ʿ��ϴ�. HTTP/1.1�� �� �θ� ������ ��� ������
796      �����Ѵٸ�(persistent), ������ �޴� ����� ���� ��û��
797      ó���ϸ鼭 ���� ���̴�. �����ϰԵ�
798      <code>NO_LINGCLOSE</code>�� �����Ͽ� �� ����� �������
799      ���� �� ������, ���� ������ �ʴ´�. Ư�� HTTP/1.1
800      ���������� <span class="transnote">(<em>����;</em> �������� ���¿��� ������ ��ٸ���
801      �ʰ� ���� ��û�� ������ ���)</span> ������������
802      <code>lingering_close</code>�� �ʼ����̴� (�׸��� <a href="http://www.w3.org/Protocols/HTTP/Performance/Pipeline.html">
803      ���������� ������ �� ��⶧����</a> ����ϱ� �ٶ� ���̴�).</p>
804
805    
806
807    <h3>Scoreboard ����</h3>
808
809      
810
811      <p>����ġ�� �θ�� �ڽ��� scoreboard��� ���� ���� ����
812      ����Ѵ�. �̻������δ� scoreboard�� �����޸��� �����ؾ�
813      �Ѵ�. �츮 �����ڰ� �ش� �ü���� ������ �� �ְų� ����
814      ���� ��� ���� ��� ���� �����޸��� ����Ͽ� �����Ѵ�.
815      �������� ��ũ�� �ִ� ������ ����Ͽ� �����Ѵ�. ��ũ��
816      �ִ� ������ ������ �ŷڵ��� ������� (��ɵ� �� ���).
817      <code>src/main/conf.h</code> ���Ͽ��� ����ϴ� ��Ű���ĸ�
818      ã�Ƽ� <code>USE_MMAP_SCOREBOARD</code> Ȥ��
819      <code>USE_SHMGET_SCOREBOARD</code>���� Ȯ���Ѵ�. ����
820      �ϳ��� (���� �Բ� ����� <code>HAVE_MMAP</code>�̳�
821      <code>HAVE_SHMGET</code>�� ����) �����ϸ� �����޸� �ڵ带
822      ����Ѵ�. �ý����� �ٸ� ������ �����޸��� ����Ѵٸ�
823      <code>src/main/http_main.c</code> ������ �����Ͽ� ����ġ����
824      �����޸��� ����� �� �ֵ��� ��(hook)�� �߰��϶�. (����
825      ��ġ�� �츮���� �����ֱ� �ٶ���.)</p>
826
827      <div class="note">������ ����: ����ġ�� ������ ������ ����ġ 1.2 �������
828      �����޸��� ����ϱ� �����ߴ�. ���������� �ʱ� ����ġ
829      ������ ������ �ŷڵ��� �������� �����̴�.</div>
830
831    
832
833    <h3>DYNAMIC_MODULE_LIMIT</h3>
834
835      
836
837      <p>����� �������� �о������ �ʴ´ٸ� (������ �����̶�
838      ������ ���̱����� �� ���� �д´ٸ� �Ƹ��� ����� ��������
839      �о������ ���� ���̴�), ������ �������Ҷ�
840      <code>-DDYNAMIC_MODULE_LIMIT=0</code>�� �߰��Ѵ�. �׷���
841      ����� �������� �о���̱����� �Ҵ��ϴ� �޸��� ����Ѵ�.</p>
842
843    
844
845  </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
846<div class="section">
847<h2><a name="trace" id="trace">�η�: �ý���ȣ�� ����� �ڼ��� �м��ϱ�</a></h2>
848
849    
850
851    <p>������ Solaris 8���� worker MPM�� ����� ����ġ 2.0.38��
852    �ý���ȣ�� ���(trace)�̴�. �Ʒ� ��ɾ ����Ͽ� �����
853    ����:</p>
854
855    <div class="example"><p><code>
856      truss -l -p <var>httpd_child_pid</var>.
857    </code></p></div>
858
859    <p><code>-l</code> �ɼ��� ����ϸ� truss�� �ý���ȣ����
860    �ϴ� LWP (lightweight process, �淮�� ���μ���--Solaris��
861    Ŀ�μ��� ������) ID�� ���� ����Ѵ�.</p>
862
863    <p>�ٸ� �ý��ۿ��� <code>strace</code>, <code>ktrace</code>,
864    <code>par</code> ���� �ý���ȣ�� ���� ������ �ִ�. ����
865    ����ϴ�.</p>
866
867    <p>Ŭ���̾�Ʈ�� ���������� ũ�Ⱑ 10KB�� ���� ������ ��û�Ѵ�.
868    ������ ������ ��û���� �ʰų� ��������ϴ� ��û�� �� ���
869    ����� �ſ� �ٸ��� (���δ� �ſ� �˾ƺ��� ����).</p>
870
871    <div class="example"><pre>/67:    accept(3, 0x00200BEC, 0x00200C0C, 1) (sleeping...)
872/67:    accept(3, 0x00200BEC, 0x00200C0C, 1)            = 9</pre></div>
873
874    <p>������ ������(listener) �����尡 LWP #67���� �������
875    �� �� �ִ�.</p>
876
877    <div class="note"><code>accept(2)</code> ����ȭ�� ������� ������ �ָ��϶�.
878    ���� ��Ʈ�� ��ٸ����ʴ� ��� �� �÷����� worker MPM��
879    �⺻������ ����ȭ���� ���� accept�� ����Ѵ�.</div>
880
881    <div class="example"><pre>/65:    lwp_park(0x00000000, 0)                         = 0
882/67:    lwp_unpark(65, 1)                               = 0</pre></div>
883
884    <p>������ �޾Ƶ��̰�(accept) ������ �������
885    worker �����带 ����� ��û�� ó���ϰ� �Ѵ�. �Ʒ� ��Ͽ���
886    ��û�� ó���ϴ� worker �����尡 LWP #65���� �� �� �ִ�.</p>
887
888    <div class="example"><pre>/65:    getsockname(9, 0x00200BA4, 0x00200BC4, 1)       = 0</pre></div>
889
890    <p>����ȣ��Ʈ�� �����ϱ����� ����ġ�� ������ �޾Ƶ���
891    ����(local) ���� �ּҸ� �˾ƾ� �Ѵ�. (����ȣ��Ʈ�� �������
892    �ʰų� <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>
893    ���þ ���ϵ�ī�� �ּҸ� ������� ���� ��� ��) ���� ���
894    �� ȣ���� ��� �� �ִ�. �׷��� ���� �̷� ����ȭ �۾���
895    �ȵ��ִ�. </p>
896
897    <div class="example"><pre>/65:    brk(0x002170E8)                                 = 0
898/65:    brk(0x002190E8)                                 = 0</pre></div>
899
900    <p><code>brk(2)</code> ȣ���� ��(heap)���� �޸��� �Ҵ��Ѵ�.
901    �������� ��κ��� ��û ó���� ��ü �޸�
902    �Ҵ���(<code>apr_pool</code>�� <code>apr_bucket_alloc</code>)��
903    ����ϱ⶧���� �ý���ȣ�� ��Ͽ��� �� �ý���ȣ���� ���Ⱑ
904    �幰��. �� ��Ͽ��� �������� �������ڸ��� ��ü �޸� �Ҵ��ڰ�
905    ����� �޸������ ������� <code>malloc(3)</code>�� ȣ���Ѵ�.</p>
906
907    <div class="example"><pre>/65:    fcntl(9, F_GETFL, 0x00000000)                   = 2
908/65:    fstat64(9, 0xFAF7B818)                          = 0
909/65:    getsockopt(9, 65535, 8192, 0xFAF7B918, 0xFAF7B910, 2190656) = 0
910/65:    fstat64(9, 0xFAF7B818)                          = 0
911/65:    getsockopt(9, 65535, 8192, 0xFAF7B918, 0xFAF7B914, 2190656) = 0
912/65:    setsockopt(9, 65535, 8192, 0xFAF7B918, 4, 2190656) = 0
913/65:    fcntl(9, F_SETFL, 0x00000082)                   = 0</pre></div>
914
915    <p>���� worker ������� Ŭ���̾�Ʈ�� ����(���ϱ���� 9)��
916    ������(non-blocking) ���·� �ٲ۴�. <code>setsockopt(2)</code>��
917    <code>getsockopt(2)</code> ȣ���� Solaris�� libc�� ���Ͽ�
918    ���� <code>fcntl(2)</code>�� ��� ó���ϴ��� �����ش�.</p>
919
920    <div class="example"><pre>/65:    read(9, " G E T   / 1 0 k . h t m".., 8000)     = 97</pre></div>
921
922    <p>worker ������� Ŭ���̾�Ʈ�� ���� ��û�� �д´�.</p>
923
924    <div class="example"><pre>/65:    stat("/var/httpd/apache/httpd-8999/htdocs/10k.html", 0xFAF7B978) = 0
925/65:    open("/var/httpd/apache/httpd-8999/htdocs/10k.html", O_RDONLY) = 10</pre></div>
926
927    <p>������ ������ <code>Options FollowSymLinks</code>��
928    <code>AllowOverride None</code>�̴�. �׷��� ��û�� ���ϰ����
929    �� ���丮�� ���� <code>lstat(2)</code>�ϰų�
930    <code>.htaccess</code> ������ �˻��� �ʿ䰡 ���. ������
931    �˻��ϱ�����, 1) ������ �ִ���, 2) ���丮�� �ƴ� �Ϲ���������,
932    <code>stat(2)</code> ȣ�⸸ �ϸ� �ȴ�.</p>
933
934    <div class="example"><pre>/65:    sendfilev(0, 9, 0x00200F90, 2, 0xFAF7B53C)      = 10269</pre></div>
935
936    <p>�� ��� �������� �ѹ��� <code>sendfilev(2)</code> �ý���ȣ���
937    HTTP ��������� ��û�� ������ ����� �� �ִ�. Sendfile ����δ�
938    �ü������ �ٸ���. �ٸ� �ý����̶�� <code>sendfile(2)</code>��
939    ȣ���ϱ� �� ����� ���������� <code>write(2)</code>��
940    <code>writev(2)</code> ȣ���� �Ѵ�.</p>
941
942    <div class="example"><pre>/65:    write(4, " 1 2 7 . 0 . 0 . 1   -  ".., 78)      = 78</pre></div>
943
944    <p><code>write(2)</code> ȣ���� ���ٷα�(access log)�� ��û��
945    ����Ѵ�. �� ��Ͽ� <code>time(2)</code> ȣ���� ������ �ָ��϶�.
946    ����ġ 1.3�� �޸� ����ġ 2.0�� �ð��� �˱�����
947    <code>gettimeofday(3)</code>�� ����Ѵ�.
948    <code>gettimeofday</code>�� ����ȭ�� �������� Solaris ����
949    ��� �ü�������� �Ϲ����� �ý���ȣ�� �δ��� ���.</p>
950
951    <div class="example"><pre>/65:    shutdown(9, 1, 1)                               = 0
952/65:    poll(0xFAF7B980, 1, 2000)                       = 1
953/65:    read(9, 0xFAF7BC20, 512)                        = 0
954/65:    close(9)                                        = 0</pre></div>
955
956    <p>worker ������� ������ �����ݱ�(lingering close)�Ѵ�.</p>
957
958    <div class="example"><pre>/65:    close(10)                                       = 0
959/65:    lwp_park(0x00000000, 0)         (sleeping...)</pre></div>
960
961    <p>���������� worker ������� ��� ����� ������ �ݰ�,
962    ������(listener) �����尡 �ٸ� ������ �Ҵ��� ������
963    �����Ѵ�.</p>
964
965    <div class="example"><pre>/67:    accept(3, 0x001FEB74, 0x001FEB94, 1) (sleeping...)</pre></div>
966
967    <p>�׵��� ������ ������� ������ (��� worker�� �۾����̸�
968    ������ �����带 ���ߴ� worker MPM�� �帧���� ��ɿ� ���)
969    worker �����忡 �Ҵ����ڸ��� �ٸ� ������ �޾Ƶ��� �� �ִ�.
970    �� ��Ͽ��� ������ ������, worker �����尡 ��� ���� ������
971    ó���ϴ� ���� ���� <code>accept(2)</code>�� (��û�� �ſ�
972    ���� ��� �׻�) �Ͼ �� �ִ�.</p>
973
974  </div></div>
975<div class="bottomlang">
976<p><span>������ ���: </span><a href="/en/misc/perf-tuning.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |
977<a href="/fr/misc/perf-tuning.html" hreflang="fr" rel="alternate" title="Fran&#231;ais">&nbsp;fr&nbsp;</a> |
978<a href="/ko/misc/perf-tuning.html" title="Korean">&nbsp;ko&nbsp;</a> |
979<a href="/tr/misc/perf-tuning.html" hreflang="tr" rel="alternate" title="T&#252;rk&#231;e">&nbsp;tr&nbsp;</a></p>
980</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
981<script type="text/javascript"><!--//--><![CDATA[//><!--
982var comments_shortname = 'httpd';
983var comments_identifier = 'http://httpd.apache.org/docs/2.4/misc/perf-tuning.html';
984(function(w, d) {
985    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
986        d.write('<div id="comments_thread"><\/div>');
987        var s = d.createElement('script');
988        s.type = 'text/javascript';
989        s.async = true;
990        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
991        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
992    }
993    else { 
994        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
995    }
996})(window, document);
997//--><!]]></script></div><div id="footer">
998<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
999<p class="menu"><a href="/mod/">���</a> | <a href="/mod/directives.html">���þ��</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">���</a> | <a href="/sitemap.html">����Ʈ��</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
1000if (typeof(prettyPrint) !== 'undefined') {
1001    prettyPrint();
1002}
1003//--><!]]></script>
1004</body></html>