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